Skip to content

Commit

Permalink
Add NSP API to multiple services under Microsoft.Insights RP (Azure#2…
Browse files Browse the repository at this point in the history
…8680)

* Add API and examples for NSP in ScheduledQueryRules

* Add API and examples for NSP in DataCollectionEndpoints

* Minor fixes for the api specs for ScheduledQueryRules and DCE

* Add NSP API for Action Groups

* Add new API to README.md

* Fix examples to include right param names

* Fix styling errors

* Include old version in default package tag

* Fix Swagger LintDiff validation issues

* Resolve resource name pattern restriction for configName in NSP

* Fix typo in param name

* Fix LintDiff warnings and errors

* Update spec title

* Update README with the correct package ver

* Rever back to original NSP swagger model

* Update README

* Replace 200 with 202 for reconcile

* Update reconcile examples with 202 response

* Fix 202 response headers for reconcile

* Update error object ref for LintDiff validation

* Fix LintDiff Warnings: Update swagger to use v5 types

* Fix LintDiff warnings

* Fix LintDiff warnings

* Fix Prettier check

* Resolve comments and update Data models

* Resolve merge conflicts for README

* Fix README

* Create sdk-suppressions.yaml

* Refactor NSP definitions into a common file

* Resolve merge conflicts

* Refactor code to use NSP Common types

* update API paths with nsp param name

* Fix param declaration in paths and add parameter definition

* Change str to int accross all API examples for accessRule ver property

---------

Co-authored-by: Akshit Goyal <akshitgoyal@microsoft.com>
Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com>
  • Loading branch information
3 people authored May 31, 2024
1 parent 775b4ba commit 061b617
Show file tree
Hide file tree
Showing 14 changed files with 1,726 additions and 688 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
{
"swagger": "2.0",
"info": {
"title": "Azure Action Groups Network Security Perimeter APIs",
"x-ms-code-generation-settings": {
"name": "MonitorManagementClient"
},
"version": "2021-10-01"
},
"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.Insights/actionGroups/{actionGroupName}/networkSecurityPerimeterConfigurations": {
"get": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Gets a list of NSP configurations for specified action group.",
"operationId": "ActionGroups_ListNSP",
"x-ms-examples": {
"Get an action group": {
"$ref": "./examples/NSPForActionGroups_List.json"
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ActionGroupNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the list of configs.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/networksecurityperimeter.json#/definitions/NetworkSecurityPerimeterConfigurationListResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}": {
"get": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Gets a specified NSP configuration for specified action group.",
"operationId": "ActionGroups_GetNSP",
"x-ms-examples": {
"Get NSP config by name for an action group": {
"$ref": "./examples/NSPForActionGroups_Get.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ActionGroupNameParameter"
},
{
"$ref": "#/parameters/NetworkSecurityPerimeterConfigurationNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successfully retrieved the NSP config.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/networksecurityperimeter.json#/definitions/NetworkSecurityPerimeterConfiguration"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile": {
"post": {
"tags": [
"NetworkSecurityPerimeterConfigurations"
],
"description": "Reconciles a specified NSP configuration for specified action group.",
"operationId": "ActionGroups_ReconcileNSP",
"x-ms-examples": {
"Reconcile NSP config by name for an action group": {
"$ref": "./examples/NSPForActionGroups_Reconcile.json"
}
},
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/ActionGroupNameParameter"
},
{
"$ref": "#/parameters/NetworkSecurityPerimeterConfigurationNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"202": {
"description": "Request to reconcile the association accepted.",
"headers": {
"Location": {
"type": "string"
}
}
},
"default": {
"description": "BadRequest",
"schema": {
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
}
}
},
"definitions": {},
"parameters": {
"ActionGroupNameParameter": {
"name": "actionGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the action group.",
"x-ms-parameter-location": "method",
"pattern": "^.*$",
"maxLength": 43
},
"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"
}
}
}
Loading

0 comments on commit 061b617

Please sign in to comment.