From 29a80fe4f94cb79463abf7bdf957c0afb5ef4089 Mon Sep 17 00:00:00 2001 From: utbarn <66377251+utbarn@users.noreply.github.com> Date: Fri, 28 Aug 2020 08:01:29 +0530 Subject: [PATCH] Adding express route port authorization apis (#10491) * Adding express route port authorization apis * adding left out changes for prev commit * adding left out changes for prev commit * removing name as its handled by upper class * fixing model validation * making port auth key read only * making enum unique * making authorizations child resource only * part of last commit * fixing last commit * fixing last commit * removing child resource authorizations from parent port request and response --- ...sRouteCircuitCreateOnExpressRoutePort.json | 3 + .../ExpressRoutePortAuthorizationCreate.json | 40 +++ .../ExpressRoutePortAuthorizationDelete.json | 14 + .../ExpressRoutePortAuthorizationGet.json | 25 ++ .../ExpressRoutePortAuthorizationList.json | 28 ++ .../2020-07-01/expressRouteCircuit.json | 4 + .../stable/2020-07-01/expressRoutePort.json | 327 ++++++++++++++++++ 7 files changed, 441 insertions(+) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationCreate.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationDelete.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationGet.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationList.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json index 98f7fcdb1f06..14a8a4cf9655 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRouteCircuitCreateOnExpressRoutePort.json @@ -16,6 +16,7 @@ "expressRoutePort": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName" }, + "authorizationKey": "b0be57f5-1fba-463b-adec-ffe767354cdd", "bandwidthInGbps": 10 } } @@ -34,6 +35,7 @@ "expressRoutePort": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName" }, + "authorizationKey": "b0be57f5-1fba-463b-adec-ffe767354cdd", "bandwidthInGbps": 10, "circuitProvisioningState": "Enabled", "allowClassicOperations": false, @@ -61,6 +63,7 @@ "expressRoutePort": { "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/expressRoutePorts/portName" }, + "authorizationKey": "b0be57f5-1fba-463b-adec-ffe767354cdd", "bandwidthInGbps": 10, "circuitProvisioningState": "Enabled", "allowClassicOperations": false, diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationCreate.json new file mode 100644 index 000000000000..278177bf660c --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationCreate.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "expressRoutePortName": "expressRoutePortName", + "resourceGroupName": "rg1", + "authorizationName": "authorizatinName", + "api-version": "2020-07-01", + "subscriptionId": "subid", + "authorizationParameters": { + "properties": {} + } + }, + "responses": { + "201": { + "body": { + "name": "authorizationName", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName", + "etag": "W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\"", + "properties": { + "provisioningState": "Updating", + "authorizationUseStatus": "Available", + "circuit": "" + }, + "type": "Microsoft.Network/expressRoutePorts/authorizations" + } + }, + "200": { + "body": { + "name": "authorizationName", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName", + "etag": "W/\"e22dd4b2-4c24-44cf-b702-70a472b62914\"", + "properties": { + "provisioningState": "Updating", + "authorizationUseStatus": "Available", + "circuit": "" + }, + "type": "Microsoft.Network/expressRoutePorts/authorizations" + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationDelete.json new file mode 100644 index 000000000000..69a513459531 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationDelete.json @@ -0,0 +1,14 @@ +{ + "parameters": { + "expressRoutePortName": "expressRoutePortName", + "resourceGroupName": "rg1", + "api-version": "2020-07-01", + "subscriptionId": "subid", + "authorizationName": "authorizationName" + }, + "responses": { + "200": {}, + "202": {}, + "204": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationGet.json new file mode 100644 index 000000000000..7eff28231fc3 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationGet.json @@ -0,0 +1,25 @@ +{ + "parameters": { + "expressRoutePortName": "expressRoutePortName", + "resourceGroupName": "rg1", + "api-version": "2020-07-01", + "subscriptionId": "subid", + "authorizationName": "authorizationName" + }, + "responses": { + "200": { + "body": { + "name": "authorizationName", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName", + "etag": "W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\"", + "properties": { + "provisioningState": "Succeeded", + "authorizationKey": "authKey", + "authorizationUseStatus": "Available", + "circuit": "" + }, + "type": "Microsoft.Network/expressRoutePorts/authorizations" + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationList.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationList.json new file mode 100644 index 000000000000..396c45a52c3e --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/examples/ExpressRoutePortAuthorizationList.json @@ -0,0 +1,28 @@ +{ + "parameters": { + "expressRoutePortName": "expressRoutePortName", + "resourceGroupName": "rg1", + "api-version": "2020-07-01", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "authorizationName", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/ExpressRoutePorts/expressRoutePortName/authorizations/authorizationName", + "etag": "W/\"e33c875f-48df-4a91-b7d3-eb95b5ddbb89\"", + "properties": { + "provisioningState": "Succeeded", + "authorizationKey": "authKey", + "authorizationUseStatus": "Available", + "circuit": "" + }, + "type": "Microsoft.Network/expressRoutePorts/authorizations" + } + ] + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRouteCircuit.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRouteCircuit.json index 506133276e79..9bcf12506078 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRouteCircuit.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRouteCircuit.json @@ -2239,6 +2239,10 @@ "globalReachEnabled": { "type": "boolean", "description": "Flag denoting global reach status." + }, + "authorizationKey": { + "type": "string", + "description": "The authorizationKey." } }, "description": "Properties of ExpressRouteCircuit." diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRoutePort.json b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRoutePort.json index 79b7772f7b78..49014dccbf5e 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRoutePort.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/expressRoutePort.json @@ -601,6 +601,252 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}": { + "delete": { + "tags": [ + "ExpressRoutePortAuthorizations" + ], + "operationId": "ExpressRoutePortAuthorizations_Delete", + "description": "Deletes the specified authorization from the specified express route port.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "expressRoutePortName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the express route port." + }, + { + "name": "authorizationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the authorization." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Delete successful." + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "204": { + "description": "Request successful. Resource does not exist." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-examples": { + "Delete ExpressRoutePort Authorization": { + "$ref": "./examples/ExpressRoutePortAuthorizationDelete.json" + } + } + }, + "get": { + "tags": [ + "ExpressRoutePortAuthorizations" + ], + "operationId": "ExpressRoutePortAuthorizations_Get", + "description": "Gets the specified authorization from the specified express route port.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "expressRoutePortName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the express route port." + }, + { + "name": "authorizationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the authorization." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The operation returns the ExpressRoutePortAuthorization resource.", + "schema": { + "$ref": "#/definitions/ExpressRoutePortAuthorization" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-examples": { + "Get ExpressRoutePort Authorization": { + "$ref": "./examples/ExpressRoutePortAuthorizationGet.json" + } + } + }, + "put": { + "tags": [ + "ExpressRoutePortAuthorizations" + ], + "operationId": "ExpressRoutePortAuthorizations_CreateOrUpdate", + "description": "Creates or updates an authorization in the specified express route port.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "expressRoutePortName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the express route port." + }, + { + "name": "authorizationName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the authorization." + }, + { + "name": "authorizationParameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ExpressRoutePortAuthorization" + }, + "description": "Parameters supplied to the create or update express route port authorization operation." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "201": { + "description": "Create successful. The operation returns the resulting ExpressRoutePortAuthorization resource.", + "schema": { + "$ref": "#/definitions/ExpressRoutePortAuthorization" + } + }, + "200": { + "description": "Update successful. The operation returns the resulting ExpressRoutePortAuthorization resource.", + "schema": { + "$ref": "#/definitions/ExpressRoutePortAuthorization" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-examples": { + "Create ExpressRoutePort Authorization": { + "$ref": "./examples/ExpressRoutePortAuthorizationCreate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations": { + "get": { + "tags": [ + "ExpressRoutePortAuthorizations" + ], + "operationId": "ExpressRoutePortAuthorizations_List", + "description": "Gets all authorizations in an express route port.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "expressRoutePortName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the express route port." + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Request successful. The operation returns a list of ExpressRoutePortAuthorization resources.", + "schema": { + "$ref": "#/definitions/ExpressRoutePortAuthorizationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List ExpressRoutePort Authorization": { + "$ref": "./examples/ExpressRoutePortAuthorizationList.json" + } + } + } } }, "definitions": { @@ -958,6 +1204,87 @@ "description": "The content as a base64 encoded string." } } + }, + "ExpressRoutePortAuthorizationPropertiesFormat": { + "title": "ExpressRoute Port Authorization Properties", + "description": "Properties of ExpressRoutePort Authorization.", + "properties": { + "authorizationKey": { + "readOnly": true, + "type": "string", + "description": "The authorization key." + }, + "authorizationUseStatus": { + "readOnly": true, + "type": "string", + "description": "The authorization use status.", + "enum": [ + "Available", + "InUse" + ], + "x-ms-enum": { + "name": "ExpressRoutePortAuthorizationUseStatus", + "modelAsString": true + } + }, + "circuit": { + "readOnly": true, + "$ref": "./network.json#/definitions/SubResource", + "description": "The reference to the ExpressRoute circuit resource using the authorization." + }, + "provisioningState": { + "readOnly": true, + "$ref": "./network.json#/definitions/ProvisioningState", + "description": "The provisioning state of the authorization resource." + } + } + }, + "ExpressRoutePortAuthorization": { + "title": "ExpressRoute Port Authorization", + "description": "ExpressRoutePort Authorization resource definition.", + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/ExpressRoutePortAuthorizationPropertiesFormat", + "description": "ExpressRoutePort properties." + }, + "name": { + "type": "string", + "description": "The name of the resource that is unique within a resource group. This name can be used to access the resource." + }, + "etag": { + "readOnly": true, + "type": "string", + "description": "A unique read-only string that changes whenever the resource is updated." + }, + "type": { + "readOnly": true, + "type": "string", + "description": "Type of the resource." + } + }, + "allOf": [ + { + "$ref": "./network.json#/definitions/SubResource" + } + ] + }, + "ExpressRoutePortAuthorizationListResult": { + "title": "ExpressRoute Port Authorization List Result", + "description": "Response for ListExpressRoutePortAuthorizations API service call.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ExpressRoutePortAuthorization" + }, + "description": "The authorizations in an ExpressRoute Port." + }, + "nextLink": { + "type": "string", + "description": "The URL to get the next set of results." + } + } } } }