Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NSP API to workspaces #28733

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"swagger": "2.0",
"info": {
"version": "2021-10-01",
"title": "Azure Log Analytics Network Security Perimeter APIs",
"description": "Provides NSP operations for working with Log Analytics."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations": {
"get": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Gets a list of NSP configurations for specified workspace.",
"operationId": "Workspaces_ListNSP",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the list of configs.",
"schema": {
"$ref": "./networksecurityperimeter.json#/definitions/NetworkSecurityPerimeterConfigurationListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"x-ms-examples": {
"List NSP configs by Scheduled Query Rule": {
"$ref": "./examples/NSPForWorkspaces_List.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}": {
"get": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Gets a network security perimeter configuration.",
"operationId": "Workspaces_GetNSP",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/NetworkSecurityPerimeterConfigurationNameParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the config.",
"schema": {
"$ref": "./networksecurityperimeter.json#/definitions/NetworkSecurityPerimeterConfiguration"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-examples": {
"Get NSP config by name for Scheduled Query Rule": {
"$ref": "./examples/NSPForWorkspaces_Get.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile": {
"post": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Reconcile network security perimeter configuration for Workspace resource.",
"operationId": "Workspaces_ReconcileNSP",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../common/v1/types.json#/parameters/WorkspaceNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/NetworkSecurityPerimeterConfigurationNameParameter"
}
],
"responses": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responses

will there be no case of returning 200 to user on this POST ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we always send 202

"202": {
"description": "Request to reconcile the association accepted.",
"headers": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding retry-after ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we always send 202

"Location": {
"type": "string"
}
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
},
"x-ms-examples": {
"Reconcile NSP config for Scheduled Query Rule": {
"$ref": "./examples/NSPForWorkspaces_Reconcile.json"
}
}
}
}
},
"definitions": {},
"parameters": {
"NetworkSecurityPerimeterConfigurationNameParameter": {
"name": "networkSecurityPerimeterConfigurationName",
"in": "path",
"required": true,
"type": "string",
"pattern": "^.*$",
"minLength": 1,
"maxLength": 512,
"x-ms-parameter-location": "method",
"description": "The name for a network security perimeter configuration"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "exampleRG",
"workspaceName": "someWorkspace",
"networkSecurityPerimeterConfigurationName": "somePerimeterConfiguration",
"api-version": "2021-10-01"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.OperationalInsights/workspaces/someWorkspace/networkSecurityPerimeterConfigurations/somePerimeterConfiguration",
"name": "somePerimeterConfiguration",
"type": "Microsoft.OperationalInsights/workspaces/networkSecurityPerimeterConfigurations",
"properties": {
"provisioningState": "Accepted",
"networkSecurityPerimeter": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1",
"location": "japaneast"
},
"resourceAssociation": {
"name": "assoc1",
"accessMode": "Enforced"
},
"profile": {
"name": "profile1",
"accessRulesVersion": 0,
"accessRules": [
{
"name": "rule1",
"properties": {
"direction": "Inbound",
"addressPrefixes": [
"148.0.0.0/8",
"152.4.6.0/24"
]
}
}
]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "exampleRG",
"workspaceName": "someWorkspace",
"api-version": "2021-10-01"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/exampleRG/providers/Microsoft.OperationalInsights/workspaces/someWorkspace/networkSecurityPerimeterConfigurations/somePerimeterConfiguration",
"name": "somePerimeterConfiguration",
"type": "Microsoft.OperationalInsights/workspaces/networkSecurityPerimeterConfigurations",
"properties": {
"provisioningState": "Accepted",
"networkSecurityPerimeter": {
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1",
"location": "japaneast"
},
"resourceAssociation": {
"name": "assoc1",
"accessMode": "Enforced"
},
"profile": {
"name": "profile1",
"accessRulesVersion": 0,
"accessRules": [
{
"name": "rule1",
"properties": {
"direction": "Inbound",
"addressPrefixes": [
"148.0.0.0/8",
"152.4.6.0/24"
]
}
}
]
}
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parameters": {
"subscriptionId": "00000000-1111-2222-3333-444444444444",
"resourceGroupName": "exampleRG",
"workspaceName": "someWorkspace",
"networkSecurityPerimeterConfigurationName": "somePerimeterConfiguration",
"api-version": "2021-10-01"
},
"responses": {
"202": {
"headers": {
"Location": "https://endpoint:port/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.OperationalInsights/locations/{location}/asyncoperations&api-version=2021-10-01"
}
}
}
}
Loading