diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json index c2ad6f84fa0d..7e4e9f66156d 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/CommonDefinitions.json @@ -464,6 +464,25 @@ } } }, + "Secret": { + "description": "Secret definition.", + "type": "object", + "properties": { + "name": { + "description": "Secret Name.", + "type": "string" + }, + "value": { + "description": "Secret Value.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "x-ms-secret": true + } + } + }, "Template": { "description": "Container App versioned application definition.\nDefines the desired state of an immutable revision.\nAny changes to this section Will result in a new revision being created", "type": "object", diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/ContainerApps.json index e33530bdd93d..0f86a1895e9f 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/ContainerApps.json @@ -418,7 +418,7 @@ "description": "Collection of secrets used by a Container app", "type": "array", "items": { - "$ref": "#/definitions/Secret" + "$ref": "./CommonDefinitions.json#/definitions/Secret" }, "x-ms-identifiers": [ "name" @@ -638,25 +638,6 @@ } } }, - "Secret": { - "description": "Container App Secret.", - "type": "object", - "properties": { - "name": { - "description": "Secret Name.", - "type": "string" - }, - "value": { - "description": "Secret Value.", - "type": "string", - "x-ms-mutability": [ - "create", - "update" - ], - "x-ms-secret": true - } - } - }, "SecretsCollection": { "description": "Container App Secrets Collection ARM resource.", "required": [ diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/DaprComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/DaprComponents.json new file mode 100644 index 000000000000..4e5f5f8b3124 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/DaprComponents.json @@ -0,0 +1,356 @@ +{ + "swagger": "2.0", + "info": { + "version": "2022-01-01-preview", + "title": "ContainerApps API Client" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents": { + "get": { + "tags": [ + "DaprComponents" + ], + "summary": "Get the Dapr Components for a managed environment.", + "operationId": "DaprComponents_List", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "Name of the Managed Environment.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DaprComponentsCollection" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "List Dapr Components": { + "$ref": "./examples/DaprComponents_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{name}": { + "get": { + "tags": [ + "DaprComponents" + ], + "summary": "Get a dapr component.", + "operationId": "DaprComponents_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "Name of the Managed Environment.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Dapr Component.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DaprComponent" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Dapr Component": { + "$ref": "./examples/DaprComponents_Get.json" + } + } + }, + "put": { + "tags": [ + "DaprComponents" + ], + "summary": "Creates or updates a Dapr Component.", + "description": "Creates or updates a Dapr Component in a Managed Environment.", + "operationId": "DaprComponents_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "Name of the Managed Environment.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Dapr Component.", + "required": true, + "type": "string" + }, + { + "name": "daprComponentEnvelope", + "in": "body", + "description": "Configuration details of the Dapr Component.", + "required": true, + "schema": { + "$ref": "#/definitions/DaprComponent" + } + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DaprComponent" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-long-running-operation": false, + "x-ms-examples": { + "Create or update dapr component": { + "$ref": "./examples/DaprComponents_CreateOrUpdate.json" + } + } + }, + "delete": { + "tags": [ + "DaprComponents" + ], + "summary": "Delete a Dapr Component.", + "description": "Delete a Dapr Component from a Managed Environment.", + "operationId": "DaprComponents_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "environmentName", + "in": "path", + "description": "Name of the Managed Environment.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Dapr Component.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Delete operation completed" + }, + "204": { + "description": "Environment does not exist" + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete dapr component": { + "$ref": "./examples/DaprComponents_Delete.json" + } + }, + "x-ms-long-running-operation": false + } + } + }, + "definitions": { + "DaprComponentsCollection": { + "description": "Dapr Components ARM resource.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of resources.", + "type": "array", + "items": { + "$ref": "#/definitions/DaprComponent" + } + }, + "nextLink": { + "description": "Link to next page of resources.", + "type": "string", + "readOnly": true + } + } + }, + "DaprComponent": { + "description": "Dapr Component.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "description": "Dapr Component resource specific properties", + "type": "object", + "properties": { + "componentType": { + "description": "Component type", + "type": "string" + }, + "version": { + "description": "Component version", + "type": "string" + }, + "ignoreErrors": { + "description": "Boolean describing if the component errors are ignores", + "type": "boolean" + }, + "initTimeout": { + "description": "Initialization timeout", + "type": "string" + }, + "secrets": { + "description": "Collection of secrets used by a Dapr component", + "type": "array", + "items": { + "$ref": "./CommonDefinitions.json#/definitions/Secret" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "metadata": { + "description": "Component metadata", + "type": "array", + "items": { + "$ref": "#/definitions/DaprMetadata" + }, + "x-ms-identifiers": [ + "name" + ] + }, + "scopes": { + "description": "Names of container apps that can use this Dapr component", + "type": "array", + "items": { + "type": "string" + } + } + }, + "x-ms-client-flatten": true + } + } + }, + "DaprMetadata": { + "description": "Dapr component metadata.", + "type": "object", + "properties": { + "name": { + "description": "Metadata property name.", + "type": "string" + }, + "value": { + "description": "Metadata property value.", + "type": "string" + }, + "secretRef": { + "description": "Name of the Dapr Component secret from which to pull the metadata property value.", + "type": "string" + } + } + } + }, + "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" + } + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ] +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json index 4d17e4116733..d3f43ccab4a2 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_ListSecrets.json @@ -11,12 +11,10 @@ "body": { "value": [ { - "name": "secret1", - "value": "myvalue1" + "name": "secret1" }, { - "name": "secret2", - "value": "myvalue2" + "name": "secret2" } ] } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_CreateOrUpdate.json new file mode 100644 index 000000000000..c09192bf024f --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_CreateOrUpdate.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "subscriptionId": "8efdecc5-919e-44eb-b179-915dca89ebf9", + "resourceGroupName": "examplerg", + "environmentName": "myenvironment", + "name": "reddog", + "api-version": "2022-01-01-preview", + "daprComponentEnvelope": { + "properties": { + "componentType": "state.azure.cosmosdb", + "version": "v1", + "ignoreErrors": false, + "initTimeout": "50s", + "secrets": [ + { + "name": "masterkey", + "value": "keyvalue" + } + ], + "metadata": [ + { + "name": "url", + "value": "" + }, + { + "name": "database", + "value": "itemsDB" + }, + { + "name": "collection", + "value": "items" + }, + { + "name": "masterkey", + "secretRef": "masterkey" + } + ], + "scopes": [ + "container-app-1", + "container-app-2" + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog", + "name": "reddog", + "type": "Microsoft.App/managedEnvironments/daprcomponents", + "properties": { + "componentType": "state.azure.cosmosdb", + "version": "v1", + "ignoreErrors": false, + "initTimeout": "50s", + "secrets": [ + { + "name": "masterkey" + } + ], + "metadata": [ + { + "name": "url", + "value": "" + }, + { + "name": "database", + "value": "itemsDB" + }, + { + "name": "collection", + "value": "items" + }, + { + "name": "masterkey", + "secretRef": "masterkey" + } + ], + "scopes": [ + "container-app-1", + "container-app-2" + ] + } + } + } + } +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Delete.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Delete.json new file mode 100644 index 000000000000..fd76e6ce55f4 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Delete.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "8efdecc5-919e-44eb-b179-915dca89ebf9", + "resourceGroupName": "examplerg", + "environmentName": "myenvironment", + "name": "reddog", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Get.json new file mode 100644 index 000000000000..f9ed1449c963 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_Get.json @@ -0,0 +1,51 @@ +{ + "parameters": { + "subscriptionId": "8efdecc5-919e-44eb-b179-915dca89ebf9", + "resourceGroupName": "examplerg", + "environmentName": "myenvironment", + "name": "reddog", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog", + "name": "reddog", + "type": "Microsoft.App/managedEnvironments/daprcomponents", + "properties": { + "componentType": "state.azure.cosmosdb", + "version": "v1", + "ignoreErrors": false, + "initTimeout": "50s", + "secrets": [ + { + "name": "masterkey" + } + ], + "metadata": [ + { + "name": "url", + "value": "" + }, + { + "name": "database", + "value": "itemsDB" + }, + { + "name": "collection", + "value": "items" + }, + { + "name": "masterkey", + "secretRef": "masterkey" + } + ], + "scopes": [ + "container-app-1", + "container-app-2" + ] + } + } + } + } +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_List.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_List.json new file mode 100644 index 000000000000..ed1b8068ca8c --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/DaprComponents_List.json @@ -0,0 +1,54 @@ +{ + "parameters": { + "subscriptionId": "8efdecc5-919e-44eb-b179-915dca89ebf9", + "resourceGroupName": "examplerg", + "environmentName": "myenvironment", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprcomponents/reddog", + "name": "reddog", + "type": "Microsoft.App/managedEnvironments/daprcomponents", + "properties": { + "componentType": "state.azure.cosmosdb", + "version": "v1", + "ignoreErrors": false, + "initTimeout": "50s", + "secrets": [ + { + "name": "masterkey" + } + ], + "metadata": [ + { + "name": "url", + "value": "" + }, + { + "name": "database", + "value": "itemsDB" + }, + { + "name": "collection", + "value": "items" + }, + { + "name": "masterkey", + "secretRef": "masterkey" + } + ], + "scopes": [ + "container-app-1", + "container-app-2" + ] + } + } + ] + } + } + } +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json index 1eda5caff48d..7ac16d8719d2 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json @@ -4,7 +4,6 @@ "resourceGroupName": "examplerg", "name": "testcontainerenv", "api-version": "2022-01-01-preview", - "location": "East US", "environmentEnvelope": { "location": "East US", "properties": { diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json index fc8ae425dec4..1c8bd516969b 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_Get.json @@ -3,7 +3,6 @@ "subscriptionId": "8efdecc5-919e-44eb-b179-915dca89ebf9", "resourceGroupName": "examplerg", "name": "jlaw-demo1", - "location": "North Central US", "api-version": "2022-01-01-preview" }, "responses": { diff --git a/specification/app/resource-manager/readme.md b/specification/app/resource-manager/readme.md index f952dbee8ab8..74719d10768e 100644 --- a/specification/app/resource-manager/readme.md +++ b/specification/app/resource-manager/readme.md @@ -41,6 +41,7 @@ input-file: - Microsoft.App/preview/2022-01-01-preview/ManagedEnvironments.json - Microsoft.App/preview/2022-01-01-preview/Global.json - Microsoft.App/preview/2022-01-01-preview/SourceControls.json + - Microsoft.App/preview/2022-01-01-preview/DaprComponents.json - Microsoft.App/preview/2022-01-01-preview/EasyAuthConfigs.json - Microsoft.App/preview/2022-01-01-preview/ManagedEnvironmentsStorages.json directive: