From 7eca22f170403ed9d13cc8bc3b9aef4ad93e7d10 Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 14:05:44 -0800 Subject: [PATCH 1/6] add sourcecontrol apis --- .../2022-01-01-preview/SourceControls.json | 357 ++++++++++++++++++ .../SourceControls_CreateOrUpdate.json | 53 +++ .../examples/SourceControls_Delete.json | 18 + .../examples/SourceControls_Get.json | 30 ++ 4 files changed, 458 insertions(+) create mode 100644 specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json create mode 100644 specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json create mode 100644 specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json create mode 100644 specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json new file mode 100644 index 000000000000..f3a32bfc2c7a --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json @@ -0,0 +1,357 @@ +{ + "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" + ], + "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}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{name}": { + "get": { + "tags": [ + "ContainerAppsSourceControls" + ], + "summary": "Get a SourceControl of a Container App.", + "operationId": "ContainerAppsSourceControls_Get", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "containerAppName", + "in": "path", + "description": "Name of the Container App.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Container App SourceControl.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SourceControl" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Get Container App's SourceControl": { + "$ref": "./examples/SourceControls_Get.json" + } + } + }, + "put": { + "tags": [ + "ContainerAppsSourceControls" + ], + "summary": "Create or update the SourceControl for a Container App.", + "description": "Description for Create or update the SourceControl for a Container App.", + "operationId": "ContainerAppsSourceControls_CreateOrUpdate", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "containerAppName", + "in": "path", + "description": "Name of the Container App.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Container App SourceControl.", + "required": true, + "type": "string" + }, + { + "name": "sourceControlEnvelope", + "in": "body", + "description": "Properties used to create a Container App SourceControl", + "required": true, + "schema": { + "$ref": "#/definitions/SourceControl" + } + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "No change performed on the Container App.", + "schema": { + "$ref": "#/definitions/SourceControl" + } + }, + "202": { + "description": "Container App create or update has been started.", + "schema": { + "$ref": "#/definitions/SourceControl" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Create or Update Container App SourceControl": { + "$ref": "./examples/SourceControls_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "ContainerAppsSourceControls" + ], + "summary": "Delete a Container App SourceControl.", + "description": "Description for Delete a Container App SourceControl.", + "operationId": "ContainerAppsSourceControls_Delete", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "containerAppName", + "in": "path", + "description": "Name of the Container App.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the Container App SourceControl.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Container App deleted successfully." + }, + "202": { + "description": "Delete operation is in progress." + }, + "204": { + "description": "Container App SourceControl does not exist." + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete Container App SourceControl": { + "$ref": "./examples/SourceControls_Delete.json" + } + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "SourceControl": { + "description": "Container App SourceControl.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "description": "SourceControl resource specific properties", + "type": "object", + "properties": { + "operationState": { + "description": "Current provisioning State of the operation", + "enum": [ + "InProgress", + "Succeeded", + "Failed", + "Canceled" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "SourceControlOperationState", + "modelAsString": true + } + }, + "repoUrl": { + "format": "string", + "description": "The repo url which will be integrated to ContainerApp.", + "type": "string" + }, + "branch": { + "description": "The branch which will trigger the auto deployment", + "type": "string" + }, + "githubActionConfiguration": { + "$ref": "#/definitions/GithubActionConfiguration", + "description": "Container App Revision Template with all possible settings and the\ndefaults if user did not provide them. The defaults are populated\nas they were at the creation time" + } + }, + "x-ms-client-flatten": true + } + } + }, + "GithubActionConfiguration": { + "description": "Configuration properties that define the mutable settings of a Container App SourceControl", + "type": "object", + "properties": { + "registryInfo": { + "$ref": "#/definitions/RegistryInfo", + "description": "Registry configurations." + }, + "azureCredentials": { + "$ref": "#/definitions/AzureCredentials", + "description": "AzureCredentials configurations." + }, + "dockerfilePath": { + "description": "Docker file path", + "type": "string" + }, + "publishType": { + "description": "Code or Image", + "type": "string" + }, + "Os": { + "description": "Operation system", + "type": "string" + }, + "RuntimeStack": { + "description": "Runtime stack", + "type": "string" + }, + "RuntimeVersion": { + "description": "Runtime Version", + "type": "string" + } + } + }, + "RegistryInfo": { + "description": "Container App registry information.", + "type": "object", + "properties": { + "registryUrl": { + "description": "registry server Url.", + "type": "string" + }, + "registryUserName": { + "description": "registry username.", + "type": "string" + }, + "registryPassword": { + "description": "registry secret.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "x-ms-secret": true + } + } + }, + "AzureCredentials": { + "description": "Container App credentials.", + "type": "object", + "properties": { + "clientId": { + "description": "Client Id.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "x-ms-secret": true + }, + "clientSecret": { + "description": "Client Secret.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "x-ms-secret": true + }, + "tenantId": { + "description": "Tenant Id.", + "type": "string", + "x-ms-mutability": [ + "create", + "update" + ], + "x-ms-secret": true + }, + "subscriptionId": { + "description": "Subscription Id.", + "type": "string" + } + } + } + } +} + \ No newline at end of file diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json new file mode 100644 index 000000000000..3676b221b018 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json @@ -0,0 +1,53 @@ +{ + "parameters": { + "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + "resourceGroupName": "workerapps-rg-xj", + "containerAppName": "testcanadacentral", + "name": "current", + "api-version": "2022-01-01-preview", + "sourceControlEnvelope": { + "properties": { + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "gitHubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg", + "registryPassword": "" + }, + "azureCredentials": { + "clientId": "", + "clientSecret": "", + "tenantId": "" + } + } + } + } + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://localhost/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/currentInOperationModel/operationresults/5a7f31af-8ae5-489b-a67e-f0a2d11df796?api-version=2021-03-01" + }, + "body": { + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", + "name": "current", + "type": "Microsoft.Web/containerapps/sourcecontrols", + "location": "eastus", + "properties": { + "operationState": "InProgress", + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "githubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" + } + } + } + } + }, + "204": {} + } + } \ No newline at end of file diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json new file mode 100644 index 000000000000..aaeb09075e07 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json @@ -0,0 +1,18 @@ +{ + "parameters": { + "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + "resourceGroupName": "workerapps-rg-xj", + "containerAppName": "testcanadacentral", + "name": "current", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": {}, + "202": { + "headers": { + "location": "https://localhost/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/currentInOperationModel/operationresults/14a787ee-c65f-462d-8a8b-897f69a2ab4f?api-version=2021-03-01" + } + }, + "204": {} + } +} \ No newline at end of file diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json new file mode 100644 index 000000000000..0c419caf6675 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + "resourceGroupName": "workerapps-rg-xj", + "containerAppName": "testcanadacentral", + "name": "current", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id":"/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/testcanadacentral/sourcecontrols/current", + "name":"current", + "type":"Microsoft.Web/containerapps/sourcecontrols", + "properties":{ + "repoUrl":"https://github.com/xwang971/ghatest", + "branch":"master", + "githubActionConfiguration":{ + "registryInfo":{ + "registryUrl":"xwang971reg.azurecr.io", + "registryUserName":"xwang971reg" + } + } + } + } + } + } +} + \ No newline at end of file From ecc35a487aa0eac9db8201fa84d4539d621cebed Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 14:08:21 -0800 Subject: [PATCH 2/6] remove space --- .../preview/2022-01-01-preview/SourceControls.json | 3 +-- .../examples/ContainerApps_CreateOrUpdate.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json index f3a32bfc2c7a..8c0c74adce97 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json @@ -353,5 +353,4 @@ } } } -} - \ No newline at end of file +} \ No newline at end of file diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json index 1b05daa84158..70f21a905e28 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json @@ -150,4 +150,4 @@ } } } -} +} \ No newline at end of file From 91fb58d61daf7d9a40db55ef00d1289875083690 Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 15:22:42 -0800 Subject: [PATCH 3/6] prettier fix --- .../2022-01-01-preview/SourceControls.json | 16 +-- .../ContainerApps_CreateOrUpdate.json | 2 +- .../SourceControls_CreateOrUpdate.json | 97 +++++++++++-------- .../examples/SourceControls_Delete.json | 2 +- .../examples/SourceControls_Get.json | 21 ++-- 5 files changed, 75 insertions(+), 63 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json index 8c0c74adce97..ced738526d12 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json @@ -75,7 +75,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -142,7 +142,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -198,7 +198,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -308,8 +308,8 @@ "description": "registry secret.", "type": "string", "x-ms-mutability": [ - "create", - "update" + "create", + "update" ], "x-ms-secret": true } @@ -341,8 +341,8 @@ "description": "Tenant Id.", "type": "string", "x-ms-mutability": [ - "create", - "update" + "create", + "update" ], "x-ms-secret": true }, @@ -353,4 +353,4 @@ } } } -} \ No newline at end of file +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json index 70f21a905e28..1b05daa84158 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json @@ -150,4 +150,4 @@ } } } -} \ No newline at end of file +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json index 3676b221b018..bc91c7cde881 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json @@ -1,53 +1,66 @@ { - "parameters": { - "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", - "resourceGroupName": "workerapps-rg-xj", - "containerAppName": "testcanadacentral", + "parameters": { + "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + "resourceGroupName": "workerapps-rg-xj", + "containerAppName": "testcanadacentral", + "name": "current", + "api-version": "2022-01-01-preview", + "sourceControlEnvelope": { + "properties": { + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "gitHubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg", + "registryPassword": "" + }, + "azureCredentials": { + "clientId": "", + "clientSecret": "", + "tenantId": "" + } + } + } + } + }, + "responses": { + "200": { + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", "name": "current", - "api-version": "2022-01-01-preview", - "sourceControlEnvelope": { + "type": "Microsoft.Web/containerapps/sourcecontrols", + "properties": { + "operationState": "InProgress", + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "githubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" + } + } + } + }, + "202": { + "headers": { + "location": "https://localhost/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/currentInOperationModel/operationresults/5a7f31af-8ae5-489b-a67e-f0a2d11df796?api-version=2021-03-01" + }, + "body": { + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", + "name": "current", + "type": "Microsoft.Web/containerapps/sourcecontrols", "properties": { + "operationState": "InProgress", "repoUrl": "https://github.com/xwang971/ghatest", "branch": "master", - "gitHubActionConfiguration": { + "githubActionConfiguration": { "registryInfo": { - "registryUrl": "xwang971reg.azurecr.io", - "registryUserName": "xwang971reg", - "registryPassword": "" - }, - "azureCredentials": { - "clientId": "", - "clientSecret": "", - "tenantId": "" + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" } } } } - }, - "responses": { - "200": {}, - "202": { - "headers": { - "location": "https://localhost/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/currentInOperationModel/operationresults/5a7f31af-8ae5-489b-a67e-f0a2d11df796?api-version=2021-03-01" - }, - "body": { - "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", - "name": "current", - "type": "Microsoft.Web/containerapps/sourcecontrols", - "location": "eastus", - "properties": { - "operationState": "InProgress", - "repoUrl": "https://github.com/xwang971/ghatest", - "branch": "master", - "githubActionConfiguration": { - "registryInfo": { - "registryUrl": "xwang971reg.azurecr.io", - "registryUserName": "xwang971reg" - } - } - } - } - }, - "204": {} } - } \ No newline at end of file + } +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json index aaeb09075e07..ace88cd670fb 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Delete.json @@ -15,4 +15,4 @@ }, "204": {} } -} \ No newline at end of file +} diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json index 0c419caf6675..1d46a8fbb3c2 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_Get.json @@ -10,16 +10,16 @@ "200": { "headers": {}, "body": { - "id":"/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/testcanadacentral/sourcecontrols/current", - "name":"current", - "type":"Microsoft.Web/containerapps/sourcecontrols", - "properties":{ - "repoUrl":"https://github.com/xwang971/ghatest", - "branch":"master", - "githubActionConfiguration":{ - "registryInfo":{ - "registryUrl":"xwang971reg.azurecr.io", - "registryUserName":"xwang971reg" + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/testcanadacentral/sourcecontrols/current", + "name": "current", + "type": "Microsoft.Web/containerapps/sourcecontrols", + "properties": { + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "githubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" } } } @@ -27,4 +27,3 @@ } } } - \ No newline at end of file From dd4e2e8d4c676a26daed55845fe7aa7f24198bbd Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 15:24:43 -0800 Subject: [PATCH 4/6] typo --- .../examples/SourceControls_CreateOrUpdate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json index bc91c7cde881..d2ec1edf051a 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json @@ -9,7 +9,7 @@ "properties": { "repoUrl": "https://github.com/xwang971/ghatest", "branch": "master", - "gitHubActionConfiguration": { + "githubActionConfiguration": { "registryInfo": { "registryUrl": "xwang971reg.azurecr.io", "registryUserName": "xwang971reg", From 8185b6c271178cc11022b671f3853376eac7f158 Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 15:35:25 -0800 Subject: [PATCH 5/6] avocado fix --- .../SourceControls_CreateOrUpdate.json | 25 +++++++++++-------- specification/app/resource-manager/readme.md | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json index d2ec1edf051a..c8122586ee42 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json @@ -26,17 +26,20 @@ }, "responses": { "200": { - "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", - "name": "current", - "type": "Microsoft.Web/containerapps/sourcecontrols", - "properties": { - "operationState": "InProgress", - "repoUrl": "https://github.com/xwang971/ghatest", - "branch": "master", - "githubActionConfiguration": { - "registryInfo": { - "registryUrl": "xwang971reg.azurecr.io", - "registryUserName": "xwang971reg" + "headers": {}, + "body": { + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/myapp/sourcecontrols/current", + "name": "current", + "type": "Microsoft.Web/containerapps/sourcecontrols", + "properties": { + "operationState": "InProgress", + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "githubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" + } } } } diff --git a/specification/app/resource-manager/readme.md b/specification/app/resource-manager/readme.md index f841aa182a04..f04ff08b1950 100644 --- a/specification/app/resource-manager/readme.md +++ b/specification/app/resource-manager/readme.md @@ -40,6 +40,7 @@ input-file: - Microsoft.App/preview/2022-01-01-preview/ContainerAppsRevisions.json - 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 directive: - suppress: R4009 from: ContainerAppsRevisions.json From 47a3f5664763c1528a09d7df1debbaffe713390b Mon Sep 17 00:00:00 2001 From: xwang971 Date: Fri, 7 Jan 2022 16:04:20 -0800 Subject: [PATCH 6/6] lint fix --- .../2022-01-01-preview/SourceControls.json | 77 ++++++++++++++++++- .../SourceControls_ListByContainer.json | 33 ++++++++ 2 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json index ced738526d12..22609175c0da 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/SourceControls.json @@ -33,6 +33,55 @@ } }, "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols": { + "get": { + "tags": [ + "ContainerAppsSourceControls" + ], + "summary": "Get the Container App SourceControls in a given resource group.", + "operationId": "ContainerAppsSourceControls_ListByContainerApp", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "containerAppName", + "in": "path", + "description": "Name of the Container App.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SourceControlCollection" + } + }, + "default": { + "description": "Common error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "List Container Apps by resource group": { + "$ref": "./examples/SourceControls_ListByContainer.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{name}": { "get": { "tags": [ @@ -241,7 +290,6 @@ } }, "repoUrl": { - "format": "string", "description": "The repo url which will be integrated to ContainerApp.", "type": "string" }, @@ -278,15 +326,15 @@ "description": "Code or Image", "type": "string" }, - "Os": { + "os": { "description": "Operation system", "type": "string" }, - "RuntimeStack": { + "runtimeStack": { "description": "Runtime stack", "type": "string" }, - "RuntimeVersion": { + "runtimeVersion": { "description": "Runtime Version", "type": "string" } @@ -351,6 +399,27 @@ "type": "string" } } + }, + "SourceControlCollection": { + "description": "SourceControl collection ARM resource.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of resources.", + "type": "array", + "items": { + "$ref": "#/definitions/SourceControl" + } + }, + "nextLink": { + "description": "Link to next page of resources.", + "type": "string", + "readOnly": true + } + } } } } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json new file mode 100644 index 000000000000..12aee52b656b --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_ListByContainer.json @@ -0,0 +1,33 @@ +{ + "parameters": { + "subscriptionId": "651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + "resourceGroupName": "workerapps-rg-xj", + "containerAppName": "testcanadacentral", + "api-version": "2022-01-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.Web/containerApps/testcanadacentral/sourcecontrols/current", + "name": "current", + "type": "Microsoft.Web/containerapps/sourcecontrols", + "properties": { + "repoUrl": "https://github.com/xwang971/ghatest", + "branch": "master", + "githubActionConfiguration": { + "registryInfo": { + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg" + } + } + } + } + ], + "nextLink": null + } + } + } +}