diff --git a/azure-cli-extensions.pyproj b/azure-cli-extensions.pyproj index 97b8809839b..f0b0aca658c 100644 --- a/azure-cli-extensions.pyproj +++ b/azure-cli-extensions.pyproj @@ -11,6 +11,7 @@ . {888888a0-9f3d-457c-b088-3a5042f75d52} Standard Python launcher + true @@ -2805,6 +2806,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4615,6 +4697,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4758,6 +4886,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/spring-cloud/HISTORY.rst b/src/spring-cloud/HISTORY.md similarity index 78% rename from src/spring-cloud/HISTORY.rst rename to src/spring-cloud/HISTORY.md index fb8dea2f498..719bc65fc83 100644 --- a/src/spring-cloud/HISTORY.rst +++ b/src/spring-cloud/HISTORY.md @@ -1,28 +1,30 @@ -.. :changelog: - -Release History -=============== - -0.2.2 -++++++ -* Remove the limitation of max compatible cli core version - -0.2.1 -++++++ -* Add command "az spring-cloud app logs" to replace "az spring-cloud app log tail" for log streaming. -* "az spring-cloud app log tail" will be deprecated in a future release -* Fix Python 3 and Python 2 compatible issues. - -0.2.0 -++++++ -* Support the log streaming feature. -* Add command for log streaming: az spring-cloud app log tail. - -0.1.1 -++++++ -* Improve the verbosity for the long running commands. -* Refine the descriptions and error messages for the command. - -0.1.0 -++++++ +Release History +=============== + +0.2.3 +----- +* Add command "az spring-cloud app custom-domain" and "az spring-cloud certificate" to support Custom Domain feature. + +0.2.2 +----- +* Remove the limitation of max compatible cli core version + +0.2.1 +----- +* Add command "az spring-cloud app logs" to replace "az spring-cloud app log tail" for log streaming. +* "az spring-cloud app log tail" will be deprecated in a future release +* Fix Python 3 and Python 2 compatible issues. + +0.2.0 +----- +* Support the log streaming feature. +* Add command for log streaming: az spring-cloud app log tail. + +0.1.1 +----- +* Improve the verbosity for the long running commands. +* Refine the descriptions and error messages for the command. + +0.1.0 +----- * Initial release. \ No newline at end of file diff --git a/src/spring-cloud/README.md b/src/spring-cloud/README.md new file mode 100644 index 00000000000..e1668577131 --- /dev/null +++ b/src/spring-cloud/README.md @@ -0,0 +1,21 @@ +Microsoft Azure CLI 'spring-cloud' Extension +========================================== + +This package is for the 'spring-cloud' extension. +i.e. 'az spring-cloud' + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name spring-cloud +``` + +### Sample Commands ### +Create a service and not wait +``` +az spring-cloud create -n --no-wait +``` +Create a green deployment with default configuration +``` +az spring-cloud app deployment create --app -n --jar-path +``` \ No newline at end of file diff --git a/src/spring-cloud/README.rst b/src/spring-cloud/README.rst deleted file mode 100644 index 0e0f83afb00..00000000000 --- a/src/spring-cloud/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'spring-cloud' Extension -========================================== - -This package is for the 'spring-cloud' extension. -i.e. 'az spring-cloud' \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index fa531ebad22..77ce5e7669c 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -30,3 +30,11 @@ def cf_deployments(cli_ctx, *_): def cf_bindings(cli_ctx, *_): return cf_spring_cloud(cli_ctx).bindings + + +def cf_certificates(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).certificates + + +def cf_custom_domains(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).custom_domains diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 73a6cb8123a..3fde2366504 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -316,3 +316,73 @@ type: command short-summary: Update an Azure Cache for Redis service binding of the app. """ + +helps['spring-cloud certificate'] = """ + type: group + short-summary: Commands to manage certificates. +""" + +helps['spring-cloud certificate add'] = """ + type: command + short-summary: Add a certificate in Azure Spring Cloud. + examples: + - name: Import certificate from key vault. + text: az spring-cloud certificate add --name MyCertName --vault-uri MyKeyVaultUri --vault-certificate-name MyKeyVaultCertName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud certificate show'] = """ + type: command + short-summary: Show a certificate in Azure Spring Cloud. +""" + +helps['spring-cloud certificate list'] = """ + type: command + short-summary: List all certificates in Azure Spring Cloud. + examples: + - name: List all certificates in spring cloud service. + text: az spring-cloud certificate list --service MyCluster --resource-group MyResourceGroup -o table +""" + +helps['spring-cloud certificate remove'] = """ + type: command + short-summary: Remove a certificate in Azure Spring Cloud. +""" + +helps['spring-cloud app custom-domain'] = """ + type: group + short-summary: Commands to manage custom domains. +""" + +helps['spring-cloud app custom-domain bind'] = """ + type: command + short-summary: Bind a custom domain with the app. + examples: + - name: Bind a custom domain to app. + text: az spring-cloud app custom-domain bind --domain-name MyDomainName --certificate MyCertName --app MyAppName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud app custom-domain show'] = """ + type: command + short-summary: Show details of a custom domain. +""" + +helps['spring-cloud app custom-domain list'] = """ + type: command + short-summary: List all custom domains of the app. + examples: + - name: List all custom domains of the app. + text: az spring-cloud app custom-domain list --app MyAppName --service MyCluster --resource-group MyResourceGroup -o table +""" + +helps['spring-cloud app custom-domain update'] = """ + type: command + short-summary: Update a custom domain of the app. + examples: + - name: Bind custom domain with a specified certificate. + text: az spring-cloud app custom-domain update --domain-name MyDomainName --certificate MCertName --app MyAppName --service MyCluster --resource-group MyResourceGroup +""" + +helps['spring-cloud app custom-domain unbind'] = """ + type: command + short-summary: Unbind a custom-domain of the app. +""" diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 4fdbd766155..e3c57b5063c 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -47,8 +47,8 @@ def load_arguments(self, _): 'is_public', arg_type=get_three_state_flag(), help='If true, assign public domain', default=False) with self.argument_context('spring-cloud app update') as c: - c.argument('is_public', arg_type=get_three_state_flag(), - help='If true, assign public domain') + c.argument('is_public', arg_type=get_three_state_flag(), help='If true, assign endpoint') + c.argument('https_only', arg_type=get_three_state_flag(), help='If true, access app via https', default=False) for scope in ['spring-cloud app update', 'spring-cloud app start', 'spring-cloud app stop', 'spring-cloud app restart', 'spring-cloud app deploy', 'spring-cloud app scale', 'spring-cloud app set-deployment', 'spring-cloud app show-deploy-log']: with self.argument_context(scope) as c: @@ -190,3 +190,22 @@ def load_arguments(self, _): validator=validate_app_name) c.argument('deployment', options_list=[ '--deployment', '-d'], help='Name of an existing deployment of the app. Default to the production deployment if not specified.', validator=validate_deployment_name) + + with self.argument_context('spring-cloud certificate') as c: + c.argument('service', service_name_type) + c.argument('name', name_type, help='Name of certificate.') + + with self.argument_context('spring-cloud certificate add') as c: + c.argument('vault_uri', help='The key vault uri where store the certificate') + c.argument('vault_certificate_name', help='The certificate name in key vault') + + with self.argument_context('spring-cloud app custom-domain') as c: + c.argument('service', service_name_type) + c.argument('app', app_name_type, help='Name of app.', validator=validate_app_name) + c.argument('domain_name', help='Name of custom domain.') + + with self.argument_context('spring-cloud app custom-domain bind') as c: + c.argument('certificate', type=str, help='Certificate name in Azure Spring Cloud.') + + with self.argument_context('spring-cloud app custom-domain update') as c: + c.argument('certificate', help='Certificate name in Azure Spring Cloud.') diff --git a/src/spring-cloud/azext_spring_cloud/_transformers.py b/src/spring-cloud/azext_spring_cloud/_transformers.py index c18153bbd69..c9ac8bbfb7b 100644 --- a/src/spring-cloud/azext_spring_cloud/_transformers.py +++ b/src/spring-cloud/azext_spring_cloud/_transformers.py @@ -76,3 +76,35 @@ def transform_spring_cloud_deployment_output(result): item['Registered Instance'] = "{}/{}".format(up_number, instance_count) if isStarted else "Stopped" return result if is_list else result[0] + + +def transform_spring_cloud_certificate_output(result): + is_list = isinstance(result, list) + + if not is_list: + result = [result] + + for item in result: + item['Certificate Name'] = item['properties']['keyVaultCertName'] + item['Thumbprint'] = item['properties']['thumbprint'] + item['Activate Date'] = item['properties']['activateDate'].split("T")[0] + item['Certificate Version'] = item['properties']['certVersion'] + item['DNS Names'] = item['properties']['dnsNames'] + item['Expiration Date'] = item['properties']['expirationDate'].split("T")[0] + item['Key Vault Uri'] = item['properties']['vaultUri'] + + return result if is_list else result[0] + + +def transform_spring_cloud_custom_domain_output(result): + is_list = isinstance(result, list) + + if not is_list: + result = [result] + + for item in result: + item['App Name'] = item['properties']["appName"] + item['Certificate Name'] = item['properties']['certName'] + item['Thumbprint'] = item['properties']['thumbprint'] + + return result if is_list else result[0] diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index c12e7b55564..b1080757170 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -6,7 +6,10 @@ # pylint: disable=line-too-long from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings) from ._transformers import (transform_spring_cloud_table_output, - transform_app_table_output, transform_spring_cloud_deployment_output) + transform_app_table_output, + transform_spring_cloud_deployment_output, + transform_spring_cloud_certificate_output, + transform_spring_cloud_custom_domain_output) # pylint: disable=too-many-statements @@ -81,5 +84,18 @@ def load_command_table(self, _): g.custom_command('redis update', 'binding_redis_update') g.custom_show_command('remove', 'binding_remove') + with self.command_group('spring-cloud certificate', client_factory=cf_spring_cloud) as g: + g.custom_command('add', 'certificate_add') + g.custom_show_command('show', 'certificate_show', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('list', 'certificate_list', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('remove', 'certificate_remove') + + with self.command_group('spring-cloud app custom-domain', client_factory=cf_spring_cloud) as g: + g.custom_command('bind', 'domain_bind') + g.custom_show_command('show', 'domain_show', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('list', 'domain_list', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('update', 'domain_update') + g.custom_command('unbind', 'domain_unbind') + with self.command_group('spring-cloud', is_preview=True): pass diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index d9ec9d24ce4..a9862f333af 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -167,8 +167,9 @@ def app_update(cmd, client, resource_group, service, name, runtime_version=None, jvm_options=None, env=None, - enable_persistent_storage=None): - properties = models.AppResourceProperties(public=is_public) + enable_persistent_storage=None, + https_only=None): + properties = models.AppResourceProperties(public=is_public, https_only=https_only) if enable_persistent_storage is True: properties.persistent_disk = models.PersistentDisk( size_in_gb=50, mount_path="/persistent") @@ -1087,3 +1088,63 @@ def stream(self, amt=2 ** 16, decode_content=None): response.release_conn() except CLIError as e: exceptions.append(e) + + +def certificate_add(cmd, client, resource_group, service, name, vault_uri, vault_certificate_name): + properties = models.CertificateProperties( + vault_uri=vault_uri, + key_vault_cert_name=vault_certificate_name + ) + return client.certificates.create_or_update(resource_group, service, name, properties) + + +def certificate_show(cmd, client, resource_group, service, name): + return client.certificates.get(resource_group, service, name) + + +def certificate_list(cmd, client, resource_group, service): + return client.certificates.list(resource_group, service) + + +def certificate_remove(cmd, client, resource_group, service, name): + client.certificates.get(resource_group, service, name) + return client.certificates.delete(resource_group, service, name) + + +def domain_bind(cmd, client, resource_group, service, app, + domain_name, + certificate=None): + properties = models.CustomDomainProperties() + if certificate is not None: + certificate_response = client.certificates.get(resource_group, service, certificate) + properties = models.CustomDomainProperties( + thumbprint=certificate_response.properties.thumbprint, + cert_name=certificate + ) + return client.custom_domains.create_or_update(resource_group, service, app, domain_name, properties) + + +def domain_show(cmd, client, resource_group, service, app, domain_name): + return client.custom_domains.get(resource_group, service, app, domain_name) + + +def domain_list(cmd, client, resource_group, service, app): + return client.custom_domains.list(resource_group, service, app) + + +def domain_update(cmd, client, resource_group, service, app, + domain_name, + certificate=None): + properties = models.CustomDomainProperties() + if certificate is not None: + certificate_response = client.certificates.get(resource_group, service, certificate) + properties = models.CustomDomainProperties( + thumbprint=certificate_response.properties.thumbprint, + cert_name=certificate + ) + return client.custom_domains.create_or_update(resource_group, service, app, domain_name, properties) + + +def domain_unbind(cmd, client, resource_group, service, app, domain_name): + client.custom_domains.get(resource_group, service, app, domain_name) + return client.custom_domains.delete(resource_group, service, app, domain_name) diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml new file mode 100644 index 00000000000..836cff0af32 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml @@ -0,0 +1,728 @@ +interactions: +- request: + body: '{"properties": {"vaultUri": "https://integration-test-prod.vault.azure.net/", + "keyVaultCertName": "cli-unittest"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate add + Connection: + - keep-alive + Content-Length: + - '114' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --name --vault-uri --vault-certificate-name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate list + Connection: + - keep-alive + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates?api-version=2019-05-01-preview + response: + body: + string: '{"value":[{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}]}' + headers: + cache-control: + - no-cache + content-length: + - '636' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: '{"properties": {}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain bind + Connection: + - keep-alive + Content-Length: + - '18' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '283' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:43 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain show + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '283' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:44 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain list + Connection: + - keep-alive + ParameterSetName: + - --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains?api-version=2019-05-01-preview + response: + body: + string: '{"value":[{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}]}' + headers: + cache-control: + - no-cache + content-length: + - '295' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:46 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain update + Connection: + - keep-alive + ParameterSetName: + - --domain-name --certificate --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: '{"properties": {"thumbprint": "839dbe007ebc9aeb7150d58b1474dd955e684f18", + "certName": "test-cert"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain update + Connection: + - keep-alive + Content-Length: + - '99' + Content-Type: + - application/json; charset=utf-8 + ParameterSetName: + - --domain-name --certificate --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '362' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain unbind + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' + headers: + cache-control: + - no-cache + content-length: + - '362' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain unbind + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 08 May 2020 05:02:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud app custom-domain show + Connection: + - keep-alive + ParameterSetName: + - --domain-name --app -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + response: + body: + string: '{"error":{"code":"EntityNotFound","message":"CustomDomain with name + ''cli.asc-test.net'' not found","target":null,"details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '128' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate remove + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' + headers: + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate remove + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 08 May 2020 05:02:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - spring-cloud certificate show + Connection: + - keep-alive + ParameterSetName: + - --name -g -s + User-Agent: + - python/3.8.1 (Windows-10-10.0.18362-SP0) msrest/0.6.11 msrest_azure/0.6.3 + azure-mgmt-appplatform/0.1.0 Azure-SDK-For-Python AZURECLI/2.5.0 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + response: + body: + string: '{"error":{"code":"EntityNotFound","message":"CertificateName ''test-cert'' + not found","target":null,"details":null}}' + headers: + cache-control: + - no-cache + content-length: + - '114' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 08 May 2020 05:02:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx/1.17.7 + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-rp-server-mvid: + - afbe1e12-8584-4dc5-aa1e-547e4b04d8ae + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py index eb45ceb0a72..1a3ba0d6a89 100644 --- a/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/test_asc_scenario.py @@ -6,8 +6,61 @@ import os import unittest +from knack.util import CLIError from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) +# pylint: disable=line-too-long +# pylint: disable=too-many-lines TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +@record_only() +class CustomDomainTests(ScenarioTest): + + def test_bind_cert_to_domain(self): + self.kwargs.update({ + 'cert': 'test-cert', + 'keyVaultUri': 'https://integration-test-prod.vault.azure.net/', + 'KeyVaultCertName': 'cli-unittest', + 'domain': 'cli.asc-test.net', + 'app': 'test-app', + 'serviceName': 'cli-unittest', + 'rg': 'cli' + }) + + self.cmd('spring-cloud certificate add --name {cert} --vault-uri {keyVaultUri} --vault-certificate-name {KeyVaultCertName} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{cert}') + ]) + + self.cmd('spring-cloud certificate show --name {cert} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{cert}') + ]) + + result = self.cmd('spring-cloud certificate list -g {rg} -s {serviceName}').get_output_in_json() + self.assertTrue(len(result) > 0) + + self.cmd('spring-cloud app custom-domain bind --domain-name {domain} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}') + ]) + + self.cmd('spring-cloud app custom-domain show --domain-name {domain} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}'), + self.check('properties.appName', '{app}') + ]) + + result = self.cmd('spring-cloud app custom-domain list --app {app} -g {rg} -s {serviceName}').get_output_in_json() + self.assertTrue(len(result) > 0) + + self.cmd('spring-cloud app custom-domain update --domain-name {domain} --certificate {cert} --app {app} -g {rg} -s {serviceName}', checks=[ + self.check('name', '{domain}'), + self.check('properties.appName', '{app}'), + self.check('properties.certName', '{cert}') + ]) + + self.cmd('spring-cloud app custom-domain unbind --domain-name {domain} --app {app} -g {rg} -s {serviceName}') + self.cmd('spring-cloud app custom-domain show --domain-name {domain} --app {app} -g {rg} -s {serviceName}', expect_failure=True) + + self.cmd('spring-cloud certificate remove --name {cert} -g {rg} -s {serviceName}') + self.cmd('spring-cloud certificate show --name {cert} -g {rg} -s {serviceName}', expect_failure=True) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py index 7183870ee56..0260537a02b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/__init__.py @@ -1,6 +1 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - __path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py index 176133a5f29..6081e8e91e6 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/_app_platform_management_client.py @@ -16,6 +16,8 @@ from .operations import ServicesOperations from .operations import AppsOperations from .operations import BindingsOperations +from .operations import CertificatesOperations +from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations from . import models @@ -33,6 +35,10 @@ class AppPlatformManagementClient(SDKClient): :vartype apps: azure.mgmt.appplatform.operations.AppsOperations :ivar bindings: Bindings operations :vartype bindings: azure.mgmt.appplatform.operations.BindingsOperations + :ivar certificates: Certificates operations + :vartype certificates: azure.mgmt.appplatform.operations.CertificatesOperations + :ivar custom_domains: CustomDomains operations + :vartype custom_domains: azure.mgmt.appplatform.operations.CustomDomainsOperations :ivar deployments: Deployments operations :vartype deployments: azure.mgmt.appplatform.operations.DeploymentsOperations :ivar operations: Operations operations @@ -65,6 +71,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.bindings = BindingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.certificates = CertificatesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.custom_domains = CustomDomainsOperations( + self._client, self.config, self._serialize, self._deserialize) self.deployments = DeploymentsOperations( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py index 64b07494a26..128d3f0f9e5 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py @@ -14,10 +14,16 @@ from ._models_py3 import AppResourceProperties from ._models_py3 import BindingResource from ._models_py3 import BindingResourceProperties + from ._models_py3 import CertificateProperties + from ._models_py3 import CertificateResource from ._models_py3 import ClusterResourceProperties from ._models_py3 import ConfigServerGitProperty from ._models_py3 import ConfigServerProperties from ._models_py3 import ConfigServerSettings + from ._models_py3 import CustomDomainProperties + from ._models_py3 import CustomDomainResource + from ._models_py3 import CustomDomainValidatePayload + from ._models_py3 import CustomDomainValidateResult from ._models_py3 import DeploymentInstance from ._models_py3 import DeploymentResource from ._models_py3 import DeploymentResourceProperties @@ -50,10 +56,16 @@ from ._models import AppResourceProperties from ._models import BindingResource from ._models import BindingResourceProperties + from ._models import CertificateProperties + from ._models import CertificateResource from ._models import ClusterResourceProperties from ._models import ConfigServerGitProperty from ._models import ConfigServerProperties from ._models import ConfigServerSettings + from ._models import CustomDomainProperties + from ._models import CustomDomainResource + from ._models import CustomDomainValidatePayload + from ._models import CustomDomainValidateResult from ._models import DeploymentInstance from ._models import DeploymentResource from ._models import DeploymentResourceProperties @@ -83,6 +95,8 @@ from ._models import UserSourceInfo from ._paged_models import AppResourcePaged from ._paged_models import BindingResourcePaged +from ._paged_models import CertificateResourcePaged +from ._paged_models import CustomDomainResourcePaged from ._paged_models import DeploymentResourcePaged from ._paged_models import OperationDetailPaged from ._paged_models import ServiceResourcePaged @@ -103,10 +117,16 @@ 'AppResourceProperties', 'BindingResource', 'BindingResourceProperties', + 'CertificateProperties', + 'CertificateResource', 'ClusterResourceProperties', 'ConfigServerGitProperty', 'ConfigServerProperties', 'ConfigServerSettings', + 'CustomDomainProperties', + 'CustomDomainResource', + 'CustomDomainValidatePayload', + 'CustomDomainValidateResult', 'DeploymentInstance', 'DeploymentResource', 'DeploymentResourceProperties', @@ -137,6 +157,8 @@ 'ServiceResourcePaged', 'AppResourcePaged', 'BindingResourcePaged', + 'CertificateResourcePaged', + 'CustomDomainResourcePaged', 'DeploymentResourcePaged', 'OperationDetailPaged', 'ProvisioningState', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py index bc4fe4abbe8..7fee53fad61 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py @@ -132,6 +132,10 @@ class AppResourceProperties(Model): ~azure.mgmt.appplatform.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -151,6 +155,8 @@ class AppResourceProperties(Model): 'url': {'key': 'url', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, @@ -162,6 +168,8 @@ def __init__(self, **kwargs): self.url = None self.provisioning_state = None self.active_deployment_name = kwargs.get('active_deployment_name', None) + self.fqdn = kwargs.get('fqdn', None) + self.https_only = kwargs.get('https_only', None) self.created_time = None self.temporary_disk = kwargs.get('temporary_disk', None) self.persistent_disk = kwargs.get('persistent_disk', None) @@ -256,6 +264,99 @@ def __init__(self, **kwargs): self.updated_at = None +class CertificateProperties(Model): + """Certificate resource payload. + + All required parameters must be populated in order to send to Azure. + + :param thumbprint: The thumbprint of certificate. + :type thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :param issuer: The issuer of certificate. + :type issuer: str + :param issued_date: The issue date of certificate. + :type issued_date: str + :param expiration_date: The expiration date of certificate. + :type expiration_date: str + :param activate_date: The activate date of certificate. + :type activate_date: str + :param subject_name: The subject name of certificate. + :type subject_name: str + :param dns_names: The domain list of certificate. + :type dns_names: list[str] + """ + + _validation = { + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.vault_uri = kwargs.get('vault_uri', None) + self.key_vault_cert_name = kwargs.get('key_vault_cert_name', None) + self.cert_version = kwargs.get('cert_version', None) + self.issuer = kwargs.get('issuer', None) + self.issued_date = kwargs.get('issued_date', None) + self.expiration_date = kwargs.get('expiration_date', None) + self.activate_date = kwargs.get('activate_date', None) + self.subject_name = kwargs.get('subject_name', None) + self.dns_names = kwargs.get('dns_names', None) + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, **kwargs): + super(CertificateResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + class CloudError(Model): """An error response from the service. @@ -469,6 +570,106 @@ def __init__(self, **kwargs): self.git_property = kwargs.get('git_property', None) +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :param app_name: The app name of domain. + :type app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = kwargs.get('thumbprint', None) + self.app_name = kwargs.get('app_name', None) + self.cert_name = kwargs.get('cert_name', None) + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, **kwargs): + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.message = kwargs.get('message', None) + + class DeploymentInstance(Model): """Deployment instance payload. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py index a65d1ccb8f2..f15bff32d6f 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py @@ -132,6 +132,10 @@ class AppResourceProperties(Model): ~azure.mgmt.appplatform.models.AppResourceProvisioningState :param active_deployment_name: Name of the active deployment of the App :type active_deployment_name: str + :param fqdn: Fully qualified dns Name. + :type fqdn: str + :param https_only: Indicate if only https is allowed. + :type https_only: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -151,17 +155,21 @@ class AppResourceProperties(Model): 'url': {'key': 'url', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, } - def __init__(self, *, public: bool=None, active_deployment_name: str=None, temporary_disk=None, persistent_disk=None, **kwargs) -> None: + def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: str=None, https_only: bool=None, temporary_disk=None, persistent_disk=None, **kwargs) -> None: super(AppResourceProperties, self).__init__(**kwargs) self.public = public self.url = None self.provisioning_state = None self.active_deployment_name = active_deployment_name + self.fqdn = fqdn + self.https_only = https_only self.created_time = None self.temporary_disk = temporary_disk self.persistent_disk = persistent_disk @@ -256,6 +264,99 @@ def __init__(self, *, resource_name: str=None, resource_type: str=None, resource self.updated_at = None +class CertificateProperties(Model): + """Certificate resource payload. + + All required parameters must be populated in order to send to Azure. + + :param thumbprint: The thumbprint of certificate. + :type thumbprint: str + :param vault_uri: Required. The vault uri of user key vault. + :type vault_uri: str + :param key_vault_cert_name: Required. The certificate name of key vault. + :type key_vault_cert_name: str + :param cert_version: The certificate version of key vault. + :type cert_version: str + :param issuer: The issuer of certificate. + :type issuer: str + :param issued_date: The issue date of certificate. + :type issued_date: str + :param expiration_date: The expiration date of certificate. + :type expiration_date: str + :param activate_date: The activate date of certificate. + :type activate_date: str + :param subject_name: The subject name of certificate. + :type subject_name: str + :param dns_names: The domain list of certificate. + :type dns_names: list[str] + """ + + _validation = { + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + } + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'key_vault_cert_name': {'key': 'keyVaultCertName', 'type': 'str'}, + 'cert_version': {'key': 'certVersion', 'type': 'str'}, + 'issuer': {'key': 'issuer', 'type': 'str'}, + 'issued_date': {'key': 'issuedDate', 'type': 'str'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'str'}, + 'activate_date': {'key': 'activateDate', 'type': 'str'}, + 'subject_name': {'key': 'subjectName', 'type': 'str'}, + 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, + } + + def __init__(self, *, vault_uri: str, key_vault_cert_name: str, thumbprint: str=None, cert_version: str=None, issuer: str=None, issued_date: str=None, expiration_date: str=None, activate_date: str=None, subject_name: str=None, dns_names=None, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.vault_uri = vault_uri + self.key_vault_cert_name = key_vault_cert_name + self.cert_version = cert_version + self.issuer = issuer + self.issued_date = issued_date + self.expiration_date = expiration_date + self.activate_date = activate_date + self.subject_name = subject_name + self.dns_names = dns_names + + +class CertificateResource(ProxyResource): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CertificateResource, self).__init__(**kwargs) + self.properties = properties + + class CloudError(Model): """An error response from the service. @@ -469,6 +570,106 @@ def __init__(self, *, git_property=None, **kwargs) -> None: self.git_property = git_property +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :param app_name: The app name of domain. + :type app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _attribute_map = { + 'thumbprint': {'key': 'thumbprint', 'type': 'str'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'cert_name': {'key': 'certName', 'type': 'str'}, + } + + def __init__(self, *, thumbprint: str=None, app_name: str=None, cert_name: str=None, **kwargs) -> None: + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.app_name = app_name + self.cert_name = cert_name + + +class CustomDomainResource(ProxyResource): + """Custom domain resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: Properties of the custom domain resource. + :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'CustomDomainProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(CustomDomainResource, self).__init__(**kwargs) + self.properties = properties + + +class CustomDomainValidatePayload(Model): + """Custom domain validate payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name to be validated + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str, **kwargs) -> None: + super(CustomDomainValidatePayload, self).__init__(**kwargs) + self.name = name + + +class CustomDomainValidateResult(Model): + """Validation result for custom domain. + + :param is_valid: Indicates if domain name is valid. + :type is_valid: bool + :param message: Message of why domain name is invalid. + :type message: str + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, is_valid: bool=None, message: str=None, **kwargs) -> None: + super(CustomDomainValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.message = message + + class DeploymentInstance(Model): """Deployment instance payload. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py index 248668eb6cb..63c872c720b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py @@ -51,6 +51,32 @@ class BindingResourcePaged(Paged): def __init__(self, *args, **kwargs): super(BindingResourcePaged, self).__init__(*args, **kwargs) +class CertificateResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateResourcePaged, self).__init__(*args, **kwargs) +class CustomDomainResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`CustomDomainResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CustomDomainResource]'} + } + + def __init__(self, *args, **kwargs): + + super(CustomDomainResourcePaged, self).__init__(*args, **kwargs) class DeploymentResourcePaged(Paged): """ A paging container for iterating over a list of :class:`DeploymentResource ` object diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py index caf4e58455d..e6ebd5353e7 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py @@ -12,6 +12,8 @@ from ._services_operations import ServicesOperations from ._apps_operations import AppsOperations from ._bindings_operations import BindingsOperations +from ._certificates_operations import CertificatesOperations +from ._custom_domains_operations import CustomDomainsOperations from ._deployments_operations import DeploymentsOperations from ._operations import Operations @@ -19,6 +21,8 @@ 'ServicesOperations', 'AppsOperations', 'BindingsOperations', + 'CertificatesOperations', + 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', ] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py new file mode 100644 index 00000000000..00428016758 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py @@ -0,0 +1,312 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CertificatesOperations(object): + """CertificatesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Get the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CertificateResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def create_or_update( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CertificateResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + certificate_resource = models.CertificateResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(certificate_resource, 'CertificateResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def delete( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + """Delete the certificate resource. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param certificate_name: The name of the certificate resource. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'certificateName': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + def list( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """List all the certificates of one user. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CertificateResource + :rtype: + ~azure.mgmt.appplatform.models.CertificateResourcePaged[~azure.mgmt.appplatform.models.CertificateResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CertificateResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py new file mode 100644 index 00000000000..f7f88db69a4 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py @@ -0,0 +1,477 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class CustomDomainsOperations(object): + """CustomDomainsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-05-01-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Get the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def create_or_update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Create or update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.models.CustomDomainProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(domain_resource, 'CustomDomainResource') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def delete( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Delete the custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def patch( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + """Update custom domain of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param domain_name: The name of the custom domain resource. + :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.models.CustomDomainProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomDomainResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.patch.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(domain_resource, 'CustomDomainResource') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + def list( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """List the custom domains of one lifecycle application. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CustomDomainResource + :rtype: + ~azure.mgmt.appplatform.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.models.CustomDomainResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.CustomDomainResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains'} + + def validate( + self, resource_group_name, service_name, app_name, name, custom_headers=None, raw=False, **operation_config): + """Check the resource name is valid as well as not in use. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param service_name: The name of the Service resource. + :type service_name: str + :param app_name: The name of the App resource. + :type app_name: str + :param name: Name to be validated + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CustomDomainValidateResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + validate_payload = models.CustomDomainValidatePayload(name=name) + + # Construct URL + url = self.validate.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str'), + 'appName': self._serialize.url("app_name", app_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(validate_payload, 'CustomDomainValidatePayload') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CustomDomainValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/validate'} diff --git a/src/spring-cloud/setup.py b/src/spring-cloud/setup.py index b48b4feadd9..712fedee78a 100644 --- a/src/spring-cloud/setup.py +++ b/src/spring-cloud/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.2.2' +VERSION = '0.2.3' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers @@ -37,9 +37,9 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -with open('README.rst', 'r', encoding='utf-8') as f: +with open('README.md', 'r', encoding='utf-8') as f: README = f.read() -with open('HISTORY.rst', 'r', encoding='utf-8') as f: +with open('HISTORY.md', 'r', encoding='utf-8') as f: HISTORY = f.read() setup(