{ "swagger": "2.0", "info": { "version": "2017-08-01-preview", "title": "ContainerInstanceManagementClient" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow", "scopes": { "user_impersonation": "Impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups": { "get": { "operationId": "ContainerGroups_List", "x-ms-examples": { "ContainerGroupsList": { "$ref": "./examples/ContainerGroupsList.json" } }, "summary": "Get a list of container groups in the specified subscription.", "description": "Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContainerGroupListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups": { "get": { "operationId": "ContainerGroups_ListByResourceGroup", "x-ms-examples": { "ContainerGroupsListByResourceGroup": { "$ref": "./examples/ContainerGroupsListByResourceGroup.json" } }, "summary": "Get a list of container groups in the specified subscription and resource group.", "description": "Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group that contains the container group.", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContainerGroupListResult" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}": { "get": { "operationId": "ContainerGroups_Get", "x-ms-examples": { "ContainerGroupsGet": { "$ref": "./examples/ContainerGroupsGet.json" } }, "summary": "Get the properties of the specified container group.", "description": "Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group that contains the container group.", "required": true, "type": "string" }, { "name": "containerGroupName", "in": "path", "description": "The name of the container group.", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContainerGroup" } } } }, "put": { "operationId": "ContainerGroups_CreateOrUpdate", "x-ms-examples": { "ContainerGroupsCreateOrUpdate": { "$ref": "./examples/ContainerGroupsCreateOrUpdate.json" } }, "summary": "Create or update container groups.", "description": "Create or update container groups with specified configurations.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group to contain the container group to be created or updated.", "required": true, "type": "string" }, { "name": "containerGroupName", "in": "path", "description": "The name of the container group to be created or updated.", "required": true, "type": "string" }, { "name": "containerGroup", "description": "The properties of the container group to be created or updated.", "required": true, "in": "body", "schema": { "$ref": "#/definitions/ContainerGroup" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContainerGroup" } }, "201": { "description": "Created - the container group is created.", "schema": { "$ref": "#/definitions/ContainerGroup" } } } }, "delete": { "operationId": "ContainerGroups_Delete", "x-ms-examples": { "ContainerGroupsDelete": { "$ref": "./examples/ContainerGroupsDelete.json" } }, "summary": "Delete the specified container group.", "description": "Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group that contains the container group.", "required": true, "type": "string" }, { "name": "containerGroupName", "in": "path", "description": "The name of the container group to be deleted.", "required": true, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ContainerGroup" } }, "204": { "description": "No Content - the specified container group was not found." } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs": { "get": { "operationId": "ContainerLogs_List", "x-ms-examples": { "ContainerLogsList": { "$ref": "./examples/ContainerLogsList.json" } }, "summary": "Get the logs for a specified container instance.", "description": "Get the logs for a specified container instance in a specified resource group and container group.", "parameters": [ { "$ref": "#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/ApiVersionParameter" }, { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group that contains the container instance.", "required": true, "type": "string" }, { "name": "containerName", "in": "path", "description": "The name of the container instance.", "required": true, "type": "string" }, { "name": "containerGroupName", "in": "path", "description": "The name of the container group the container instance belongs to.", "required": true, "type": "string" }, { "name": "tail", "in": "query", "description": "The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb.", "type": "integer" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Logs" } } } } } }, "definitions": { "Container": { "description": "A container instance.", "type": "object", "required": [ "properties", "name" ], "properties": { "name": { "description": "The user-provided name of the container instance.", "type": "string" }, "properties": { "x-ms-client-flatten": true, "description": "The properties of the container instance.", "$ref": "#/definitions/ContainerProperties" } } }, "ContainerProperties": { "description": "The container instance properties.", "type": "object", "required": [ "image", "resources" ], "properties": { "image": { "description": "The name of the image used to create the container instance.", "type": "string" }, "command": { "description": "The commands to execute within the container instance in exec form.", "type": "array", "items": { "type": "string" } }, "ports": { "description": "The exposed ports on the container instance.", "type": "array", "items": { "$ref": "#/definitions/ContainerPort" } }, "environmentVariables": { "description": "The environment variables to set in the container instance.", "type": "array", "items": { "$ref": "#/definitions/EnvironmentVariable" } }, "instanceView": { "description": "The instance view of the container instance. Only valid in response.", "readOnly": true, "type": "object", "properties": { "restartCount": { "type": "integer", "description": "The number of times that the container instance has been restarted." }, "currentState": { "description": "Current container instance state.", "$ref": "#/definitions/ContainerState" }, "previousState": { "description": "Previous container instance state.", "$ref": "#/definitions/ContainerState" }, "events": { "description": "The events of the container instance.", "type": "array", "items": { "$ref": "#/definitions/ContainerEvent" } } } }, "resources": { "description": "The resource requirements of the container instance.", "$ref": "#/definitions/ResourceRequirements" }, "volumeMounts": { "description": "The volume mounts available to the container instance.", "type": "array", "items": { "$ref": "#/definitions/VolumeMount" } } } }, "ContainerState": { "description": "The container instance state.", "type": "object", "properties": { "state": { "type": "string", "description": "The state of the container instance." }, "startTime": { "type": "string", "format": "date-time", "description": "The date-time when the container instance state started." }, "exitCode": { "type": "integer", "description": "The container instance exit codes correspond to those from the `docker run` command." }, "finishTime": { "type": "string", "format": "date-time", "description": "The date-time when the container instance state finished." }, "detailStatus": { "description": "The human-readable status of the container instance state.", "type": "string" } } }, "ContainerEvent": { "description": "A container instance event.", "type": "object", "properties": { "count": { "type": "integer", "description": "The count of the event." }, "firstTimestamp": { "type": "string", "format": "date-time", "description": "The date-time of the earliest logged event." }, "lastTimestamp": { "type": "string", "format": "date-time", "description": "The date-time of the latest logged event." }, "message": { "type": "string", "description": "The event message." }, "type": { "type": "string", "description": "The event type." } } }, "ResourceRequirements": { "description": "The resource requirements.", "type": "object", "required": [ "requests" ], "properties": { "requests": { "description": "The resource requests of this container instance.", "$ref": "#/definitions/ResourceRequests" }, "limits": { "description": "The resource limits of this container instance.", "$ref": "#/definitions/ResourceLimits" } } }, "ResourceRequests": { "description": "The resource requests.", "type": "object", "required": [ "memoryInGB", "cpu" ], "properties": { "memoryInGB": { "description": "The memory request in GB of this container instance.", "type": "number", "format": "double" }, "cpu": { "description": "The CPU request of this container instance.", "type": "number", "format": "double" } } }, "ResourceLimits": { "description": "The resource limits.", "type": "object", "properties": { "memoryInGB": { "description": "The memory limit in GB of this container instance.", "type": "number", "format": "double" }, "cpu": { "description": "The CPU limit of this container instance.", "type": "number", "format": "double" } } }, "AzureFileVolume": { "description": "The properties of the Azure File volume. Azure File shares are mounted as volumes.", "type": "object", "required": [ "shareName", "storageAccountName" ], "properties": { "shareName": { "description": "The name of the Azure File share to be mounted as a volume.", "type": "string" }, "readOnly": { "description": "The flag indicating whether the Azure File shared mounted as a volume is read-only.", "type": "boolean" }, "storageAccountName": { "description": "The name of the storage account that contains the Azure File share.", "type": "string" }, "storageAccountKey": { "description": "The storage account access key used to access the Azure File share.", "type": "string" } } }, "Volume": { "description": "The properties of the volume.", "type": "object", "required": [ "name", "azureFile" ], "properties": { "name": { "description": "The name of the volume.", "type": "string" }, "azureFile": { "description": "The name of the Azure File volume.", "$ref": "#/definitions/AzureFileVolume" } } }, "VolumeMount": { "description": "The properties of the volume mount.", "type": "object", "required": [ "name", "mountPath" ], "properties": { "name": { "description": "The name of the volume mount.", "type": "string" }, "mountPath": { "description": "The path within the container where the volume should be mounted. Must not contain colon (:).", "type": "string" }, "readOnly": { "description": "The flag indicating whether the volume mount is read-only.", "type": "boolean" } } }, "ContainerGroup": { "description": "A container group.", "allOf": [ { "$ref": "#/definitions/Resource" }, { "type": "object", "required": [ "properties" ], "properties": { "properties": { "x-ms-client-flatten": true, "type": "object", "properties": { "provisioningState": { "readOnly": true, "type": "string", "description": "The provisioning state of the container group. This only appears in the response." }, "containers": { "type": "array", "description": "The containers within the container group.", "items": { "$ref": "#/definitions/Container" } }, "imageRegistryCredentials": { "type": "array", "description": "The image registry credentials by which the container group is created from.", "items": { "$ref": "#/definitions/ImageRegistryCredential" } }, "restartPolicy": { "type": "string", "description": "Restart policy for all containers within the container group. Currently the only available option is `always`.", "enum": [ "always" ], "x-ms-enum": { "name": "ContainerRestartPolicy", "modelAsString": true } }, "ipAddress": { "description": "The IP address type of the container group.", "$ref": "#/definitions/IpAddress" }, "osType": { "type": "string", "description": "The operating system type required by the containers in the container group.", "enum": [ "Windows", "Linux" ], "x-ms-enum": { "name": "OperatingSystemTypes", "modelAsString": true } }, "state": { "readOnly": true, "type": "string", "description": "The current state of the container group. This is only valid for the response." }, "volumes": { "type": "array", "description": "The list of volumes that can be mounted by containers in this container group.", "items": { "$ref": "#/definitions/Volume" } } }, "required": [ "containers", "osType" ] } } } ] }, "ImageRegistryCredential": { "description": "Image registry credential.", "type": "object", "properties": { "server": { "type": "string", "description": "The Docker image registry server without a protocol such as \"http\" and \"https\"." }, "username": { "type": "string", "description": "The username for the private registry." }, "password": { "type": "string", "description": "The password for the private registry." } }, "required": [ "server", "username" ] }, "IpAddress": { "description": "IP address for the container group.", "type": "object", "properties": { "ports": { "type": "array", "description": "The list of ports exposed on the container group.", "items": { "$ref": "#/definitions/Port" } }, "type": { "type": "string", "description": "Specifies if the IP is exposed to the public internet.", "enum": [ "Public" ], "x-ms-enum": { "name": "ContainerGroupIpAddressType", "modelAsString": true } }, "ip": { "type": "string", "description": "The IP exposed to the public internet." } }, "required": [ "ports", "type" ] }, "Port": { "description": "The port exposed on the container group.", "type": "object", "properties": { "protocol": { "type": "string", "description": "The protocol associated with the port.", "enum": [ "TCP", "UDP" ], "x-ms-enum": { "name": "ContainerGroupNetworkProtocol", "modelAsString": true } }, "port": { "type": "integer", "description": "The port number.", "format": "int32" } }, "required": [ "port" ] }, "ContainerPort": { "description": "The port exposed on the container instance.", "type": "object", "properties": { "port": { "type": "integer", "format": "int32", "description": "The port number exposed within the container group." } }, "required": [ "port" ] }, "EnvironmentVariable": { "description": "The environment variable to set within the container instance.", "type": "object", "properties": { "name": { "type": "string", "description": "The name of the environment variable." }, "value": { "type": "string", "description": "The value of the environment variable." } }, "required": [ "name", "value" ] }, "ContainerGroupListResult": { "description": "The container group list response that contains the container group properties.", "type": "object", "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/ContainerGroup" }, "description": "The list of container groups." }, "nextLink": { "type": "string", "description": "The URI to fetch the next page of container groups." } } }, "Logs": { "description": "The logs.", "type": "object", "properties": { "content": { "type": "string", "description": "The content of the log." } } }, "Resource": { "type": "object", "description": "The Resource model definition.", "properties": { "id": { "readOnly": true, "type": "string", "description": "The resource id." }, "name": { "readOnly": true, "type": "string", "description": "The resource name." }, "type": { "readOnly": true, "type": "string", "description": "The resource type." }, "location": { "type": "string", "description": "The resource location." }, "tags": { "type": "object", "additionalProperties": { "type": "string" }, "description": "The resource tags." } }, "required": [ "location" ], "x-ms-azure-resource": true } }, "parameters": { "SubscriptionIdParameter": { "name": "subscriptionId", "in": "path", "required": true, "type": "string", "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." }, "ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "description": "Client API version" } } }