-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Closed
Add NSP API to workspaces #28733
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ecded4b
Add NSP API to workspaces
56b9571
Update deault package in README
f044951
Update README
5573b8a
Fix LintDiff changes
0b9de31
Resolve comments and update models
0ce1890
Update error response message
171ad56
Add description to NSP definitions for subscriptions and networksecur…
d3d4ffe
Create sdk-suppressions.yaml
msyyc f5e2056
Merge branch 'main' into akshitgoyal/microsoft-operationinsights-nsp
akshitgoyal 8962a6d
Refactor code to use common NSP types
b9b3b38
update API paths with nsp param name
00b2e3b
Fix parameter name
75931f7
Update config name in examples
597bb6f
Fix param declaration in paths
f4b67fb
add NetworkSecurityPerimeterConfigurationNameParameter definition
e1d9529
Change the version of common types to fix go sdk CI issue
7b474da
Prettier check
cc19e99
Add networksecurityperimeter.json common types with v2 ProxyResource …
87d46c5
Update the version of nsp common types copy to match with api versioning
26b76ab
add azure-sdk-for-go suppression
Alancere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
193 changes: 193 additions & 0 deletions
193
...rosoft.OperationalInsights/stable/2021-10-01/Workspaces_NetworkSecurityPerimeter_API.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": { | ||
"202": { | ||
"description": "Request to reconcile the association accepted.", | ||
"headers": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding retry-after ? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...anager/Microsoft.OperationalInsights/stable/2021-10-01/examples/NSPForWorkspaces_Get.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
...nager/Microsoft.OperationalInsights/stable/2021-10-01/examples/NSPForWorkspaces_List.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.../Microsoft.OperationalInsights/stable/2021-10-01/examples/NSPForWorkspaces_Reconcile.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will there be no case of returning 200 to user on this POST ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always send 202