From 7b12627b6e13bf2ed9cc758e59e4bc702ca7d514 Mon Sep 17 00:00:00 2001 From: sakreter Date: Mon, 26 Feb 2018 14:20:50 -0800 Subject: [PATCH 1/6] Adding exec api to swagger operation --- .../2018-02-01-preview/containerInstance.json | 203 ++++++++++++++++++ .../examples/ContainerExecStart.json | 24 +++ 2 files changed, 227 insertions(+) create mode 100644 specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerExecStart.json diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json index 1255caeaab4c..6e1ec7812d99 100644 --- a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json @@ -175,6 +175,12 @@ }, "201": { "description": "Created - the container group is created.", + "headers": { + "Azure-AsyncOperation": { + "description": "Operation Status Location URI", + "type": "string" + } + }, "schema": { "$ref": "#/definitions/ContainerGroup" } @@ -206,6 +212,7 @@ { "name": "Resource", "description": "The container group resource with just the tags to be updated.", + "required": true, "in": "body", "schema": { "$ref": "#/definitions/Resource" @@ -314,6 +321,39 @@ } } }, + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/operations/{operationId}": { + "get": { + "operationId": "AsyncContainerGroupOperation_Get", + "x-ms-examples": { + "ContainerUsage": { + "$ref": "./examples/ContainerGroupUsage.json" + } + }, + "description": "Get the usage for a subscription", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/LocationParameter" + }, + { + "$ref": "#/parameters/OperationIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AsyncOperation" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs": { "get": { "operationId": "ContainerLogs_List", @@ -360,6 +400,56 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec": { + "post": { + "operationId": "StartContainer_Exec", + "x-ms-examples": { + "ContainerExecStart": { + "$ref": "./examples/ContainerExecStart.json" + } + }, + "summary": "Starts the exec command for a specific container instance.", + "description": "Starts the exec command for a specified container instance in a specified resource group and container group.", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ContainerGroupNameParameter" + }, + { + "name": "containerName", + "in": "path", + "description": "The name of the container instance.", + "required": true, + "type": "string" + }, + { + "name":"containerExecRequest", + "in":"body", + "description":"The request for the exec command.", + "required":true, + "schema":{ + "$ref":"#/definitions/ContainerExecRequest" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/ContainerExecResponse" + } + } + } + } } }, "definitions": { @@ -1030,6 +1120,73 @@ } } }, + "AsyncOperation": { + "type": "object", + "description": "Azure async operation status.", + "properties": { + "id": { + "type": "string", + "description": "Async operation id." + }, + "status": { + "type": "string", + "description": "Async operation status." + }, + "startTime": { + "type": "string", + "description": "The date time that the async operation started.", + "format": "date-time", + "readOnly": true + }, + "properties": { + "$ref": "#/definitions/AsyncOperationProperties", + "description": "this structure contains the detailed properties of the operation." + }, + "error": { + "$ref": "#/definitions/AzureResourceExtendedErrorInfo", + "description": "If the async operation fails, this structure contains the error details." + } + } + }, + "AsyncOperationProperties": { + "type": "object", + "description": "The properties of the async operation", + "properties": { + "events": { + "readOnly": true, + "description": "The events of the async operation.", + "type": "array", + "items": { + "$ref": "#/definitions/Event" + } + } + } + }, + "AzureResourceExtendedErrorInfo": { + "type": "object", + "description": "The error detail information for async operation", + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "target": { + "type": "string", + "description": "The error target." + }, + "message": { + "type": "string", + "description": "The error message." + }, + "details": { + "type": "array", + "description": "An array containing error information.", + "items": { + "$ref": "#/definitions/AzureResourceExtendedErrorInfo" + } + } + } + }, "ContainerGroupListResult": { "description": "The container group list response that contains the container group properties.", "type": "object", @@ -1057,6 +1214,44 @@ } } }, + "ContainerExecRequest": { + "description": "The start container exec request.", + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The command to be executed." + }, + "terminalSize": { + "type": "object", + "description": "The size of the terminal.", + "properties": { + "row":{ + "type": "integer", + "description": "The row size of the terminal" + }, + "column": { + "type": "interger", + "description": "The column size of the terminal" + } + } + } + } + }, + "ContainerExecResponse": { + "description": "The information for the container exec command.", + "type": "object", + "properties": { + "webSocketUri": { + "type": "string", + "description": "The uri for the exec websocket." + }, + "password": { + "type": "string", + "description": "The password to start the exec command." + } + } + }, "Resource": { "type": "object", "description": "The Resource model definition.", @@ -1131,6 +1326,14 @@ "type": "string", "description": "The name of the container group.", "x-ms-parameter-location": "method" + }, + "OperationIdParameter": { + "name": "operationId", + "in": "path", + "required": true, + "type": "string", + "description": "The operation Id.", + "x-ms-parameter-location": "method" } } } diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerExecStart.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerExecStart.json new file mode 100644 index 000000000000..f1136352bed8 --- /dev/null +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerExecStart.json @@ -0,0 +1,24 @@ +{ + "parameters": { + "subscriptionId": "subid", + "api-version": "2018-02-01-preview", + "resourceGroupName": "demo", + "containerGroupName": "demo1", + "containerName": "container1", + "containerExecRequest": { + "command": "/bin/bash", + "terminalSize": { + "row": 12, + "column": 12 + } + } + }, + "responses": { + "200": { + "body": { + "webSocketUri": "wss://web-socket-uri", + "password": "password" + } + } + } + } \ No newline at end of file From a60b503fd362577f4fab95a5e2518b553ec284e9 Mon Sep 17 00:00:00 2001 From: sakreter Date: Tue, 6 Mar 2018 16:51:20 -0800 Subject: [PATCH 2/6] fixing small syntax error --- .../preview/2018-02-01-preview/containerInstance.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json index 6e1ec7812d99..5440915f5b5b 100644 --- a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json @@ -1231,7 +1231,7 @@ "description": "The row size of the terminal" }, "column": { - "type": "interger", + "type": "integer", "description": "The column size of the terminal" } } From 1ec1e3fd40e63a08d3262affca1203988f7407ef Mon Sep 17 00:00:00 2001 From: sakreter Date: Wed, 7 Mar 2018 10:25:18 -0800 Subject: [PATCH 3/6] Updating correct examples for async operation --- .../2018-02-01-preview/containerInstance.json | 6 +++--- .../examples/ContainerGroupAsyncOperation.json | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerGroupAsyncOperation.json diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json index 5440915f5b5b..6030634622e5 100644 --- a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json @@ -325,11 +325,11 @@ "get": { "operationId": "AsyncContainerGroupOperation_Get", "x-ms-examples": { - "ContainerUsage": { - "$ref": "./examples/ContainerGroupUsage.json" + "ContainerGroupAsyncOperation": { + "$ref": "./examples/ContainerGroupAsyncOperation.json" } }, - "description": "Get the usage for a subscription", + "description": "Get the container group async operation status.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerGroupAsyncOperation.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerGroupAsyncOperation.json new file mode 100644 index 000000000000..29475e5348c5 --- /dev/null +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/examples/ContainerGroupAsyncOperation.json @@ -0,0 +1,17 @@ +{ + "parameters": { + "subscriptionId": "subid", + "location": "westcentralus", + "operationId": "operationId", + "api-version": "2018-02-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/demo/providers/Microsoft.ContainerInstance/containerGroups/demo1", + "status": "Creating" + } + } + } + } + \ No newline at end of file From 24d60116617096cd26598e974ac7e1fa00ec8169 Mon Sep 17 00:00:00 2001 From: sakreter Date: Wed, 7 Mar 2018 13:26:35 -0800 Subject: [PATCH 4/6] fixing ARM header field --- .../preview/2018-02-01-preview/containerInstance.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json index 6030634622e5..61183a662222 100644 --- a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json @@ -175,17 +175,12 @@ }, "201": { "description": "Created - the container group is created.", - "headers": { - "Azure-AsyncOperation": { - "description": "Operation Status Location URI", - "type": "string" - } - }, "schema": { "$ref": "#/definitions/ContainerGroup" } } - } + }, + "x-ms-long-running-operation": true }, "patch": { "operationId": "ContainerGroups_Update", From 9fecbb9feb0b8ea3cbba6a02e84973b2bdf11378 Mon Sep 17 00:00:00 2001 From: sakreter Date: Mon, 12 Mar 2018 11:10:53 -0700 Subject: [PATCH 5/6] remvoing extra async operations --- .../2018-02-01-preview/containerInstance.json | 104 +----------------- 1 file changed, 2 insertions(+), 102 deletions(-) diff --git a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json index 61183a662222..673543793ad0 100644 --- a/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json +++ b/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/preview/2018-02-01-preview/containerInstance.json @@ -180,7 +180,7 @@ } } }, - "x-ms-long-running-operation": true + "x-ms-long-running-operation": true }, "patch": { "operationId": "ContainerGroups_Update", @@ -316,39 +316,6 @@ } } }, - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/operations/{operationId}": { - "get": { - "operationId": "AsyncContainerGroupOperation_Get", - "x-ms-examples": { - "ContainerGroupAsyncOperation": { - "$ref": "./examples/ContainerGroupAsyncOperation.json" - } - }, - "description": "Get the container group async operation status.", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/LocationParameter" - }, - { - "$ref": "#/parameters/OperationIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/AsyncOperation" - } - } - } - } - }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs": { "get": { "operationId": "ContainerLogs_List", @@ -398,7 +365,7 @@ }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec": { "post": { - "operationId": "StartContainer_Exec", + "operationId": "StartContainer_LaunchExec", "x-ms-examples": { "ContainerExecStart": { "$ref": "./examples/ContainerExecStart.json" @@ -1115,73 +1082,6 @@ } } }, - "AsyncOperation": { - "type": "object", - "description": "Azure async operation status.", - "properties": { - "id": { - "type": "string", - "description": "Async operation id." - }, - "status": { - "type": "string", - "description": "Async operation status." - }, - "startTime": { - "type": "string", - "description": "The date time that the async operation started.", - "format": "date-time", - "readOnly": true - }, - "properties": { - "$ref": "#/definitions/AsyncOperationProperties", - "description": "this structure contains the detailed properties of the operation." - }, - "error": { - "$ref": "#/definitions/AzureResourceExtendedErrorInfo", - "description": "If the async operation fails, this structure contains the error details." - } - } - }, - "AsyncOperationProperties": { - "type": "object", - "description": "The properties of the async operation", - "properties": { - "events": { - "readOnly": true, - "description": "The events of the async operation.", - "type": "array", - "items": { - "$ref": "#/definitions/Event" - } - } - } - }, - "AzureResourceExtendedErrorInfo": { - "type": "object", - "description": "The error detail information for async operation", - "properties": { - "code": { - "type": "string", - "description": "The error code." - }, - "target": { - "type": "string", - "description": "The error target." - }, - "message": { - "type": "string", - "description": "The error message." - }, - "details": { - "type": "array", - "description": "An array containing error information.", - "items": { - "$ref": "#/definitions/AzureResourceExtendedErrorInfo" - } - } - } - }, "ContainerGroupListResult": { "description": "The container group list response that contains the container group properties.", "type": "object", From 338812373b418f43cc56c9cf152a99475fbe12e1 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 12 Mar 2018 13:20:22 -0700 Subject: [PATCH 6/6] Update Python version --- specification/containerinstance/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/containerinstance/resource-manager/readme.md b/specification/containerinstance/resource-manager/readme.md index 9709cab633a3..06ac2b7cf2fe 100644 --- a/specification/containerinstance/resource-manager/readme.md +++ b/specification/containerinstance/resource-manager/readme.md @@ -115,7 +115,7 @@ python: payload-flattening-threshold: 2 namespace: azure.mgmt.containerinstance package-name: azure-mgmt-containerinstance - package-version: 0.2.0 + package-version: 0.4.0 clear-output-folder: true ``` ``` yaml $(python) && $(python-mode) == 'update'