{ "swagger": "2.0", "info": { "title": "DeploymentScripts Client", "version": "2019-10-01-preview", "description": "DeploymentScripts Client", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "host": "management.azure.com", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, "tags": [ { "name": "DeploymentScripts" } ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentScripts": { "get": { "operationId": "DeploymentScripts_ListBySubscription", "tags": [ "DeploymentScripts" ], "description": "Lists all deployment scripts for a given subscription.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/DeploymentScriptListResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsListBySubscription": { "$ref": "./examples/DeploymentScripts_ListBySubscription.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts": { "get": { "operationId": "DeploymentScripts_ListByResourceGroup", "tags": [ "DeploymentScripts" ], "description": "Lists deployments scripts.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/DeploymentScriptListResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsList": { "$ref": "./examples/DeploymentScripts_ListByResourceGroup.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}": { "get": { "operationId": "DeploymentScripts_Get", "tags": [ "DeploymentScripts" ], "description": "Gets a deployment script with a given name.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/DeploymentScript" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsGet": { "$ref": "./examples/DeploymentScripts_Get.json" } } }, "put": { "operationId": "DeploymentScripts_Create", "tags": [ "DeploymentScripts" ], "description": "Creates a deployment script.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 }, { "name": "deploymentScript", "in": "body", "description": "Deployment script supplied to the operation.", "required": true, "schema": { "$ref": "#/definitions/DeploymentScript" } } ], "responses": { "200": { "description": "Resource 'DeploymentScript' update operation succeeded", "schema": { "$ref": "#/definitions/DeploymentScript" } }, "201": { "description": "Resource 'DeploymentScript' create operation succeeded", "schema": { "$ref": "#/definitions/DeploymentScript" }, "headers": { "Location": { "type": "string", "description": "The Location header contains the URL where the status of the long running operation can be checked." }, "Retry-After": { "type": "integer", "format": "int32", "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsCreate": { "$ref": "./examples/DeploymentScripts_Create.json" }, "DeploymentScriptsCreate_MinCreate": { "$ref": "./examples/DeploymentScripts_Min_Create.json" }, "DeploymentScriptsCreate_UsingCustomACIName": { "$ref": "./examples/DeploymentScripts_Create_Using_Custom_Aci_Name.json" }, "DeploymentScriptsCreate_UsingExistingStorageAccount": { "$ref": "./examples/DeploymentScripts_Create_Using_Existing_StorageAccount.json" } }, "x-ms-long-running-operation-options": { "final-state-via": "location" }, "x-ms-long-running-operation": true }, "patch": { "operationId": "DeploymentScripts_Update", "tags": [ "DeploymentScripts" ], "description": "Updates deployment script tags with specified values.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 }, { "name": "deploymentScript", "in": "body", "description": "Deployment script resource with the tags to be updated.", "required": false, "schema": { "$ref": "#/definitions/DeploymentScriptUpdateParameter" } } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/DeploymentScript" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsUpdate": { "$ref": "./examples/DeploymentScripts_Update.json" } } }, "delete": { "operationId": "DeploymentScripts_Delete", "tags": [ "DeploymentScripts" ], "description": "Deletes a deployment script. When operation completes, status code 200 returned without content.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 } ], "responses": { "200": { "description": "Resource deleted successfully." }, "204": { "description": "Resource does not exist." }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsDelete": { "$ref": "./examples/DeploymentScripts_Delete.json" } } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs": { "get": { "operationId": "DeploymentScripts_GetLogs", "tags": [ "DeploymentScripts" ], "description": "Gets deployment script logs for a given deployment script name.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ScriptLogsList" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsGetLogs": { "$ref": "./examples/DeploymentScripts_GetLogs.json" } } } }, "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}/logs/default": { "get": { "operationId": "DeploymentScripts_GetLogsDefault", "tags": [ "DeploymentScripts" ], "description": "Gets deployment script logs for a given deployment script name.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "#/parameters/DeploymentScriptBaseParameters.resourceGroupName" }, { "name": "scriptName", "in": "path", "description": "Name of the deployment script.", "required": true, "type": "string", "minLength": 1, "maxLength": 90 }, { "name": "tail", "in": "query", "description": "The number of lines to show from the tail of the deployment script log. Valid value is a positive number up to 1000. If 'tail' is not provided, all available logs are shown up to container instance log capacity of 4mb.", "required": false, "type": "integer", "format": "int32" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ScriptLog" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "DeploymentScriptsGetLogs": { "$ref": "./examples/DeploymentScripts_GetLogsDefault.json" }, "DeploymentScriptsGetLogsWithTail": { "$ref": "./examples/DeploymentScripts_GetLogsDefaultWithTail.json" } } } } }, "definitions": { "AzureCliScript": { "type": "object", "description": "Object model for the Azure CLI script.", "properties": { "properties": { "$ref": "#/definitions/AzureCliScriptProperties", "description": "Properties of the Azure CLI script object.", "x-ms-client-flatten": true } }, "required": [ "properties" ], "allOf": [ { "$ref": "#/definitions/DeploymentScript" } ], "x-ms-discriminator-value": "AzureCLI" }, "AzureCliScriptProperties": { "type": "object", "description": "Properties of the Azure CLI script object.", "properties": { "azCliVersion": { "type": "string", "description": "Azure CLI module version to be used." } }, "required": [ "azCliVersion" ], "allOf": [ { "$ref": "#/definitions/DeploymentScriptPropertiesBase" } ] }, "AzurePowerShellScript": { "type": "object", "description": "Object model for the Azure PowerShell script.", "properties": { "properties": { "$ref": "#/definitions/AzurePowerShellScriptProperties", "description": "Properties of the Azure PowerShell script object.", "x-ms-client-flatten": true } }, "required": [ "properties" ], "allOf": [ { "$ref": "#/definitions/DeploymentScript" } ], "x-ms-discriminator-value": "AzurePowerShell" }, "AzurePowerShellScriptProperties": { "type": "object", "description": "Properties of the Azure PowerShell script object.", "properties": { "azPowerShellVersion": { "type": "string", "description": "Azure PowerShell module version to be used." } }, "required": [ "azPowerShellVersion" ], "allOf": [ { "$ref": "#/definitions/DeploymentScriptPropertiesBase" } ] }, "AzureResourceBase": { "type": "object", "description": "Common properties for all Azure resources.", "properties": { "id": { "type": "string", "description": "String Id used to locate any resource on Azure.", "readOnly": true }, "name": { "type": "string", "description": "Name of this resource.", "readOnly": true }, "type": { "type": "string", "description": "Type of this resource.", "readOnly": true } } }, "ContainerConfiguration": { "type": "object", "description": "Settings to customize ACI container instance.", "properties": { "containerGroupName": { "type": "string", "description": "Container group name, if not specified then the name will get auto-generated. Not specifying a 'containerGroupName' indicates the system to generate a unique name which might end up flagging an Azure Policy as non-compliant. Use 'containerGroupName' when you have an Azure Policy that expects a specific naming convention or when you want to fully control the name. 'containerGroupName' property must be between 1 and 63 characters long, must contain only lowercase letters, numbers, and dashes and it cannot start or end with a dash and consecutive dashes are not allowed. To specify a 'containerGroupName', add the following object to properties: { \"containerSettings\": { \"containerGroupName\": \"contoso-container\" } }. If you do not want to specify a 'containerGroupName' then do not add 'containerSettings' property.", "minLength": 1, "maxLength": 63 } } }, "DeploymentScript": { "type": "object", "description": "Deployment script object.", "properties": { "kind": { "$ref": "#/definitions/ScriptType", "description": "Type of the script." }, "identity": { "$ref": "#/definitions/ManagedServiceIdentity", "description": "Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported." } }, "discriminator": "kind", "required": [ "kind", "identity" ], "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" } ] }, "DeploymentScriptListResult": { "type": "object", "description": "List of deployment scripts.", "properties": { "value": { "type": "array", "description": "An array of deployment scripts.", "items": { "$ref": "#/definitions/DeploymentScript" } }, "nextLink": { "type": "string", "description": "The URL to use for getting the next set of results.", "readOnly": true } } }, "DeploymentScriptPropertiesBase": { "type": "object", "description": "Common properties for the deployment script.", "properties": { "primaryScriptUri": { "type": "string", "description": "Uri for the script. This is the entry point for the external script." }, "supportingScriptUris": { "type": "array", "description": "Supporting files for the external script.", "items": { "type": "string" } }, "scriptContent": { "type": "string", "description": "Script body." }, "arguments": { "type": "string", "description": "Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2'" }, "environmentVariables": { "type": "array", "description": "The environment variables to pass over to the script.", "items": { "$ref": "#/definitions/EnvironmentVariable" }, "x-ms-identifiers": [ "name" ] }, "forceUpdateTag": { "type": "string", "description": "Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID." }, "retentionInterval": { "type": "string", "format": "duration", "description": "Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P1D means one day)." }, "timeout": { "type": "string", "format": "duration", "description": "Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D", "default": "P1D" }, "containerSettings": { "$ref": "#/definitions/ContainerConfiguration", "description": "Container settings." }, "storageAccountSettings": { "$ref": "#/definitions/StorageAccountConfiguration", "description": "Storage Account settings." }, "cleanupPreference": { "type": "string", "description": "The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.", "default": "Always", "enum": [ "Always", "OnSuccess", "OnExpiration" ], "x-ms-enum": { "name": "cleanupOptions", "modelAsString": true, "values": [ { "name": "Always", "value": "Always", "description": "Always clean up the resources created by the script execution." }, { "name": "OnSuccess", "value": "OnSuccess", "description": "Clean up the resources created by the script execution only if the script execution is successful." }, { "name": "OnExpiration", "value": "OnExpiration", "description": "Clean up the resources created by the script execution only on expiration." } ] } }, "provisioningState": { "$ref": "#/definitions/ScriptProvisioningState", "description": "State of the script execution. This only appears in the response.", "readOnly": true }, "status": { "$ref": "#/definitions/ScriptStatus", "description": "Contains the results of script execution.", "readOnly": true }, "outputs": { "type": "object", "description": "List of script outputs.", "additionalProperties": {}, "readOnly": true } }, "required": [ "retentionInterval" ] }, "DeploymentScriptUpdateParameter": { "type": "object", "description": "Deployment script parameters to be updated.", "properties": { "tags": { "type": "object", "description": "Resource tags to be updated.", "additionalProperties": { "type": "string" } } }, "allOf": [ { "$ref": "#/definitions/AzureResourceBase" } ] }, "EnvironmentVariable": { "type": "object", "description": "The environment variable to pass to the script in the container instance.", "properties": { "name": { "type": "string", "description": "The name of the environment variable." }, "value": { "type": "string", "description": "The value of the environment variable." }, "secureValue": { "type": "string", "description": "The value of the secure environment variable.", "x-ms-secret": true } }, "required": [ "name" ] }, "LogProperties": { "type": "object", "description": "Script log properties.", "properties": { "log": { "type": "string", "description": "Script execution logs in text format.", "readOnly": true } } }, "ManagedServiceIdentity": { "type": "object", "description": "Describes the managed identities for an Azure resource.", "properties": { "type": { "$ref": "#/definitions/ManagedServiceIdentityType", "description": "Type of the managed identity." }, "tenantId": { "type": "string", "description": "The tenant id of the managed identity.", "readOnly": true }, "userAssignedIdentities": { "type": "object", "description": "The list of user-assigned managed identities associated with the resource. Key is the Azure resource Id of the managed identity.", "additionalProperties": { "$ref": "#/definitions/UserAssignedIdentity" } } } }, "ManagedServiceIdentityType": { "type": "string", "description": "Type of the managed identity.", "enum": [ "UserAssigned" ], "x-ms-enum": { "name": "ManagedServiceIdentityType", "modelAsString": true, "values": [ { "name": "UserAssigned", "value": "UserAssigned", "description": "User assigned identity." } ] } }, "ScriptLog": { "type": "object", "description": "Script execution log object.", "properties": { "properties": { "$ref": "#/definitions/LogProperties", "description": "Script log properties.", "x-ms-client-flatten": true } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" } ] }, "ScriptLogsList": { "type": "object", "description": "Deployment script execution logs.", "properties": { "value": { "type": "array", "description": "Deployment scripts logs.", "items": { "$ref": "#/definitions/ScriptLog" } } } }, "ScriptProvisioningState": { "type": "string", "description": "State of the script execution. This only appears in the response.", "enum": [ "Creating", "ProvisioningResources", "Running", "Succeeded", "Failed", "Canceled" ], "x-ms-enum": { "name": "ScriptProvisioningState", "modelAsString": true, "values": [ { "name": "Creating", "value": "Creating", "description": "The script is being created." }, { "name": "ProvisioningResources", "value": "ProvisioningResources", "description": "The script is provisioning resources." }, { "name": "Running", "value": "Running", "description": "The script is running." }, { "name": "Succeeded", "value": "Succeeded", "description": "The script execution is succeeded." }, { "name": "Failed", "value": "Failed", "description": "The script execution has failed." }, { "name": "Canceled", "value": "Canceled", "description": "The script was canceled." } ] } }, "ScriptStatus": { "type": "object", "description": "Generic object modeling results of script execution.", "properties": { "containerInstanceId": { "type": "string", "description": "ACI resource Id.", "readOnly": true }, "storageAccountId": { "type": "string", "description": "Storage account resource Id.", "readOnly": true }, "startTime": { "type": "string", "format": "date-time", "description": "Start time of the script execution.", "readOnly": true }, "endTime": { "type": "string", "format": "date-time", "description": "End time of the script execution.", "readOnly": true }, "expirationTime": { "type": "string", "format": "date-time", "description": "Time the deployment script resource will expire.", "readOnly": true }, "error": { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorDetail", "description": "Error that is relayed from the script execution." } } }, "ScriptType": { "type": "string", "description": "Type of the script.", "enum": [ "AzurePowerShell", "AzureCLI" ], "x-ms-enum": { "name": "ScriptType", "modelAsString": true, "values": [ { "name": "AzurePowerShell", "value": "AzurePowerShell", "description": "Azure PowerShell script." }, { "name": "AzureCLI", "value": "AzureCLI", "description": "Azure CLI script." } ] } }, "StorageAccountConfiguration": { "type": "object", "description": "Settings to use an existing storage account. Valid storage account kinds are: Storage, StorageV2 and FileStorage", "properties": { "storageAccountName": { "type": "string", "description": "The storage account name." }, "storageAccountKey": { "type": "string", "description": "The storage account access key.", "x-ms-secret": true } } }, "UserAssignedIdentity": { "type": "object", "description": "User-assigned managed identity.", "properties": { "principalId": { "type": "string", "description": "Azure Active Directory principal ID associated with this identity.", "readOnly": true }, "clientId": { "type": "string", "description": "Client App Id associated with this identity.", "readOnly": true } } } }, "parameters": { "DeploymentScriptBaseParameters.resourceGroupName": { "name": "resourceGroupName", "in": "path", "description": "The name of the resource group. The name is case insensitive.", "required": true, "type": "string", "minLength": 1, "maxLength": 90, "x-ms-parameter-location": "method" } } }