From a5b0c55d45dee42997831bfd8cab97c39aacf5e1 Mon Sep 17 00:00:00 2001 From: Ankur Date: Mon, 25 Nov 2019 11:31:47 -0800 Subject: [PATCH 01/18] Adding swagger specs for bsl and session management apis for AzureBastion --- .../stable/2019-09-01/bastionHost.json | 422 ++++++++++++++++-- .../examples/BastionShareableLinkCreate.json | 45 ++ .../examples/BastionShareableLinkDelete.json | 26 ++ .../examples/BastionShareableLinkGet.json | 44 ++ 4 files changed, 502 insertions(+), 35 deletions(-) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index c41f80769e1a..4f6874fbfee9 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -43,18 +43,10 @@ "description": "Deletes the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -98,18 +90,10 @@ "description": "Gets the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -146,18 +130,10 @@ "description": "Creates or updates the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "name": "parameters", @@ -254,11 +230,7 @@ "description": "Lists all Bastion Hosts in a resource group.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -290,6 +262,209 @@ "nextLinkName": "nextLink" } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createbsl": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "PutBastionShareableLink", + "description": "Creates a Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed.", + "schema": { + "$ref": "#/definitions/BastionShareableLinkListResult" + } + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "400": { + "description": "Bad request. Check the message for details." + }, + "404": { + "description": "No access to the bastion or one of the requested virtual machines." + } + }, + "x-ms-examples": { + "Create Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkCreate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deletebsl": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "DeleteBastionShareableLink", + "description": "Deletes the Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed." + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "400": { + "description": "Bad request. Check the message for details." + }, + "404": { + "description": "No access to the bastion or one of the requested virtual machines." + } + }, + "x-ms-examples": { + "Delete Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkDelete.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getbsl": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "GetBastionShareableLink", + "description": "Return the Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation deleted the BastionShareableLinks associated with the VMs, if they existed." + }, + "400": { + "description": "Bad request. Check the message for details." + }, + "404": { + "description": "No access to the bastion or one of the requested virtual machines." + } + }, + "x-ms-examples": { + "Returns the Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkGet.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getactivesessions": { + "post": { + "tags": [ + "BastionHosts" + ], + "operationId": "GetActiveSessions", + "description": "Returns the list of currently active sessions on the Bastion.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of active sessions on the Bastion.", + "schema": { + "$ref": "#/definitions/BastionActiveSessionListResult" + } + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectactivesessions": { + "post": { + "tags": [ + "BastionHosts" + ], + "operationId": "DisconnectActiveSessions", + "description": "Returns the list of currently active sessions on the Bastion.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "./network.json#/parameters/SessionIdsParameters" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of active sessions on the Bastion." + } + } + } } }, "definitions": { @@ -404,6 +579,183 @@ } }, "description": "Response for ListBastionHosts API service call." + }, + "BastionShareableLink": { + "properties": { + "vm": { + "$ref": "#/definitions/VM", + "description": "Reference of the virtual machine resource." + }, + "bsl": { + "type": "string", + "readOnly": true, + "description": "The unique Bastion Shareable Link to the virtual machine." + }, + "createdAt": { + "type": "string", + "readOnly": true, + "description": "The time when the link was created." + }, + "message": { + "type": "string", + "readOnly": true, + "description": "Optional field indicating the warning or error message related to the vm in case of partial failure" + } + }, + "required": [ + "vm" + ], + "description": "Bastion Shareable Link." + }, + "BastionShareableLinkListRequest": { + "properties": { + "vms": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionShareableLink" + }, + "description": "List of VM references." + } + }, + "description": "Post request for all the Bastion Shareable Link endpoints." + }, + "BastionShareableLinkListResult": { + "properties": { + "bsls": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionShareableLink" + }, + "description": "List of Bastion Shareable Links for the request." + } + }, + "description": "Response for all the Bastion Shareable Link endpoints." + }, + "BastionActiveSession": { + "properties": { + "sessionId": { + "type": "string", + "readOnly": true, + "description": "A unique id for the session." + }, + "startTime": { + "type": "object", + "readOnly": true, + "description": "The time when the session started." + }, + "targetSubscriptionId": { + "type": "string", + "readOnly": true, + "description": "The unique Bastion Shareable Link to the virtual machine." + }, + "resourceType": { + "type": "string", + "readOnly": true, + "description": "The type of the resource." + }, + "targetHostName": { + "type": "string", + "readOnly": true, + "description": "The host name of the target." + }, + "targetResourceGroup": { + "type": "string", + "readOnly": true, + "description": "The resource group of the target." + }, + "userName": { + "type": "string", + "readOnly": true, + "description": "The user name who is active on this session." + }, + "targetIpAddress": { + "type": "string", + "readOnly": true, + "description": "The IP Address of the target." + }, + "protocol": { + "type": "string", + "readOnly": true, + "description": "The protocol used to connect to the target." + }, + "targetResourceId": { + "type": "string", + "readOnly": true, + "description": "The resource id of the target." + }, + "sessionDurationInMins": { + "type": "number", + "readOnly": true, + "description": "Duration in mins the session has been active." + } + }, + "description": "The session detail for a target." + }, + "BastionActiveSessionListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionActiveSession" + }, + "description": "List of active sessions on the bastion." + } + }, + "description": "Response for GetActiveSessions." + }, + "VM": { + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "Describes a Virtual Machine." + }, + "SessionIds": { + "properties": { + "sessionIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of session ids" + } + }, + "description": "List of session ids." + } + }, + "parameters":{ + "ResourceGroupName": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + "BastionShareableLinkRequest": { + "name": "bslRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BastionShareableLinkListRequest" + }, + "description": "Post request for all the Bastion Shareable Link endpoints." + }, + "BastionHostName": { + "name": "bastionHostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Bastion Host." + }, + "SessionIdsParameters": { + "name": "sessionIds", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SessionIds" + }, + "description": "The list of sessionids to disconnect." } } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json new file mode 100644 index 000000000000..895005deb9c2 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2019-08-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "body": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": { + "body": { + "bsls": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1", + "createdAt": "2019-10-18T12:00:00.0000Z" + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2", + "createdAt": "2019-10-17T12:00:00.0000Z" + } + ] + } + }, + "202": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json new file mode 100644 index 000000000000..46d0fea4bb77 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2019-08-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "body": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": {}, + "202": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json new file mode 100644 index 000000000000..1555f2e5d4b3 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2019-08-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "body": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": { + "body": { + "bsls": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1", + "createdAt": "2019-10-18T12:00:00.0000Z" + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2", + "createdAt": "2019-10-17T12:00:00.0000Z" + } + ] + } + } + } +} From 58d80433d1688a6ebac3cde1e98857a38834a0ae Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 3 Dec 2019 10:56:20 -0800 Subject: [PATCH 02/18] Update bastionHost.json fixing desc --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 4f6874fbfee9..03c98f778de2 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -339,7 +339,7 @@ ], "responses": { "200": { - "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed." + "description": "Success. The operation deleted the BastionShareableLinks associated with the VMs, if they existed. No return body." }, "202": { "description": "Accepted and the operation will complete asynchronously." @@ -385,7 +385,10 @@ ], "responses": { "200": { - "description": "Success. The operation deleted the BastionShareableLinks associated with the VMs, if they existed." + "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed.", + "schema": { + "$ref": "#/definitions/BastionShareableLinkListResult" + } }, "400": { "description": "Bad request. Check the message for details." From 91c6e6cb8a0e82d7d6b276d7e7c173c74f03a2d2 Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 4 Dec 2019 09:57:46 -0800 Subject: [PATCH 03/18] Added example for session management apis --- .../stable/2019-09-01/bastionHost.json | 47 ++++++++++++++++++- .../examples/BastionSessionDelete.json | 36 ++++++++++++++ .../examples/BastionSessionsList.json | 27 +++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 03c98f778de2..bb2dec60fdf4 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -435,6 +435,11 @@ "202": { "description": "Accepted and the operation will complete asynchronously." } + }, + "x-ms-examples": { + "Returns a list of currently active sessions on the Bastion": { + "$ref": "./examples/BastionSessionsList.json" + } } } }, @@ -464,7 +469,15 @@ ], "responses": { "200": { - "description": "Success. The operation returns a list of active sessions on the Bastion." + "description": "Success. The operation returns a list of sessions with the state of deleted/failed/not found.", + "schema": { + "$ref": "#/definitions/BastionSessionDeleteResult" + } + } + }, + "x-ms-examples": { + "Deletes the specified active session": { + "$ref": "./examples/BastionSessionsDelete.json" } } } @@ -706,6 +719,38 @@ }, "description": "Response for GetActiveSessions." }, + "BastionSessionState": { + "properties": { + "sessionId": { + "type": "string", + "readOnly": true, + "description": "A unique id for the session." + }, + "message": { + "type": "string", + "readOnly": true, + "description": "Used for extra information." + }, + "state": { + "type": "string", + "readOnly": true, + "description": "The state of the session. Disconnected/Failed/NotFound." + } + }, + "description": "The session state detail for a target." + }, + "BastionSessionDeleteResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionSessionState" + }, + "description": "List of sessions with their corresponding state." + } + }, + "description": "Response for DisconnectActiveSessions." + }, "VM": { "allOf": [ { diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json new file mode 100644 index 000000000000..cfa6863b4cdc --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2019-08-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "body": { + "SessionIds": [ + "session1", + "session2", + "session3" + ] + } + }, + "responses": { + "200": { + "body": [ + { + "sessionId": "session1", + "message": "session session1 invalidated!", + "state": "Disconnected" + }, + { + "sessionId": "session2", + "message": "session session2 could not be disconnected!", + "state": "Failed" + }, + { + "sessionId": "session3", + "message": "session session3 not found!", + "state": "NotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json new file mode 100644 index 000000000000..3ea6cd1b39a3 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -0,0 +1,27 @@ +{ + "parameters": { + "api-version": "2019-08-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant" + }, + "responses": { + "200": { + "body": [ + { + "sessionId": "sessionId", + "startTime": "2019-1-1T12:00:00.0000Z", + "targetSubscriptionId": "subid", + "resourceType": "VM", + "targetHostName": "vm01", + "targetResourceGroup": "rg1", + "userName": "user", + "targetIPAddress": "1.1.1.1", + "protocol": "ssh", + "targetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01", + "sessionDurationInMins": 0.0 + } + ] + } + } +} \ No newline at end of file From de239f954bacef28674e7a12b7a79e429286148e Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 12 Dec 2019 15:00:22 -0800 Subject: [PATCH 04/18] Update bastionHost.json --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index bb2dec60fdf4..876e2e3ee22e 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -477,7 +477,7 @@ }, "x-ms-examples": { "Deletes the specified active session": { - "$ref": "./examples/BastionSessionsDelete.json" + "$ref": "./examples/BastionSessionDelete.json" } } } From f053a125197c6257d88b5f13218a984de4c80ec5 Mon Sep 17 00:00:00 2001 From: Ankur Date: Mon, 16 Dec 2019 10:55:27 -0800 Subject: [PATCH 05/18] Adding parameter location --- .../stable/2019-09-01/bastionHost.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 876e2e3ee22e..3a0aa317c541 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -778,7 +778,8 @@ "in": "path", "required": true, "type": "string", - "description": "The name of the resource group." + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" }, "BastionShareableLinkRequest": { "name": "bslRequest", @@ -787,14 +788,16 @@ "schema": { "$ref": "#/definitions/BastionShareableLinkListRequest" }, - "description": "Post request for all the Bastion Shareable Link endpoints." + "description": "Post request for all the Bastion Shareable Link endpoints.", + "x-ms-parameter-location": "method" }, "BastionHostName": { "name": "bastionHostName", "in": "path", "required": true, "type": "string", - "description": "The name of the Bastion Host." + "description": "The name of the Bastion Host.", + "x-ms-parameter-location": "method" }, "SessionIdsParameters": { "name": "sessionIds", @@ -803,7 +806,8 @@ "schema": { "$ref": "#/definitions/SessionIds" }, - "description": "The list of sessionids to disconnect." + "description": "The list of sessionids to disconnect.", + "x-ms-parameter-location": "method" } } } From 1948ac2a22b99853b6fd80b131ce952f43b8a995 Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 17 Dec 2019 10:31:14 -0800 Subject: [PATCH 06/18] Fixing build issue --- custom-words.txt | 9 ++++++++- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/custom-words.txt b/custom-words.txt index 902a5f75105f..56fc3008889d 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -1667,4 +1667,11 @@ Zoho zset MSAZRUSGO hypervcollectors -vmwarecollectors \ No newline at end of file +vmwarecollectors +createbsl +deletebsl +getbsl +getactivesessions +disconnectactivesessions +bsls +sessionids \ No newline at end of file diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 3a0aa317c541..1e8db7cfb722 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -464,7 +464,7 @@ "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "./network.json#/parameters/SessionIdsParameters" + "$ref": "./parameters/SessionIdsParameters" } ], "responses": { From 76473830b98bff4e2855a26e32b68d92ca0af42b Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 18 Dec 2019 10:45:03 -0800 Subject: [PATCH 07/18] Fixing issues --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 2 +- .../stable/2019-09-01/examples/BastionSessionDelete.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 1e8db7cfb722..83d6d77ad96d 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -464,7 +464,7 @@ "$ref": "./network.json#/parameters/SubscriptionIdParameter" }, { - "$ref": "./parameters/SessionIdsParameters" + "$ref": "#/parameters/SessionIdsParameters" } ], "responses": { diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json index cfa6863b4cdc..618f7e076d5d 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -33,4 +33,4 @@ ] } } -} \ No newline at end of file +} From 3324f0ba511dbb893ba2cdd369ee634bd66b7f7c Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 18 Dec 2019 13:18:07 -0800 Subject: [PATCH 08/18] Fixing style and model issues --- .../stable/2019-09-01/bastionHost.json | 2 +- .../2019-09-01/examples/BastionSessionDelete.json | 12 +++++------- .../2019-09-01/examples/BastionSessionsList.json | 5 +++-- .../examples/BastionShareableLinkCreate.json | 6 ++++-- .../examples/BastionShareableLinkDelete.json | 6 ++++-- .../2019-09-01/examples/BastionShareableLinkGet.json | 6 ++++-- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 83d6d77ad96d..6be72dd2537b 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -772,7 +772,7 @@ "description": "List of session ids." } }, - "parameters":{ + "parameters": { "ResourceGroupName": { "name": "resourceGroupName", "in": "path", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json index 618f7e076d5d..21568bb5306b 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -4,13 +4,11 @@ "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", - "body": { - "SessionIds": [ - "session1", - "session2", - "session3" - ] - } + "sessionIds": [ + "session1", + "session2", + "session3" + ] }, "responses": { "200": { diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json index 3ea6cd1b39a3..54bb040b1843 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -22,6 +22,7 @@ "sessionDurationInMins": 0.0 } ] - } + }, + "202" : {} } -} \ No newline at end of file +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json index 895005deb9c2..470482e56189 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json @@ -4,7 +4,7 @@ "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", - "body": { + "bslRequest": { "vms": [ { "vm": { @@ -40,6 +40,8 @@ ] } }, - "202": {} + "202": {}, + "400": {}, + "404": {} } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json index 46d0fea4bb77..ce6c1c9c5fca 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json @@ -4,7 +4,7 @@ "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", - "body": { + "bslRequest": { "vms": [ { "vm": { @@ -21,6 +21,8 @@ }, "responses": { "200": {}, - "202": {} + "202": {}, + "400": {}, + "404": {} } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json index 1555f2e5d4b3..1f3235218aa7 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json @@ -4,7 +4,7 @@ "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", - "body": { + "bslRequest": { "vms": [ { "vm": { @@ -39,6 +39,8 @@ } ] } - } + }, + "400": {}, + "404": {} } } From dbd46cc70e2d5c5194d56d3177bd816091ad50f0 Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 18 Dec 2019 13:28:11 -0800 Subject: [PATCH 09/18] fixing style --- .../stable/2019-09-01/examples/BastionSessionsList.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json index 54bb040b1843..4c65280ef7d3 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -23,6 +23,6 @@ } ] }, - "202" : {} + "202": {} } } From cbf7df76488054bc7981085fd998a2fd974f91af Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 2 Jan 2020 14:19:14 -0800 Subject: [PATCH 10/18] Update bastionHost.json Adding default to the responses --- .../stable/2019-09-01/bastionHost.json | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 6be72dd2537b..86ef901651f3 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -303,6 +303,12 @@ }, "404": { "description": "No access to the bastion or one of the requested virtual machines." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } } }, "x-ms-examples": { @@ -349,6 +355,12 @@ }, "404": { "description": "No access to the bastion or one of the requested virtual machines." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } } }, "x-ms-examples": { @@ -395,6 +407,12 @@ }, "404": { "description": "No access to the bastion or one of the requested virtual machines." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } } }, "x-ms-examples": { @@ -434,6 +452,12 @@ }, "202": { "description": "Accepted and the operation will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } } }, "x-ms-examples": { @@ -472,8 +496,14 @@ "description": "Success. The operation returns a list of sessions with the state of deleted/failed/not found.", "schema": { "$ref": "#/definitions/BastionSessionDeleteResult" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" } } + } }, "x-ms-examples": { "Deletes the specified active session": { From f5e5ddf4ea68c47390262a52e3c7fba0c60a1cee Mon Sep 17 00:00:00 2001 From: Ankur Date: Fri, 3 Jan 2020 09:21:12 -0800 Subject: [PATCH 11/18] Update bastionHost.json Fixing typo --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 86ef901651f3..85bebb0aeb2b 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -496,14 +496,14 @@ "description": "Success. The operation returns a list of sessions with the state of deleted/failed/not found.", "schema": { "$ref": "#/definitions/BastionSessionDeleteResult" - }, + } + }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./network.json#/definitions/CloudError" } } - } }, "x-ms-examples": { "Deletes the specified active session": { From 4aac00cc51ff686665e4b18a4958b905666ef67a Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 8 Jan 2020 12:09:20 -0800 Subject: [PATCH 12/18] Update bastionHost.json Incorporated a few comments --- .../stable/2019-09-01/bastionHost.json | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 85bebb0aeb2b..89f428ad3701 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -298,12 +298,6 @@ "202": { "description": "Accepted and the operation will complete asynchronously." }, - "400": { - "description": "Bad request. Check the message for details." - }, - "404": { - "description": "No access to the bastion or one of the requested virtual machines." - }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -311,6 +305,10 @@ } } }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, "x-ms-examples": { "Create Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkCreate.json" @@ -350,12 +348,6 @@ "202": { "description": "Accepted and the operation will complete asynchronously." }, - "400": { - "description": "Bad request. Check the message for details." - }, - "404": { - "description": "No access to the bastion or one of the requested virtual machines." - }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -363,6 +355,10 @@ } } }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, "x-ms-examples": { "Delete Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkDelete.json" @@ -402,12 +398,6 @@ "$ref": "#/definitions/BastionShareableLinkListResult" } }, - "400": { - "description": "Bad request. Check the message for details." - }, - "404": { - "description": "No access to the bastion or one of the requested virtual machines." - }, "default": { "description": "Error response describing why the operation failed.", "schema": { @@ -460,6 +450,10 @@ } } }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, "x-ms-examples": { "Returns a list of currently active sessions on the Bastion": { "$ref": "./examples/BastionSessionsList.json" @@ -692,7 +686,7 @@ "targetSubscriptionId": { "type": "string", "readOnly": true, - "description": "The unique Bastion Shareable Link to the virtual machine." + "description": "The subscription id for the target virtual machine." }, "resourceType": { "type": "string", From 2b1cbe4708ea367dafd034b76c52f1852a9d49a7 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 16 Jan 2020 09:06:19 -0800 Subject: [PATCH 13/18] Updating as per comments --- .../stable/2019-09-01/bastionHost.json | 49 ++++++++++++++++--- .../examples/BastionSessionDelete.json | 36 +++++++------- .../examples/BastionSessionsList.json | 32 ++++++------ .../examples/BastionShareableLinkCreate.json | 6 +-- .../examples/BastionShareableLinkDelete.json | 4 +- .../examples/BastionShareableLinkGet.json | 6 +-- 6 files changed, 83 insertions(+), 50 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 89f428ad3701..14fdefe057eb 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -263,7 +263,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createbsl": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks": { "post": { "tags": [ "BastionHosts", @@ -309,6 +309,9 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, "x-ms-examples": { "Create Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkCreate.json" @@ -316,7 +319,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deletebsl": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks": { "post": { "tags": [ "BastionHosts", @@ -359,6 +362,9 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, "x-ms-examples": { "Delete Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkDelete.json" @@ -366,7 +372,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getbsl": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks": { "post": { "tags": [ "BastionHosts", @@ -405,6 +411,9 @@ } } }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, "x-ms-examples": { "Returns the Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkGet.json" @@ -412,7 +421,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getactivesessions": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions": { "post": { "tags": [ "BastionHosts" @@ -454,6 +463,9 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, "x-ms-examples": { "Returns a list of currently active sessions on the Bastion": { "$ref": "./examples/BastionSessionsList.json" @@ -461,7 +473,7 @@ } } }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectactivesessions": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions": { "post": { "tags": [ "BastionHosts" @@ -499,6 +511,9 @@ } } }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, "x-ms-examples": { "Deletes the specified active session": { "$ref": "./examples/BastionSessionDelete.json" @@ -661,7 +676,7 @@ }, "BastionShareableLinkListResult": { "properties": { - "bsls": { + "value": { "type": "array", "items": { "$ref": "#/definitions/BastionShareableLink" @@ -669,6 +684,10 @@ "description": "List of Bastion Shareable Links for the request." } }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + }, "description": "Response for all the Bastion Shareable Link endpoints." }, "BastionActiveSession": { @@ -716,7 +735,15 @@ "protocol": { "type": "string", "readOnly": true, - "description": "The protocol used to connect to the target." + "description": "The protocol used to connect to the target.", + "enum": [ + "SSH", + "RDP" + ], + "x-ms-enum": { + "name": "Protocol", + "modelAsString": true + } }, "targetResourceId": { "type": "string", @@ -741,6 +768,10 @@ "description": "List of active sessions on the bastion." } }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + }, "description": "Response for GetActiveSessions." }, "BastionSessionState": { @@ -773,6 +804,10 @@ "description": "List of sessions with their corresponding state." } }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + }, "description": "Response for DisconnectActiveSessions." }, "VM": { diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json index 21568bb5306b..1eba422895f6 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -12,23 +12,25 @@ }, "responses": { "200": { - "body": [ - { - "sessionId": "session1", - "message": "session session1 invalidated!", - "state": "Disconnected" - }, - { - "sessionId": "session2", - "message": "session session2 could not be disconnected!", - "state": "Failed" - }, - { - "sessionId": "session3", - "message": "session session3 not found!", - "state": "NotFound" - } - ] + "body": { + "value" : [ + { + "sessionId": "session1", + "message": "session session1 invalidated!", + "state": "Disconnected" + }, + { + "sessionId": "session2", + "message": "session session2 could not be disconnected!", + "state": "Failed" + }, + { + "sessionId": "session3", + "message": "session session3 not found!", + "state": "NotFound" + } + ] + } } } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json index 4c65280ef7d3..39471a6357b4 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -7,21 +7,23 @@ }, "responses": { "200": { - "body": [ - { - "sessionId": "sessionId", - "startTime": "2019-1-1T12:00:00.0000Z", - "targetSubscriptionId": "subid", - "resourceType": "VM", - "targetHostName": "vm01", - "targetResourceGroup": "rg1", - "userName": "user", - "targetIPAddress": "1.1.1.1", - "protocol": "ssh", - "targetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01", - "sessionDurationInMins": 0.0 - } - ] + "body": { + "value" : [ + { + "sessionId": "sessionId", + "startTime": "2019-1-1T12:00:00.0000Z", + "targetSubscriptionId": "subid", + "resourceType": "VM", + "targetHostName": "vm01", + "targetResourceGroup": "rg1", + "userName": "user", + "targetIPAddress": "1.1.1.1", + "protocol": "SSH", + "targetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01", + "sessionDurationInMins": 0.0 + } + ] + } }, "202": {} } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json index 470482e56189..a5fa3e1949f5 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json @@ -22,7 +22,7 @@ "responses": { "200": { "body": { - "bsls": [ + "value": [ { "vm": { "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" @@ -40,8 +40,6 @@ ] } }, - "202": {}, - "400": {}, - "404": {} + "202": {} } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json index ce6c1c9c5fca..a201ae990afa 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json @@ -21,8 +21,6 @@ }, "responses": { "200": {}, - "202": {}, - "400": {}, - "404": {} + "202": {} } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json index 1f3235218aa7..bd1b30b10714 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json @@ -22,7 +22,7 @@ "responses": { "200": { "body": { - "bsls": [ + "value": [ { "vm": { "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" @@ -39,8 +39,6 @@ } ] } - }, - "400": {}, - "404": {} + } } } From 0291393bff468651a5effd74f6232c4ef9f47b87 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 16 Jan 2020 09:51:45 -0800 Subject: [PATCH 14/18] Fixing build --- .../stable/2019-09-01/bastionHost.json | 16 ++++++++-------- .../examples/BastionSessionDelete.json | 2 +- .../2019-09-01/examples/BastionSessionsList.json | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 14fdefe057eb..ed72f5d5f3d1 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -682,12 +682,12 @@ "$ref": "#/definitions/BastionShareableLink" }, "description": "List of Bastion Shareable Links for the request." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." } }, - "nextLink": { - "type": "string", - "description": "Gets or sets the URL to get the next set of results." - }, "description": "Response for all the Bastion Shareable Link endpoints." }, "BastionActiveSession": { @@ -766,12 +766,12 @@ "$ref": "#/definitions/BastionActiveSession" }, "description": "List of active sessions on the bastion." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." } }, - "nextLink": { - "type": "string", - "description": "Gets or sets the URL to get the next set of results." - }, "description": "Response for GetActiveSessions." }, "BastionSessionState": { diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json index 1eba422895f6..380af70da8df 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -13,7 +13,7 @@ "responses": { "200": { "body": { - "value" : [ + "value": [ { "sessionId": "session1", "message": "session session1 invalidated!", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json index 39471a6357b4..533d57e7d0ea 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -8,7 +8,7 @@ "responses": { "200": { "body": { - "value" : [ + "value": [ { "sessionId": "sessionId", "startTime": "2019-1-1T12:00:00.0000Z", @@ -17,7 +17,7 @@ "targetHostName": "vm01", "targetResourceGroup": "rg1", "userName": "user", - "targetIPAddress": "1.1.1.1", + "targetIpAddress": "1.1.1.1", "protocol": "SSH", "targetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01", "sessionDurationInMins": 0.0 From 83681e649a3e3686fc64e56af9d95bd33ad6b396 Mon Sep 17 00:00:00 2001 From: Ankur Date: Thu, 16 Jan 2020 10:13:22 -0800 Subject: [PATCH 15/18] Missed updating at one place --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index ed72f5d5f3d1..6d445411a0e9 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -802,12 +802,12 @@ "$ref": "#/definitions/BastionSessionState" }, "description": "List of sessions with their corresponding state." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." } }, - "nextLink": { - "type": "string", - "description": "Gets or sets the URL to get the next set of results." - }, "description": "Response for DisconnectActiveSessions." }, "VM": { From 3f1c8c377f800b880ac2420605265f181f967bb4 Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 21 Jan 2020 14:15:23 -0800 Subject: [PATCH 16/18] Adding in the newer one too --- .../examples/BastionSessionDelete.json | 2 +- .../examples/BastionSessionsList.json | 2 +- .../examples/BastionShareableLinkCreate.json | 2 +- .../examples/BastionShareableLinkDelete.json | 2 +- .../examples/BastionShareableLinkGet.json | 2 +- .../stable/2019-11-01/bastionHost.json | 537 ++++++++++++++++-- .../examples/BastionSessionDelete.json | 36 ++ .../examples/BastionSessionsList.json | 30 + .../examples/BastionShareableLinkCreate.json | 45 ++ .../examples/BastionShareableLinkDelete.json | 26 + .../examples/BastionShareableLinkGet.json | 44 ++ 11 files changed, 686 insertions(+), 42 deletions(-) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionDelete.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionsList.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkCreate.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkDelete.json create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkGet.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json index 380af70da8df..132d271b1f94 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionDelete.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-08-01", + "api-version": "2019-09-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json index 533d57e7d0ea..03a88dc9d4c7 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionSessionsList.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-08-01", + "api-version": "2019-09-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant" diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json index a5fa3e1949f5..b60e6ea80fd3 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkCreate.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-08-01", + "api-version": "2019-09-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json index a201ae990afa..bb9f56a22fda 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkDelete.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-08-01", + "api-version": "2019-09-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json index bd1b30b10714..f2b144a92d5b 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/examples/BastionShareableLinkGet.json @@ -1,6 +1,6 @@ { "parameters": { - "api-version": "2019-08-01", + "api-version": "2019-09-01", "subscriptionId": "subid", "resourceGroupName": "rg1", "bastionHostName": "bastionhosttenant", diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json index 879e776a3b0c..103d6782d28f 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json @@ -43,18 +43,10 @@ "description": "Deletes the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -98,18 +90,10 @@ "description": "Gets the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -146,18 +130,10 @@ "description": "Creates or updates the specified Bastion Host.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { - "name": "bastionHostName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the Bastion Host." + "$ref": "#/parameters/BastionHostName" }, { "name": "parameters", @@ -254,11 +230,7 @@ "description": "Lists all Bastion Hosts in a resource group.", "parameters": [ { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." + "$ref": "#/parameters/ResourceGroupName" }, { "$ref": "./network.json#/parameters/ApiVersionParameter" @@ -290,6 +262,264 @@ "nextLinkName": "nextLink" } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "PutBastionShareableLink", + "description": "Creates a Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed.", + "schema": { + "$ref": "#/definitions/BastionShareableLinkListResult" + } + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "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-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Create Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkCreate.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "DeleteBastionShareableLink", + "description": "Deletes the Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation deleted the BastionShareableLinks associated with the VMs, if they existed. No return body." + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "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-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Delete Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkDelete.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks": { + "post": { + "tags": [ + "BastionHosts", + "BastionShareableLink" + ], + "operationId": "GetBastionShareableLink", + "description": "Return the Bastion Shareable Links for all the VMs specified in the request.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/BastionShareableLinkRequest" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of shareable links for the specified VMs, giving appropriate error messages as needed.", + "schema": { + "$ref": "#/definitions/BastionShareableLinkListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Returns the Bastion Shareable Links for the request VMs": { + "$ref": "./examples/BastionShareableLinkGet.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions": { + "post": { + "tags": [ + "BastionHosts" + ], + "operationId": "GetActiveSessions", + "description": "Returns the list of currently active sessions on the Bastion.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of active sessions on the Bastion.", + "schema": { + "$ref": "#/definitions/BastionActiveSessionListResult" + } + }, + "202": { + "description": "Accepted and the operation will complete asynchronously." + }, + "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-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Returns a list of currently active sessions on the Bastion": { + "$ref": "./examples/BastionSessionsList.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions": { + "post": { + "tags": [ + "BastionHosts" + ], + "operationId": "DisconnectActiveSessions", + "description": "Returns the list of currently active sessions on the Bastion.", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupName" + }, + { + "$ref": "#/parameters/BastionHostName" + }, + { + "$ref": "./network.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "./network.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/SessionIdsParameters" + } + ], + "responses": { + "200": { + "description": "Success. The operation returns a list of sessions with the state of deleted/failed/not found.", + "schema": { + "$ref": "#/definitions/BastionSessionDeleteResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "./network.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Deletes the specified active session": { + "$ref": "./examples/BastionSessionDelete.json" + } + } + } } }, "definitions": { @@ -297,11 +527,11 @@ "properties": { "subnet": { "$ref": "./network.json#/definitions/SubResource", - "description": "Reference to the subnet resource." + "description": "Reference of the subnet resource." }, "publicIPAddress": { "$ref": "./network.json#/definitions/SubResource", - "description": "Reference to the PublicIP resource." + "description": "Reference of the PublicIP resource." }, "provisioningState": { "readOnly": true, @@ -404,6 +634,239 @@ } }, "description": "Response for ListBastionHosts API service call." + }, + "BastionShareableLink": { + "properties": { + "vm": { + "$ref": "#/definitions/VM", + "description": "Reference of the virtual machine resource." + }, + "bsl": { + "type": "string", + "readOnly": true, + "description": "The unique Bastion Shareable Link to the virtual machine." + }, + "createdAt": { + "type": "string", + "readOnly": true, + "description": "The time when the link was created." + }, + "message": { + "type": "string", + "readOnly": true, + "description": "Optional field indicating the warning or error message related to the vm in case of partial failure" + } + }, + "required": [ + "vm" + ], + "description": "Bastion Shareable Link." + }, + "BastionShareableLinkListRequest": { + "properties": { + "vms": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionShareableLink" + }, + "description": "List of VM references." + } + }, + "description": "Post request for all the Bastion Shareable Link endpoints." + }, + "BastionShareableLinkListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionShareableLink" + }, + "description": "List of Bastion Shareable Links for the request." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + } + }, + "description": "Response for all the Bastion Shareable Link endpoints." + }, + "BastionActiveSession": { + "properties": { + "sessionId": { + "type": "string", + "readOnly": true, + "description": "A unique id for the session." + }, + "startTime": { + "type": "object", + "readOnly": true, + "description": "The time when the session started." + }, + "targetSubscriptionId": { + "type": "string", + "readOnly": true, + "description": "The subscription id for the target virtual machine." + }, + "resourceType": { + "type": "string", + "readOnly": true, + "description": "The type of the resource." + }, + "targetHostName": { + "type": "string", + "readOnly": true, + "description": "The host name of the target." + }, + "targetResourceGroup": { + "type": "string", + "readOnly": true, + "description": "The resource group of the target." + }, + "userName": { + "type": "string", + "readOnly": true, + "description": "The user name who is active on this session." + }, + "targetIpAddress": { + "type": "string", + "readOnly": true, + "description": "The IP Address of the target." + }, + "protocol": { + "type": "string", + "readOnly": true, + "description": "The protocol used to connect to the target.", + "enum": [ + "SSH", + "RDP" + ], + "x-ms-enum": { + "name": "Protocol", + "modelAsString": true + } + }, + "targetResourceId": { + "type": "string", + "readOnly": true, + "description": "The resource id of the target." + }, + "sessionDurationInMins": { + "type": "number", + "readOnly": true, + "description": "Duration in mins the session has been active." + } + }, + "description": "The session detail for a target." + }, + "BastionActiveSessionListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionActiveSession" + }, + "description": "List of active sessions on the bastion." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + } + }, + "description": "Response for GetActiveSessions." + }, + "BastionSessionState": { + "properties": { + "sessionId": { + "type": "string", + "readOnly": true, + "description": "A unique id for the session." + }, + "message": { + "type": "string", + "readOnly": true, + "description": "Used for extra information." + }, + "state": { + "type": "string", + "readOnly": true, + "description": "The state of the session. Disconnected/Failed/NotFound." + } + }, + "description": "The session state detail for a target." + }, + "BastionSessionDeleteResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BastionSessionState" + }, + "description": "List of sessions with their corresponding state." + }, + "nextLink": { + "type": "string", + "description": "Gets or sets the URL to get the next set of results." + } + }, + "description": "Response for DisconnectActiveSessions." + }, + "VM": { + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "description": "Describes a Virtual Machine." + }, + "SessionIds": { + "properties": { + "sessionIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of session ids" + } + }, + "description": "List of session ids." + } + }, + "parameters": { + "ResourceGroupName": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "BastionShareableLinkRequest": { + "name": "bslRequest", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BastionShareableLinkListRequest" + }, + "description": "Post request for all the Bastion Shareable Link endpoints.", + "x-ms-parameter-location": "method" + }, + "BastionHostName": { + "name": "bastionHostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the Bastion Host.", + "x-ms-parameter-location": "method" + }, + "SessionIdsParameters": { + "name": "sessionIds", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SessionIds" + }, + "description": "The list of sessionids to disconnect.", + "x-ms-parameter-location": "method" } } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionDelete.json new file mode 100644 index 000000000000..1fb539209f40 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionDelete.json @@ -0,0 +1,36 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "sessionIds": [ + "session1", + "session2", + "session3" + ] + }, + "responses": { + "200": { + "body": { + "value": [ + { + "sessionId": "session1", + "message": "session session1 invalidated!", + "state": "Disconnected" + }, + { + "sessionId": "session2", + "message": "session session2 could not be disconnected!", + "state": "Failed" + }, + { + "sessionId": "session3", + "message": "session session3 not found!", + "state": "NotFound" + } + ] + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionsList.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionsList.json new file mode 100644 index 000000000000..3c5c527774b3 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionSessionsList.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "sessionId": "sessionId", + "startTime": "2019-1-1T12:00:00.0000Z", + "targetSubscriptionId": "subid", + "resourceType": "VM", + "targetHostName": "vm01", + "targetResourceGroup": "rg1", + "userName": "user", + "targetIpAddress": "1.1.1.1", + "protocol": "SSH", + "targetResourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm01", + "sessionDurationInMins": 0.0 + } + ] + } + }, + "202": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkCreate.json new file mode 100644 index 000000000000..f376e29cf07b --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkCreate.json @@ -0,0 +1,45 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "bslRequest": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1", + "createdAt": "2019-10-18T12:00:00.0000Z" + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2", + "createdAt": "2019-10-17T12:00:00.0000Z" + } + ] + } + }, + "202": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkDelete.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkDelete.json new file mode 100644 index 000000000000..af234ea755a7 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkDelete.json @@ -0,0 +1,26 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "bslRequest": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": {}, + "202": {} + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkGet.json new file mode 100644 index 000000000000..db5d4f75d3c8 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/examples/BastionShareableLinkGet.json @@ -0,0 +1,44 @@ +{ + "parameters": { + "api-version": "2019-11-01", + "subscriptionId": "subid", + "resourceGroupName": "rg1", + "bastionHostName": "bastionhosttenant", + "bslRequest": { + "vms": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + } + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + } + } + ] + } + }, + "responses": { + "200": { + "body": { + "value": [ + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm1", + "createdAt": "2019-10-18T12:00:00.0000Z" + }, + { + "vm": { + "id": "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" + }, + "bsl": "http://bst-bastionhostid.bastion.com/api/shareable-url/tokenvm2", + "createdAt": "2019-10-17T12:00:00.0000Z" + } + ] + } + } + } +} From 51e05bdaf7264853baee275a16f0dd905996f489 Mon Sep 17 00:00:00 2001 From: Ankur Date: Tue, 21 Jan 2020 14:48:09 -0800 Subject: [PATCH 17/18] Fixing build issue --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 3 --- .../Microsoft.Network/stable/2019-11-01/bastionHost.json | 3 --- 2 files changed, 6 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index 6d445411a0e9..eada3e2d3efe 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -362,9 +362,6 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { "Delete Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkDelete.json" diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json index 103d6782d28f..49d8dbc318eb 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json @@ -362,9 +362,6 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - }, "x-ms-examples": { "Delete Bastion Shareable Links for the request VMs": { "$ref": "./examples/BastionShareableLinkDelete.json" From 03e1262d70900970fe2e6e3c1a3b834cab377d0f Mon Sep 17 00:00:00 2001 From: Ankur Date: Wed, 22 Jan 2020 10:48:31 -0800 Subject: [PATCH 18/18] Updating name --- .../Microsoft.Network/stable/2019-09-01/bastionHost.json | 2 +- .../Microsoft.Network/stable/2019-11-01/bastionHost.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json index eada3e2d3efe..2fc9613584e8 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/bastionHost.json @@ -738,7 +738,7 @@ "RDP" ], "x-ms-enum": { - "name": "Protocol", + "name": "BastionConnectProtocol", "modelAsString": true } }, diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json index 49d8dbc318eb..75c2275dee48 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/bastionHost.json @@ -738,7 +738,7 @@ "RDP" ], "x-ms-enum": { - "name": "Protocol", + "name": "BastionConnectProtocol", "modelAsString": true } },