From bcb8a796c65247d463cef90c1af81fb11cd2d61d Mon Sep 17 00:00:00 2001 From: Zijian Ju Date: Tue, 23 May 2023 15:51:13 +0800 Subject: [PATCH 1/5] Fix lint issue --- .../2023-04-01-preview/ContainerApps.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json index 0fa2cabadeee..d436dcfac7fb 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json @@ -512,7 +512,10 @@ ], "responses": { "200": { - "description": "Container App started successfully." + "description": "Container App started successfully.", + "schema": { + "$ref": "#/definitions/ContainerApp" + } }, "202": { "description": "Start operation is in progress.", @@ -525,8 +528,8 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" - } + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + }} } }, "x-ms-examples": { @@ -568,7 +571,10 @@ ], "responses": { "200": { - "description": "Container App stopped successfully." + "description": "Container App stopped successfully.", + "schema": { + "$ref": "#/definitions/ContainerApp" + } }, "202": { "description": "Stop operation is in progress.", @@ -581,7 +587,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, From 7b49bc0e46d9467dd30ceeacc20fa985eb68c331 Mon Sep 17 00:00:00 2001 From: Zijian Ju Date: Tue, 23 May 2023 16:07:14 +0800 Subject: [PATCH 2/5] Fix format issue --- .../Microsoft.App/preview/2023-04-01-preview/ContainerApps.json | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json index d436dcfac7fb..ab71a486a477 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json @@ -541,7 +541,6 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" } - } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop": { "post": { From cdbe9db418aef0754665491ac76d59119e902de7 Mon Sep 17 00:00:00 2001 From: Zijian Ju Date: Tue, 23 May 2023 16:11:15 +0800 Subject: [PATCH 3/5] Fix json format issue --- .../preview/2023-04-01-preview/ContainerApps.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json index ab71a486a477..9586f9b35b23 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json @@ -529,7 +529,7 @@ "description": "Common error response.", "schema": { "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" - }} + } } }, "x-ms-examples": { @@ -541,6 +541,7 @@ "x-ms-long-running-operation-options": { "final-state-via": "location" } + } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop": { "post": { From dbd106bde05975dd8dda37d900e98d297364fe5e Mon Sep 17 00:00:00 2001 From: Zijian Ju Date: Tue, 23 May 2023 16:21:34 +0800 Subject: [PATCH 4/5] Fix model validation --- .../examples/ContainerApps_Start.json | 109 +++++++++++++++++- .../examples/ContainerApps_Stop.json | 109 +++++++++++++++++- 2 files changed, 216 insertions(+), 2 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Start.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Start.json index e004baa6c7d7..31a2bf5629c8 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Start.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Start.json @@ -6,7 +6,114 @@ "api-version": "2023-04-01-preview" }, "responses": { - "200": {}, + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0", + "name": "testcontainerApp0", + "type": "Microsoft.App/containerApps", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "workloadProfileName": "My-GP-01", + "latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io", + "latestReadyRevisionName": "testcontainerApp0-pjxhsye", + "configuration": { + "ingress": { + "fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io", + "external": true, + "targetPort": 3000, + "transport": "auto", + "customDomains": [ + { + "name": "www.my-name.com", + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" + }, + { + "name": "www.my--other-name.com", + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" + } + ], + "traffic": [ + { + "weight": 80, + "revisionName": "testcontainerApp0-ab1234" + }, + { + "weight": 20, + "revisionName": "testcontainerApp0-ab4321", + "label": "staging" + } + ], + "ipSecurityRestrictions": [ + { + "name": "Allow work IP A subnet", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/32", + "action": "Allow" + }, + { + "name": "Allow work IP B subnet", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/8", + "action": "Allow" + } + ] + }, + "dapr": { + "enabled": true, + "appPort": 3000, + "appProtocol": "http", + "httpReadBufferSize": 30, + "httpMaxRequestSize": 10, + "logLevel": "debug", + "enableApiLogging": true + }, + "maxInactiveRevisions": 10 + }, + "template": { + "containers": [ + { + "image": "repo/testcontainerApp0:v4", + "name": "testcontainerApp0", + "resources": { + "cpu": 0.2, + "memory": "100Mi" + } + } + ], + "initContainers": [ + { + "image": "repo/testcontainerApp0:v4", + "name": "testinitcontainerApp0", + "resources": { + "cpu": 0.2, + "memory": "100Mi" + } + } + ], + "scale": { + "minReplicas": 1, + "maxReplicas": 5, + "rules": [ + { + "name": "httpscalingrule", + "http": { + "metadata": { + "concurrentRequests": "50" + } + } + } + ] + } + }, + "eventStreamEndpoint": "testEndpoint" + } + } + }, "202": { "headers": { "location": "https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/containerApps/testWorkerApp0/operationResults/62e4d893-d233-4005-988e-a428d9f77076?api-version=2023-04-01-preview" diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Stop.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Stop.json index e004baa6c7d7..31a2bf5629c8 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Stop.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/examples/ContainerApps_Stop.json @@ -6,7 +6,114 @@ "api-version": "2023-04-01-preview" }, "responses": { - "200": {}, + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0", + "name": "testcontainerApp0", + "type": "Microsoft.App/containerApps", + "location": "East US", + "properties": { + "provisioningState": "Succeeded", + "managedEnvironmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "workloadProfileName": "My-GP-01", + "latestRevisionFqdn": "testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io", + "latestReadyRevisionName": "testcontainerApp0-pjxhsye", + "configuration": { + "ingress": { + "fqdn": "testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io", + "external": true, + "targetPort": 3000, + "transport": "auto", + "customDomains": [ + { + "name": "www.my-name.com", + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com" + }, + { + "name": "www.my--other-name.com", + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com" + } + ], + "traffic": [ + { + "weight": 80, + "revisionName": "testcontainerApp0-ab1234" + }, + { + "weight": 20, + "revisionName": "testcontainerApp0-ab4321", + "label": "staging" + } + ], + "ipSecurityRestrictions": [ + { + "name": "Allow work IP A subnet", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/32", + "action": "Allow" + }, + { + "name": "Allow work IP B subnet", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/8", + "action": "Allow" + } + ] + }, + "dapr": { + "enabled": true, + "appPort": 3000, + "appProtocol": "http", + "httpReadBufferSize": 30, + "httpMaxRequestSize": 10, + "logLevel": "debug", + "enableApiLogging": true + }, + "maxInactiveRevisions": 10 + }, + "template": { + "containers": [ + { + "image": "repo/testcontainerApp0:v4", + "name": "testcontainerApp0", + "resources": { + "cpu": 0.2, + "memory": "100Mi" + } + } + ], + "initContainers": [ + { + "image": "repo/testcontainerApp0:v4", + "name": "testinitcontainerApp0", + "resources": { + "cpu": 0.2, + "memory": "100Mi" + } + } + ], + "scale": { + "minReplicas": 1, + "maxReplicas": 5, + "rules": [ + { + "name": "httpscalingrule", + "http": { + "metadata": { + "concurrentRequests": "50" + } + } + } + ] + } + }, + "eventStreamEndpoint": "testEndpoint" + } + } + }, "202": { "headers": { "location": "https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/containerApps/testWorkerApp0/operationResults/62e4d893-d233-4005-988e-a428d9f77076?api-version=2023-04-01-preview" From 7690350eeab865a9731b4b71c2d9b29e58dbad0b Mon Sep 17 00:00:00 2001 From: Zijian Ju Date: Wed, 24 May 2023 15:23:45 +0800 Subject: [PATCH 5/5] Fix lint error --- .../preview/2023-04-01-preview/ContainerApps.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json index 9586f9b35b23..35c9116c92a8 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/ContainerApps.json @@ -528,7 +528,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -587,7 +587,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } },