-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Container Exec Spec #2584
Changes from 4 commits
7b12627
a60b503
1ec1e3f
24d6011
9fecbb9
3388123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -179,7 +179,8 @@ | |||
"$ref": "#/definitions/ContainerGroup" | ||||
} | ||||
} | ||||
} | ||||
}, | ||||
"x-ms-long-running-operation": true | ||||
}, | ||||
"patch": { | ||||
"operationId": "ContainerGroups_Update", | ||||
|
@@ -206,6 +207,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 +316,39 @@ | |||
} | ||||
} | ||||
}, | ||||
"/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" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really don't understand what you'are trying to do here :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example was incorrect. The latest commit fixed this issue. |
||||
}, | ||||
{ | ||||
"$ref": "#/parameters/ApiVersionParameter" | ||||
} | ||||
], | ||||
"responses": { | ||||
"200": { | ||||
"description": "OK", | ||||
"schema": { | ||||
"$ref": "#/definitions/AsyncOperation" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name seems unrelated to semantic of the operation. |
||||
} | ||||
} | ||||
} | ||||
} | ||||
}, | ||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs": { | ||||
"get": { | ||||
"operationId": "ContainerLogs_List", | ||||
|
@@ -360,6 +395,56 @@ | |||
} | ||||
} | ||||
} | ||||
}, | ||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec": { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. action name exec can be more descriptive. launchExecCommand etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
"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 +1115,73 @@ | |||
} | ||||
} | ||||
}, | ||||
"AsyncOperation": { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the way we model long running operation at all. Please see for example: Line 403 in 8b34c73
|
||||
"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 +1209,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": "integer", | ||||
"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 +1321,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" | ||||
} | ||||
} | ||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name seems unrelated to semantic of the operation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless there is something I don't get in your service, if this is the operation to follow your previous async operation, you don't need this at all. If you follow ARM guidelines, this operation will be discovered by the "x-ms-long-running" flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not need to add this to the swagger spec.