From 5e76306da4109098b9dd7186a95b34fd8bd2bf8d Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 7 May 2021 11:24:49 +0800 Subject: [PATCH 01/14] update bundled SDK for spring-cloud --- .../_app_platform_management_client.py | 37 + .../v2019_05_01_preview/models/__init__.py | 5 + .../_app_platform_management_client_enums.py | 6 + .../v2019_05_01_preview/models/_models.py | 60 +- .../v2019_05_01_preview/models/_models_py3.py | 58 +- .../v2020_07_01/models/__init__.py | 5 + .../_app_platform_management_client_enums.py | 6 + .../appplatform/v2020_07_01/models/_models.py | 52 + .../v2020_07_01/models/_models_py3.py | 52 + .../v2020_11_01_preview/models/_models.py | 16 +- .../v2020_11_01_preview/models/_models_py3.py | 16 +- .../v2021_03_03_preview/__init__.py | 19 + .../_app_platform_management_client.py | 101 + .../v2021_03_03_preview/_configuration.py | 50 + .../v2021_03_03_preview/models/__init__.py | 249 ++ .../_app_platform_management_client_enums.py | 135 ++ .../v2021_03_03_preview/models/_models.py | 2160 +++++++++++++++++ .../v2021_03_03_preview/models/_models_py3.py | 2160 +++++++++++++++++ .../models/_paged_models.py | 118 + .../operations/__init__.py | 36 + .../operations/_apps_operations.py | 634 +++++ .../operations/_bindings_operations.py | 510 ++++ .../operations/_certificates_operations.py | 381 +++ .../operations/_config_servers_operations.py | 428 ++++ .../operations/_custom_domains_operations.py | 510 ++++ .../operations/_deployments_operations.py | 935 +++++++ .../_monitoring_settings_operations.py | 322 +++ .../operations/_operations.py | 103 + .../_runtime_versions_operations.py | 93 + .../operations/_services_operations.py | 859 +++++++ .../operations/_skus_operations.py | 106 + .../v2021_03_03_preview/version.py | 13 + .../vendored_sdks/appplatform/version.py | 2 +- 33 files changed, 10213 insertions(+), 24 deletions(-) create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py 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 744ebc6929a..e60c3c5d4e0 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 @@ -76,6 +76,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-05-01-preview: :mod:`v2019_05_01_preview.models` * 2020-07-01: :mod:`v2020_07_01.models` * 2020-11-01-preview: :mod:`v2020_11_01_preview.models` + * 2021-03-03-preview: :mod:`v2021_03_03_preview.models` """ if api_version == '2019-05-01-preview': from .v2019_05_01_preview import models @@ -86,6 +87,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-11-01-preview': from .v2020_11_01_preview import models return models + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview import models + return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @property @@ -95,6 +99,7 @@ def apps(self): * 2019-05-01-preview: :class:`AppsOperations` * 2020-07-01: :class:`AppsOperations` * 2020-11-01-preview: :class:`AppsOperations` + * 2021-03-03-preview: :class:`AppsOperations` """ api_version = self._get_api_version('apps') if api_version == '2019-05-01-preview': @@ -103,6 +108,8 @@ def apps(self): from .v2020_07_01.operations import AppsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import AppsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import AppsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -114,6 +121,7 @@ def bindings(self): * 2019-05-01-preview: :class:`BindingsOperations` * 2020-07-01: :class:`BindingsOperations` * 2020-11-01-preview: :class:`BindingsOperations` + * 2021-03-03-preview: :class:`BindingsOperations` """ api_version = self._get_api_version('bindings') if api_version == '2019-05-01-preview': @@ -122,6 +130,8 @@ def bindings(self): from .v2020_07_01.operations import BindingsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import BindingsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import BindingsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -133,6 +143,7 @@ def certificates(self): * 2019-05-01-preview: :class:`CertificatesOperations` * 2020-07-01: :class:`CertificatesOperations` * 2020-11-01-preview: :class:`CertificatesOperations` + * 2021-03-03-preview: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2019-05-01-preview': @@ -141,6 +152,8 @@ def certificates(self): from .v2020_07_01.operations import CertificatesOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import CertificatesOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import CertificatesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -151,12 +164,15 @@ def config_servers(self): * 2020-07-01: :class:`ConfigServersOperations` * 2020-11-01-preview: :class:`ConfigServersOperations` + * 2021-03-03-preview: :class:`ConfigServersOperations` """ api_version = self._get_api_version('config_servers') if api_version == '2020-07-01': from .v2020_07_01.operations import ConfigServersOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import ConfigServersOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import ConfigServersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -168,6 +184,7 @@ def custom_domains(self): * 2019-05-01-preview: :class:`CustomDomainsOperations` * 2020-07-01: :class:`CustomDomainsOperations` * 2020-11-01-preview: :class:`CustomDomainsOperations` + * 2021-03-03-preview: :class:`CustomDomainsOperations` """ api_version = self._get_api_version('custom_domains') if api_version == '2019-05-01-preview': @@ -176,6 +193,8 @@ def custom_domains(self): from .v2020_07_01.operations import CustomDomainsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import CustomDomainsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import CustomDomainsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -187,6 +206,7 @@ def deployments(self): * 2019-05-01-preview: :class:`DeploymentsOperations` * 2020-07-01: :class:`DeploymentsOperations` * 2020-11-01-preview: :class:`DeploymentsOperations` + * 2021-03-03-preview: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2019-05-01-preview': @@ -195,6 +215,8 @@ def deployments(self): from .v2020_07_01.operations import DeploymentsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import DeploymentsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import DeploymentsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -205,12 +227,15 @@ def monitoring_settings(self): * 2020-07-01: :class:`MonitoringSettingsOperations` * 2020-11-01-preview: :class:`MonitoringSettingsOperations` + * 2021-03-03-preview: :class:`MonitoringSettingsOperations` """ api_version = self._get_api_version('monitoring_settings') if api_version == '2020-07-01': from .v2020_07_01.operations import MonitoringSettingsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import MonitoringSettingsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import MonitoringSettingsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -222,6 +247,7 @@ def operations(self): * 2019-05-01-preview: :class:`Operations` * 2020-07-01: :class:`Operations` * 2020-11-01-preview: :class:`Operations` + * 2021-03-03-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2019-05-01-preview': @@ -230,6 +256,8 @@ def operations(self): from .v2020_07_01.operations import Operations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import Operations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -241,6 +269,7 @@ def runtime_versions(self): * 2019-05-01-preview: :class:`RuntimeVersionsOperations` * 2020-07-01: :class:`RuntimeVersionsOperations` * 2020-11-01-preview: :class:`RuntimeVersionsOperations` + * 2021-03-03-preview: :class:`RuntimeVersionsOperations` """ api_version = self._get_api_version('runtime_versions') if api_version == '2019-05-01-preview': @@ -249,6 +278,8 @@ def runtime_versions(self): from .v2020_07_01.operations import RuntimeVersionsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import RuntimeVersionsOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import RuntimeVersionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -260,6 +291,7 @@ def services(self): * 2019-05-01-preview: :class:`ServicesOperations` * 2020-07-01: :class:`ServicesOperations` * 2020-11-01-preview: :class:`ServicesOperations` + * 2021-03-03-preview: :class:`ServicesOperations` """ api_version = self._get_api_version('services') if api_version == '2019-05-01-preview': @@ -268,6 +300,8 @@ def services(self): from .v2020_07_01.operations import ServicesOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import ServicesOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import ServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -291,12 +325,15 @@ def skus(self): * 2020-07-01: :class:`SkusOperations` * 2020-11-01-preview: :class:`SkusOperations` + * 2021-03-03-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2020-07-01': from .v2020_07_01.operations import SkusOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import SkusOperations as OperationClass + elif api_version == '2021-03-03-preview': + from .v2021_03_03_preview.operations import SkusOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/__init__.py index 05307b382a4..e14ef4761e6 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/__init__.py @@ -46,6 +46,7 @@ from ._models_py3 import PersistentDisk from ._models_py3 import ProxyResource from ._models_py3 import RegenerateTestKeyRequestPayload + from ._models_py3 import RequiredTraffic from ._models_py3 import Resource from ._models_py3 import ResourceSku from ._models_py3 import ResourceSkuCapabilities @@ -101,6 +102,7 @@ from ._models import PersistentDisk from ._models import ProxyResource from ._models import RegenerateTestKeyRequestPayload + from ._models import RequiredTraffic from ._models import Resource from ._models import ResourceSku from ._models import ResourceSkuCapabilities @@ -131,6 +133,7 @@ ProvisioningState, ConfigServerState, TraceProxyState, + TrafficDirection, ManagedIdentityType, TestKeyType, AppResourceProvisioningState, @@ -182,6 +185,7 @@ 'PersistentDisk', 'ProxyResource', 'RegenerateTestKeyRequestPayload', + 'RequiredTraffic', 'Resource', 'ResourceSku', 'ResourceSkuCapabilities', @@ -211,6 +215,7 @@ 'ProvisioningState', 'ConfigServerState', 'TraceProxyState', + 'TrafficDirection', 'ManagedIdentityType', 'TestKeyType', 'AppResourceProvisioningState', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py index bcd6f5bb797..86e2ecb6f68 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_app_platform_management_client_enums.py @@ -42,6 +42,12 @@ class TraceProxyState(str, Enum): updating = "Updating" +class TrafficDirection(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + class ManagedIdentityType(str, Enum): none = "None" diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models.py index 6db50d93680..1110020745d 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models.py @@ -1238,10 +1238,15 @@ class NetworkProfile(Model): instance. :vartype outbound_ips: ~azure.mgmt.appplatform.v2019_05_01_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2019_05_01_preview.models.RequiredTraffic] """ _validation = { 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, } _attribute_map = { @@ -1251,6 +1256,7 @@ class NetworkProfile(Model): 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, } def __init__(self, **kwargs): @@ -1261,6 +1267,7 @@ def __init__(self, **kwargs): self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) self.app_network_resource_group = kwargs.get('app_network_resource_group', None) self.outbound_ips = None + self.required_traffics = None class NetworkProfileOutboundIPs(Model): @@ -1421,6 +1428,51 @@ def __init__(self, **kwargs): self.key_type = kwargs.get('key_type', None) +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + class ResourceSku(Model): """Describes an available Azure Spring Cloud SKU. @@ -1724,9 +1776,9 @@ def __init__(self, **kwargs): class Sku(Model): """Sku of Azure Spring Cloud. - :param name: Name of the Sku + :param name: Name of the Sku. Default value: "S0" . :type name: str - :param tier: Tier of the Sku + :param tier: Tier of the Sku. Default value: "Standard" . :type tier: str :param capacity: Current capacity of the target resource :type capacity: int @@ -1740,8 +1792,8 @@ class Sku(Model): def __init__(self, **kwargs): super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) + self.name = kwargs.get('name', "S0") + self.tier = kwargs.get('tier', "Standard") self.capacity = kwargs.get('capacity', None) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models_py3.py index d781484b060..74599f3bd5e 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/models/_models_py3.py @@ -1238,10 +1238,15 @@ class NetworkProfile(Model): instance. :vartype outbound_ips: ~azure.mgmt.appplatform.v2019_05_01_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2019_05_01_preview.models.RequiredTraffic] """ _validation = { 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, } _attribute_map = { @@ -1251,6 +1256,7 @@ class NetworkProfile(Model): 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, } def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: @@ -1261,6 +1267,7 @@ def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=No self.service_runtime_network_resource_group = service_runtime_network_resource_group self.app_network_resource_group = app_network_resource_group self.outbound_ips = None + self.required_traffics = None class NetworkProfileOutboundIPs(Model): @@ -1421,6 +1428,51 @@ def __init__(self, *, key_type, **kwargs) -> None: self.key_type = key_type +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2019_05_01_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + class ResourceSku(Model): """Describes an available Azure Spring Cloud SKU. @@ -1724,9 +1776,9 @@ def __init__(self, *, log_specifications=None, metric_specifications=None, **kwa class Sku(Model): """Sku of Azure Spring Cloud. - :param name: Name of the Sku + :param name: Name of the Sku. Default value: "S0" . :type name: str - :param tier: Tier of the Sku + :param tier: Tier of the Sku. Default value: "Standard" . :type tier: str :param capacity: Current capacity of the target resource :type capacity: int @@ -1738,7 +1790,7 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + def __init__(self, *, name: str="S0", tier: str="Standard", capacity: int=None, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.name = name self.tier = tier diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/__init__.py index 4ce60886aab..938b11a517a 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/__init__.py @@ -51,6 +51,7 @@ from ._models_py3 import PersistentDisk from ._models_py3 import ProxyResource from ._models_py3 import RegenerateTestKeyRequestPayload + from ._models_py3 import RequiredTraffic from ._models_py3 import Resource from ._models_py3 import ResourceSku from ._models_py3 import ResourceSkuCapabilities @@ -110,6 +111,7 @@ from ._models import PersistentDisk from ._models import ProxyResource from ._models import RegenerateTestKeyRequestPayload + from ._models import RequiredTraffic from ._models import Resource from ._models import ResourceSku from ._models import ResourceSkuCapabilities @@ -137,6 +139,7 @@ from ._paged_models import ServiceResourcePaged from ._app_platform_management_client_enums import ( ProvisioningState, + TrafficDirection, ManagedIdentityType, ConfigServerState, MonitoringSettingState, @@ -195,6 +198,7 @@ 'PersistentDisk', 'ProxyResource', 'RegenerateTestKeyRequestPayload', + 'RequiredTraffic', 'Resource', 'ResourceSku', 'ResourceSkuCapabilities', @@ -221,6 +225,7 @@ 'OperationDetailPaged', 'ResourceSkuPaged', 'ProvisioningState', + 'TrafficDirection', 'ManagedIdentityType', 'ConfigServerState', 'MonitoringSettingState', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py index b24c6101642..5ae8632fbad 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_app_platform_management_client_enums.py @@ -25,6 +25,12 @@ class ProvisioningState(str, Enum): move_failed = "MoveFailed" +class TrafficDirection(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + class ManagedIdentityType(str, Enum): none = "None" diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models.py index 899625f1fad..38e3860602e 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models.py @@ -1368,10 +1368,15 @@ class NetworkProfile(Model): instance. :vartype outbound_ips: ~azure.mgmt.appplatform.v2020_07_01.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2020_07_01.models.RequiredTraffic] """ _validation = { 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, } _attribute_map = { @@ -1381,6 +1386,7 @@ class NetworkProfile(Model): 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, } def __init__(self, **kwargs): @@ -1391,6 +1397,7 @@ def __init__(self, **kwargs): self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) self.app_network_resource_group = kwargs.get('app_network_resource_group', None) self.outbound_ips = None + self.required_traffics = None class NetworkProfileOutboundIPs(Model): @@ -1550,6 +1557,51 @@ def __init__(self, **kwargs): self.key_type = kwargs.get('key_type', None) +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2020_07_01.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + class ResourceSku(Model): """Describes an available Azure Spring Cloud SKU. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py index 261e7655946..a57125e51df 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/models/_models_py3.py @@ -1368,10 +1368,15 @@ class NetworkProfile(Model): instance. :vartype outbound_ips: ~azure.mgmt.appplatform.v2020_07_01.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2020_07_01.models.RequiredTraffic] """ _validation = { 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, } _attribute_map = { @@ -1381,6 +1386,7 @@ class NetworkProfile(Model): 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, } def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: @@ -1391,6 +1397,7 @@ def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=No self.service_runtime_network_resource_group = service_runtime_network_resource_group self.app_network_resource_group = app_network_resource_group self.outbound_ips = None + self.required_traffics = None class NetworkProfileOutboundIPs(Model): @@ -1550,6 +1557,51 @@ def __init__(self, *, key_type, **kwargs) -> None: self.key_type = key_type +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2020_07_01.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + class ResourceSku(Model): """Describes an available Azure Spring Cloud SKU. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models.py index 5e4cb8128dc..f8f5be052bd 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models.py @@ -165,8 +165,6 @@ class AppResourceProperties(Model): :type fqdn: str :param https_only: Indicate if only https is allowed. :type https_only: bool - :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. - :type enable_end_to_end_tls: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -175,6 +173,8 @@ class AppResourceProperties(Model): :param persistent_disk: Persistent disk settings :type persistent_disk: ~azure.mgmt.appplatform.v2020_11_01_preview.models.PersistentDisk + :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :type enable_end_to_end_tls: bool """ _validation = { @@ -190,10 +190,10 @@ class AppResourceProperties(Model): 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, 'fqdn': {'key': 'fqdn', 'type': 'str'}, 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, - 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, + 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -204,10 +204,10 @@ def __init__(self, **kwargs): 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.enable_end_to_end_tls = kwargs.get('enable_end_to_end_tls', None) self.created_time = None self.temporary_disk = kwargs.get('temporary_disk', None) self.persistent_disk = kwargs.get('persistent_disk', None) + self.enable_end_to_end_tls = kwargs.get('enable_end_to_end_tls', None) class AvailableRuntimeVersions(Model): @@ -1951,9 +1951,9 @@ def __init__(self, **kwargs): class Sku(Model): """Sku of Azure Spring Cloud. - :param name: Name of the Sku + :param name: Name of the Sku. Default value: "S0" . :type name: str - :param tier: Tier of the Sku + :param tier: Tier of the Sku. Default value: "Standard" . :type tier: str :param capacity: Current capacity of the target resource :type capacity: int @@ -1967,8 +1967,8 @@ class Sku(Model): def __init__(self, **kwargs): super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) + self.name = kwargs.get('name', "S0") + self.tier = kwargs.get('tier', "Standard") self.capacity = kwargs.get('capacity', None) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py index 7cd772766b3..aff0c5844b1 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/models/_models_py3.py @@ -165,8 +165,6 @@ class AppResourceProperties(Model): :type fqdn: str :param https_only: Indicate if only https is allowed. :type https_only: bool - :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. - :type enable_end_to_end_tls: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :param temporary_disk: Temporary disk settings @@ -175,6 +173,8 @@ class AppResourceProperties(Model): :param persistent_disk: Persistent disk settings :type persistent_disk: ~azure.mgmt.appplatform.v2020_11_01_preview.models.PersistentDisk + :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :type enable_end_to_end_tls: bool """ _validation = { @@ -190,13 +190,13 @@ class AppResourceProperties(Model): 'active_deployment_name': {'key': 'activeDeploymentName', 'type': 'str'}, 'fqdn': {'key': 'fqdn', 'type': 'str'}, 'https_only': {'key': 'httpsOnly', 'type': 'bool'}, - 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, 'temporary_disk': {'key': 'temporaryDisk', 'type': 'TemporaryDisk'}, 'persistent_disk': {'key': 'persistentDisk', 'type': 'PersistentDisk'}, + 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, } - def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: str=None, https_only: bool=None, enable_end_to_end_tls: bool=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, enable_end_to_end_tls: bool=None, **kwargs) -> None: super(AppResourceProperties, self).__init__(**kwargs) self.public = public self.url = None @@ -204,10 +204,10 @@ def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: self.active_deployment_name = active_deployment_name self.fqdn = fqdn self.https_only = https_only - self.enable_end_to_end_tls = enable_end_to_end_tls self.created_time = None self.temporary_disk = temporary_disk self.persistent_disk = persistent_disk + self.enable_end_to_end_tls = enable_end_to_end_tls class AvailableRuntimeVersions(Model): @@ -1951,9 +1951,9 @@ def __init__(self, *, log_specifications=None, metric_specifications=None, **kwa class Sku(Model): """Sku of Azure Spring Cloud. - :param name: Name of the Sku + :param name: Name of the Sku. Default value: "S0" . :type name: str - :param tier: Tier of the Sku + :param tier: Tier of the Sku. Default value: "Standard" . :type tier: str :param capacity: Current capacity of the target resource :type capacity: int @@ -1965,7 +1965,7 @@ class Sku(Model): 'capacity': {'key': 'capacity', 'type': 'int'}, } - def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + def __init__(self, *, name: str="S0", tier: str="Standard", capacity: int=None, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.name = name self.tier = tier diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py new file mode 100644 index 00000000000..ee44eafce0f --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._configuration import AppPlatformManagementClientConfiguration +from ._app_platform_management_client import AppPlatformManagementClient +__all__ = ['AppPlatformManagementClient', 'AppPlatformManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py new file mode 100644 index 00000000000..00f0759c6b2 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py @@ -0,0 +1,101 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import AppPlatformManagementClientConfiguration +from .operations import ServicesOperations +from .operations import ConfigServersOperations +from .operations import MonitoringSettingsOperations +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 .operations import RuntimeVersionsOperations +from .operations import SkusOperations +from . import models + + +class AppPlatformManagementClient(SDKClient): + """REST API for Azure Spring Cloud + + :ivar config: Configuration for client. + :vartype config: AppPlatformManagementClientConfiguration + + :ivar services: Services operations + :vartype services: azure.mgmt.appplatform.v2021_03_03_preview.operations.ServicesOperations + :ivar config_servers: ConfigServers operations + :vartype config_servers: azure.mgmt.appplatform.v2021_03_03_preview.operations.ConfigServersOperations + :ivar monitoring_settings: MonitoringSettings operations + :vartype monitoring_settings: azure.mgmt.appplatform.v2021_03_03_preview.operations.MonitoringSettingsOperations + :ivar apps: Apps operations + :vartype apps: azure.mgmt.appplatform.v2021_03_03_preview.operations.AppsOperations + :ivar bindings: Bindings operations + :vartype bindings: azure.mgmt.appplatform.v2021_03_03_preview.operations.BindingsOperations + :ivar certificates: Certificates operations + :vartype certificates: azure.mgmt.appplatform.v2021_03_03_preview.operations.CertificatesOperations + :ivar custom_domains: CustomDomains operations + :vartype custom_domains: azure.mgmt.appplatform.v2021_03_03_preview.operations.CustomDomainsOperations + :ivar deployments: Deployments operations + :vartype deployments: azure.mgmt.appplatform.v2021_03_03_preview.operations.DeploymentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.appplatform.v2021_03_03_preview.operations.Operations + :ivar runtime_versions: RuntimeVersions operations + :vartype runtime_versions: azure.mgmt.appplatform.v2021_03_03_preview.operations.RuntimeVersionsOperations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.appplatform.v2021_03_03_preview.operations.SkusOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription ID which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = AppPlatformManagementClientConfiguration(credentials, subscription_id, base_url) + super(AppPlatformManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-03-03-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.services = ServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.config_servers = ConfigServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.monitoring_settings = MonitoringSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.apps = AppsOperations( + 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( + self._client, self.config, self._serialize, self._deserialize) + self.runtime_versions = RuntimeVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py new file mode 100644 index 00000000000..5a7f3752f05 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py @@ -0,0 +1,50 @@ +# 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. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class AppPlatformManagementClientConfiguration(AzureConfiguration): + """Configuration for AppPlatformManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Gets subscription ID which uniquely identify the + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(AppPlatformManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-appplatform/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py new file mode 100644 index 00000000000..e2b1091ec8a --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py @@ -0,0 +1,249 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ApplicationInsightsAgentVersions + from ._models_py3 import AppResource + from ._models_py3 import AppResourceProperties + from ._models_py3 import AvailableRuntimeVersions + 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 ConfigServerResource + from ._models_py3 import ConfigServerSettings + from ._models_py3 import ConfigServerSettingsErrorRecord + from ._models_py3 import ConfigServerSettingsValidateResult + 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 + from ._models_py3 import DeploymentSettings + from ._models_py3 import Error + from ._models_py3 import GitPatternRepository + from ._models_py3 import LogFileUrlResponse + from ._models_py3 import LogSpecification + from ._models_py3 import ManagedIdentityProperties + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification + from ._models_py3 import MonitoringSettingProperties + from ._models_py3 import MonitoringSettingResource + from ._models_py3 import NameAvailability + from ._models_py3 import NameAvailabilityParameters + from ._models_py3 import NetworkProfile + from ._models_py3 import NetworkProfileOutboundIPs + from ._models_py3 import OperationDetail + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationProperties + from ._models_py3 import PersistentDisk + from ._models_py3 import ProxyResource + from ._models_py3 import RegenerateTestKeyRequestPayload + from ._models_py3 import RequiredTraffic + from ._models_py3 import Resource + from ._models_py3 import ResourceRequests + from ._models_py3 import ResourceSku + from ._models_py3 import ResourceSkuCapabilities + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import ResourceSkuZoneDetails + from ._models_py3 import ResourceUploadDefinition + from ._models_py3 import ServiceResource + from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SkuCapacity + from ._models_py3 import SupportedRuntimeVersion + from ._models_py3 import TemporaryDisk + from ._models_py3 import TestKeys + from ._models_py3 import TrackedResource + from ._models_py3 import UserSourceInfo +except (SyntaxError, ImportError): + from ._models import ApplicationInsightsAgentVersions + from ._models import AppResource + from ._models import AppResourceProperties + from ._models import AvailableRuntimeVersions + 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 ConfigServerResource + from ._models import ConfigServerSettings + from ._models import ConfigServerSettingsErrorRecord + from ._models import ConfigServerSettingsValidateResult + 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 + from ._models import DeploymentSettings + from ._models import Error + from ._models import GitPatternRepository + from ._models import LogFileUrlResponse + from ._models import LogSpecification + from ._models import ManagedIdentityProperties + from ._models import MetricDimension + from ._models import MetricSpecification + from ._models import MonitoringSettingProperties + from ._models import MonitoringSettingResource + from ._models import NameAvailability + from ._models import NameAvailabilityParameters + from ._models import NetworkProfile + from ._models import NetworkProfileOutboundIPs + from ._models import OperationDetail + from ._models import OperationDisplay + from ._models import OperationProperties + from ._models import PersistentDisk + from ._models import ProxyResource + from ._models import RegenerateTestKeyRequestPayload + from ._models import RequiredTraffic + from ._models import Resource + from ._models import ResourceRequests + from ._models import ResourceSku + from ._models import ResourceSkuCapabilities + from ._models import ResourceSkuLocationInfo + from ._models import ResourceSkuRestrictionInfo + from ._models import ResourceSkuRestrictions + from ._models import ResourceSkuZoneDetails + from ._models import ResourceUploadDefinition + from ._models import ServiceResource + from ._models import ServiceSpecification + from ._models import Sku + from ._models import SkuCapacity + from ._models import SupportedRuntimeVersion + from ._models import TemporaryDisk + from ._models import TestKeys + from ._models import TrackedResource + 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 ResourceSkuPaged +from ._paged_models import ServiceResourcePaged +from ._app_platform_management_client_enums import ( + ProvisioningState, + TrafficDirection, + ManagedIdentityType, + ConfigServerState, + MonitoringSettingState, + TestKeyType, + AppResourceProvisioningState, + UserSourceType, + RuntimeVersion, + DeploymentResourceProvisioningState, + DeploymentResourceStatus, + SkuScaleType, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionsReasonCode, + SupportedRuntimeValue, + SupportedRuntimePlatform, +) + +__all__ = [ + 'ApplicationInsightsAgentVersions', + 'AppResource', + 'AppResourceProperties', + 'AvailableRuntimeVersions', + 'BindingResource', + 'BindingResourceProperties', + 'CertificateProperties', + 'CertificateResource', + 'ClusterResourceProperties', + 'ConfigServerGitProperty', + 'ConfigServerProperties', + 'ConfigServerResource', + 'ConfigServerSettings', + 'ConfigServerSettingsErrorRecord', + 'ConfigServerSettingsValidateResult', + 'CustomDomainProperties', + 'CustomDomainResource', + 'CustomDomainValidatePayload', + 'CustomDomainValidateResult', + 'DeploymentInstance', + 'DeploymentResource', + 'DeploymentResourceProperties', + 'DeploymentSettings', + 'Error', + 'GitPatternRepository', + 'LogFileUrlResponse', + 'LogSpecification', + 'ManagedIdentityProperties', + 'MetricDimension', + 'MetricSpecification', + 'MonitoringSettingProperties', + 'MonitoringSettingResource', + 'NameAvailability', + 'NameAvailabilityParameters', + 'NetworkProfile', + 'NetworkProfileOutboundIPs', + 'OperationDetail', + 'OperationDisplay', + 'OperationProperties', + 'PersistentDisk', + 'ProxyResource', + 'RegenerateTestKeyRequestPayload', + 'RequiredTraffic', + 'Resource', + 'ResourceRequests', + 'ResourceSku', + 'ResourceSkuCapabilities', + 'ResourceSkuLocationInfo', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSkuZoneDetails', + 'ResourceUploadDefinition', + 'ServiceResource', + 'ServiceSpecification', + 'Sku', + 'SkuCapacity', + 'SupportedRuntimeVersion', + 'TemporaryDisk', + 'TestKeys', + 'TrackedResource', + 'UserSourceInfo', + 'ServiceResourcePaged', + 'AppResourcePaged', + 'BindingResourcePaged', + 'CertificateResourcePaged', + 'CustomDomainResourcePaged', + 'DeploymentResourcePaged', + 'OperationDetailPaged', + 'ResourceSkuPaged', + 'ProvisioningState', + 'TrafficDirection', + 'ManagedIdentityType', + 'ConfigServerState', + 'MonitoringSettingState', + 'TestKeyType', + 'AppResourceProvisioningState', + 'UserSourceType', + 'RuntimeVersion', + 'DeploymentResourceProvisioningState', + 'DeploymentResourceStatus', + 'SkuScaleType', + 'ResourceSkuRestrictionsType', + 'ResourceSkuRestrictionsReasonCode', + 'SupportedRuntimeValue', + 'SupportedRuntimePlatform', +] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py new file mode 100644 index 00000000000..5ae8632fbad --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py @@ -0,0 +1,135 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + deleted = "Deleted" + succeeded = "Succeeded" + failed = "Failed" + moving = "Moving" + moved = "Moved" + move_failed = "MoveFailed" + + +class TrafficDirection(str, Enum): + + inbound = "Inbound" + outbound = "Outbound" + + +class ManagedIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + system_assigned_user_assigned = "SystemAssigned,UserAssigned" + + +class ConfigServerState(str, Enum): + + not_available = "NotAvailable" + deleted = "Deleted" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class MonitoringSettingState(str, Enum): + + not_available = "NotAvailable" + failed = "Failed" + succeeded = "Succeeded" + updating = "Updating" + + +class TestKeyType(str, Enum): + + primary = "Primary" + secondary = "Secondary" + + +class AppResourceProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + creating = "Creating" + updating = "Updating" + + +class UserSourceType(str, Enum): + + jar = "Jar" + net_core_zip = "NetCoreZip" + source = "Source" + + +class RuntimeVersion(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class DeploymentResourceProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + succeeded = "Succeeded" + failed = "Failed" + + +class DeploymentResourceStatus(str, Enum): + + unknown = "Unknown" + stopped = "Stopped" + running = "Running" + failed = "Failed" + allocating = "Allocating" + upgrading = "Upgrading" + compiling = "Compiling" + + +class SkuScaleType(str, Enum): + + none = "None" + manual = "Manual" + automatic = "Automatic" + + +class ResourceSkuRestrictionsType(str, Enum): + + location = "Location" + zone = "Zone" + + +class ResourceSkuRestrictionsReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + +class SupportedRuntimeValue(str, Enum): + + java_8 = "Java_8" + java_11 = "Java_11" + net_core_31 = "NetCore_31" + + +class SupportedRuntimePlatform(str, Enum): + + java = "Java" + net_core = ".NET Core" diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py new file mode 100644 index 00000000000..45ff19a0944 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py @@ -0,0 +1,2160 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationInsightsAgentVersions(Model): + """Application Insights agent versions properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar java: Indicates the version of application insight java agent + :vartype java: str + """ + + _validation = { + 'java': {'readonly': True}, + } + + _attribute_map = { + 'java': {'key': 'java', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationInsightsAgentVersions, self).__init__(**kwargs) + self.java = None + + +class Resource(Model): + """The core properties of ARM resources. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class AppResource(ProxyResource): + """App 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 App resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProperties + :param identity: The Managed Identity type of the app resource + :type identity: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityProperties + :param location: The GEO location of the application, always the same with + its parent resource + :type location: str + """ + + _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': 'AppResourceProperties'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AppResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.identity = kwargs.get('identity', None) + self.location = kwargs.get('location', None) + + +class AppResourceProperties(Model): + """App resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param public: Indicates whether the App exposes public endpoint + :type public: bool + :ivar url: URL of the App + :vartype url: str + :ivar provisioning_state: Provisioning state of the App. Possible values + include: 'Succeeded', 'Failed', 'Creating', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.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 + :type temporary_disk: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TemporaryDisk + :param persistent_disk: Persistent disk settings + :type persistent_disk: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.PersistentDisk + :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :type enable_end_to_end_tls: bool + """ + + _validation = { + 'url': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + } + + _attribute_map = { + 'public': {'key': 'public', 'type': 'bool'}, + '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'}, + 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(AppResourceProperties, self).__init__(**kwargs) + self.public = kwargs.get('public', None) + 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) + self.enable_end_to_end_tls = kwargs.get('enable_end_to_end_tls', None) + + +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs): + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + +class BindingResource(ProxyResource): + """Binding 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 Binding resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + """ + + _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': 'BindingResourceProperties'}, + } + + def __init__(self, **kwargs): + super(BindingResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BindingResourceProperties(Model): + """Binding resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_name: The name of the bound resource + :vartype resource_name: str + :ivar resource_type: The standard Azure resource type of the bound + resource + :vartype resource_type: str + :param resource_id: The Azure resource id of the bound resource + :type resource_id: str + :param key: The key of the bound resource + :type key: str + :param binding_parameters: Binding parameters of the Binding resource + :type binding_parameters: dict[str, object] + :ivar generated_properties: The generated Spring Boot property file for + this binding. The secret will be deducted. + :vartype generated_properties: str + :ivar created_at: Creation time of the Binding resource + :vartype created_at: str + :ivar updated_at: Update time of the Binding resource + :vartype updated_at: str + """ + + _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'generated_properties': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'binding_parameters': {'key': 'bindingParameters', 'type': '{object}'}, + 'generated_properties': {'key': 'generatedProperties', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'updated_at': {'key': 'updatedAt', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BindingResourceProperties, self).__init__(**kwargs) + self.resource_name = None + self.resource_type = None + self.resource_id = kwargs.get('resource_id', None) + self.key = kwargs.get('key', None) + self.binding_parameters = kwargs.get('binding_parameters', None) + self.generated_properties = None + self.created_at = None + self.updated_at = None + + +class CertificateProperties(Model): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar thumbprint: The thumbprint of certificate. + :vartype 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 + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + """ + + _validation = { + 'thumbprint': {'readonly': True}, + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': 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 = 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 = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.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.v2021_03_03_preview.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. + + :param error: An error response from the service. + :type error: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class ClusterResourceProperties(Model): + """Service properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Service. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Deleted', + 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ProvisioningState + :param network_profile: Network profile of the Service + :type network_profile: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfile + :ivar version: Version of the Service + :vartype version: int + :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a + created resource + :vartype service_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version': {'readonly': True}, + 'service_id': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, + 'version': {'key': 'version', 'type': 'int'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.network_profile = kwargs.get('network_profile', None) + self.version = None + self.service_id = None + + +class ConfigServerGitProperty(Model): + """Property of git. + + All required parameters must be populated in order to send to Azure. + + :param repositories: Repositories of git. + :type repositories: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.GitPatternRepository] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'repositories': {'key': 'repositories', 'type': '[GitPatternRepository]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ConfigServerGitProperty, self).__init__(**kwargs) + self.repositories = kwargs.get('repositories', None) + self.uri = kwargs.get('uri', None) + self.label = kwargs.get('label', None) + self.search_paths = kwargs.get('search_paths', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.host_key = kwargs.get('host_key', None) + self.host_key_algorithm = kwargs.get('host_key_algorithm', None) + self.private_key = kwargs.get('private_key', None) + self.strict_host_key_checking = kwargs.get('strict_host_key_checking', None) + + +class ConfigServerProperties(Model): + """Config server git properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerState + :param error: Error when apply config server settings. + :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :param config_server: Settings of config server. + :type config_server: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettings + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'config_server': {'key': 'configServer', 'type': 'ConfigServerSettings'}, + } + + def __init__(self, **kwargs): + super(ConfigServerProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.config_server = kwargs.get('config_server', None) + + +class ConfigServerResource(ProxyResource): + """Config Server resource. + + 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 Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + """ + + _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': 'ConfigServerProperties'}, + } + + def __init__(self, **kwargs): + super(ConfigServerResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ConfigServerSettings(Model): + """The settings of config server. + + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + """ + + _attribute_map = { + 'git_property': {'key': 'gitProperty', 'type': 'ConfigServerGitProperty'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettings, self).__init__(**kwargs) + self.git_property = kwargs.get('git_property', None) + + +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.uri = kwargs.get('uri', None) + self.messages = kwargs.get('messages', None) + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, **kwargs): + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = kwargs.get('is_valid', None) + self.details = kwargs.get('details', None) + + +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :ivar app_name: The app name of domain. + :vartype app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _validation = { + 'app_name': {'readonly': True}, + } + + _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 = 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.v2021_03_03_preview.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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the deployment instance + :vartype name: str + :ivar status: Status of the deployment instance + :vartype status: str + :ivar reason: Failed reason of the deployment instance + :vartype reason: str + :ivar discovery_status: Discovery status of the deployment instance + :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentInstance, self).__init__(**kwargs) + self.name = None + self.status = None + self.reason = None + self.discovery_status = None + self.start_time = None + + +class DeploymentResource(ProxyResource): + """Deployment 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 Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + """ + + _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': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(DeploymentResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class DeploymentResourceProperties(Model): + """Deployment resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param source: Uploaded source information of the deployment. + :type source: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceInfo + :ivar app_name: App name of the deployment + :vartype app_name: str + :param deployment_settings: Deployment settings of the Deployment + :type deployment_settings: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentSettings + :ivar provisioning_state: Provisioning state of the Deployment. Possible + values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProvisioningState + :ivar status: Status of the Deployment. Possible values include: + 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', + 'Compiling' + :vartype status: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceStatus + :ivar active: Indicates whether the Deployment is active + :vartype active: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :ivar instances: Collection of instances belong to the Deployment + :vartype instances: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentInstance] + """ + + _validation = { + 'app_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'active': {'readonly': True}, + 'created_time': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'UserSourceInfo'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'active': {'key': 'active', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'instances': {'key': 'instances', 'type': '[DeploymentInstance]'}, + } + + def __init__(self, **kwargs): + super(DeploymentResourceProperties, self).__init__(**kwargs) + self.source = kwargs.get('source', None) + self.app_name = None + self.deployment_settings = kwargs.get('deployment_settings', None) + self.provisioning_state = None + self.status = None + self.active = None + self.created_time = None + self.instances = None + + +class DeploymentSettings(Model): + """Deployment settings payload. + + :param cpu: Required CPU. This should be 1 for Basic tier, and in range + [1, 4] for Standard tier. This is deprecated starting from API version + 2020-03-03-preview. Please use the resourceRequests field to set the CPU + size. Default value: 1 . + :type cpu: int + :param memory_in_gb: Required Memory size in GB. This should be in range + [1, 2] for Basic tier, and in range [1, 8] for Standard tier. This is + deprecated starting from API version 2020-03-03-preview. Please use the + resourceRequests field to set the the memory size. Default value: 1 . + :type memory_in_gb: int + :param resource_requests: The requested resource quantity for required CPU + and Memory. It is recommended that using this field to represent the + required CPU and Memory, the old field cpu and memoryInGB will be + deprecated later. + :type resource_requests: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceRequests + :param jvm_options: JVM parameter + :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str + :param environment_variables: Collection of environment variables + :type environment_variables: dict[str, str] + :param runtime_version: Runtime version. Possible values include: + 'Java_8', 'Java_11', 'NetCore_31' + :type runtime_version: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.RuntimeVersion + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, + 'resource_requests': {'key': 'resourceRequests', 'type': 'ResourceRequests'}, + 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeploymentSettings, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', 1) + self.memory_in_gb = kwargs.get('memory_in_gb', 1) + self.resource_requests = kwargs.get('resource_requests', None) + self.jvm_options = kwargs.get('jvm_options', None) + self.net_core_main_entry_path = kwargs.get('net_core_main_entry_path', None) + self.environment_variables = kwargs.get('environment_variables', None) + self.runtime_version = kwargs.get('runtime_version', None) + + +class Error(Model): + """The error code compose of code and message. + + :param code: The code of error. + :type code: str + :param message: The message of error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class GitPatternRepository(Model): + """Git repository property payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the repository + :type name: str + :param pattern: Collection of pattern of the repository + :type pattern: list[str] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'name': {'required': True}, + 'uri': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': '[str]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(GitPatternRepository, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.pattern = kwargs.get('pattern', None) + self.uri = kwargs.get('uri', None) + self.label = kwargs.get('label', None) + self.search_paths = kwargs.get('search_paths', None) + self.username = kwargs.get('username', None) + self.password = kwargs.get('password', None) + self.host_key = kwargs.get('host_key', None) + self.host_key_algorithm = kwargs.get('host_key_algorithm', None) + self.private_key = kwargs.get('private_key', None) + self.strict_host_key_checking = kwargs.get('strict_host_key_checking', None) + + +class LogFileUrlResponse(Model): + """Log file URL payload. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. URL of the log file + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogFileUrlResponse, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + + +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) + + +class ManagedIdentityProperties(Model): + """Managed identity properties retrieved from ARM request headers. + + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityType + :param principal_id: Principal Id + :type principal_id: str + :param tenant_id: Tenant Id + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedIdentityProperties, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricDimension, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, **kwargs): + super(MetricSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.display_description = kwargs.get('display_description', None) + self.unit = kwargs.get('unit', None) + self.category = kwargs.get('category', None) + self.aggregation_type = kwargs.get('aggregation_type', None) + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.supported_time_grain_types = kwargs.get('supported_time_grain_types', None) + self.fill_gap_with_zero = kwargs.get('fill_gap_with_zero', None) + self.dimensions = kwargs.get('dimensions', None) + + +class MonitoringSettingProperties(Model): + """Monitoring Setting properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the Monitoring Setting. Possible values + include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :param trace_enabled: Indicates whether enable the trace functionality, + which will be deprecated since api version 2021-03-03-preview. Please + leverage appInsightsInstrumentationKey to indicate if monitoringSettings + enabled or not + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key, null or whitespace include empty will disable + monitoringSettings + :type app_insights_instrumentation_key: str + :param app_insights_sampling_rate: Indicates the sampling rate of + application insight agent, should be in range [0.0, 100.0] + :type app_insights_sampling_rate: float + :param app_insights_agent_versions: Indicates the versions of application + insight agent + :type app_insights_agent_versions: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ApplicationInsightsAgentVersions + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'app_insights_sampling_rate': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'trace_enabled': {'key': 'traceEnabled', 'type': 'bool'}, + 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, + 'app_insights_sampling_rate': {'key': 'appInsightsSamplingRate', 'type': 'float'}, + 'app_insights_agent_versions': {'key': 'appInsightsAgentVersions', 'type': 'ApplicationInsightsAgentVersions'}, + } + + def __init__(self, **kwargs): + super(MonitoringSettingProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = kwargs.get('error', None) + self.trace_enabled = kwargs.get('trace_enabled', None) + self.app_insights_instrumentation_key = kwargs.get('app_insights_instrumentation_key', None) + self.app_insights_sampling_rate = kwargs.get('app_insights_sampling_rate', None) + self.app_insights_agent_versions = kwargs.get('app_insights_agent_versions', None) + + +class MonitoringSettingResource(ProxyResource): + """Monitoring Setting resource. + + 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 Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + """ + + _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': 'MonitoringSettingProperties'}, + } + + def __init__(self, **kwargs): + super(MonitoringSettingResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class NameAvailability(Model): + """Name availability result payload. + + :param name_available: Indicates whether the name is available + :type name_available: bool + :param reason: Reason why the name is not available + :type reason: str + :param message: Message why the name is not available + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailability, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class NameAvailabilityParameters(Model): + """Name availability parameters payload. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the resource to check name availability + :type type: str + :param name: Required. Name to be checked + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + + +class NetworkProfile(Model): + """Service network profile payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param service_runtime_subnet_id: Fully qualified resource Id of the + subnet to host Azure Spring Cloud Service Runtime + :type service_runtime_subnet_id: str + :param app_subnet_id: Fully qualified resource Id of the subnet to host + Azure Spring Cloud Apps + :type app_subnet_id: str + :param service_cidr: Azure Spring Cloud service reserved CIDR + :type service_cidr: str + :param service_runtime_network_resource_group: Name of the resource group + containing network resources of Azure Spring Cloud Service Runtime + :type service_runtime_network_resource_group: str + :param app_network_resource_group: Name of the resource group containing + network resources of Azure Spring Cloud Apps + :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.RequiredTraffic] + """ + + _validation = { + 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, + } + + _attribute_map = { + 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, + 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, + 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfile, self).__init__(**kwargs) + self.service_runtime_subnet_id = kwargs.get('service_runtime_subnet_id', None) + self.app_subnet_id = kwargs.get('app_subnet_id', None) + self.service_cidr = kwargs.get('service_cidr', None) + self.service_runtime_network_resource_group = kwargs.get('service_runtime_network_resource_group', None) + self.app_network_resource_group = kwargs.get('app_network_resource_group', None) + self.outbound_ips = None + self.required_traffics = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, **kwargs): + super(OperationDetail, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = kwargs.get('service_specification', None) + + +class PersistentDisk(Model): + """Persistent disk payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param size_in_gb: Size of the persistent disk in GB + :type size_in_gb: int + :ivar used_in_gb: Size of the used persistent disk in GB + :vartype used_in_gb: int + :param mount_path: Mount path of the persistent disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 50, 'minimum': 0}, + 'used_in_gb': {'readonly': True, 'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'used_in_gb': {'key': 'usedInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PersistentDisk, self).__init__(**kwargs) + self.size_in_gb = kwargs.get('size_in_gb', None) + self.used_in_gb = None + self.mount_path = kwargs.get('mount_path', None) + + +class RegenerateTestKeyRequestPayload(Model): + """Regenerate test key request payload. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegenerateTestKeyRequestPayload, self).__init__(**kwargs) + self.key_type = kwargs.get('key_type', None) + + +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + +class ResourceRequests(Model): + """Deployment resource request payload. + + :param cpu: Required CPU. 1 core can be represented by 1 or 1000m. This + should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard + tier. + :type cpu: str + :param memory: Required memory. 1 GB can be represented by 1Gi or 1024Mi. + This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, + ..., 8Gi} for Standard tier. + :type memory: str + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'str'}, + 'memory': {'key': 'memory', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceRequests, self).__init__(**kwargs) + self.cpu = kwargs.get('cpu', None) + self.memory = kwargs.get('memory', None) + + +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuCapacity + :param locations: Gets the set of locations that the SKU is available. + :type locations: list[str] + :param location_info: Gets a list of locations and availability zones in + those locations where the SKU is available. + :type location_info: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuLocationInfo] + :param restrictions: Gets the restrictions because of which SKU cannot be + used. This is + empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictions] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.location_info = kwargs.get('location_info', None) + self.restrictions = kwargs.get('restrictions', None) + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class ResourceSkuLocationInfo(Model): + """Locations and availability zones where the SKU is available. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) + self.zone_details = kwargs.get('zone_details', None) + + +class ResourceSkuRestrictionInfo(Model): + """Information about the restriction where the SKU cannot be used. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.zones = kwargs.get('zones', None) + + +class ResourceSkuRestrictions(Model): + """Restrictions where the SKU cannot be used. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionInfo + :param reason_code: Gets the reason for restriction. Possible values + include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsReasonCode + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.values = kwargs.get('values', None) + self.restriction_info = kwargs.get('restriction_info', None) + self.reason_code = kwargs.get('reason_code', None) + + +class ResourceSkuZoneDetails(Model): + """Details of capabilities available to a SKU in specific zones. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capabilities = kwargs.get('capabilities', None) + + +class ResourceUploadDefinition(Model): + """Resource upload definition payload. + + :param relative_path: Source relative path + :type relative_path: str + :param upload_url: Upload URL + :type upload_url: str + """ + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceUploadDefinition, self).__init__(**kwargs) + self.relative_path = kwargs.get('relative_path', None) + self.upload_url = kwargs.get('upload_url', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class ServiceResource(TrackedResource): + """Service resource. + + 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 location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param properties: Properties of the Service resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(ServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) + self.metric_specifications = kwargs.get('metric_specifications', None) + + +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku. Default value: "S0" . + :type name: str + :param tier: Tier of the Sku. Default value: "Standard" . + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', "S0") + self.tier = kwargs.get('tier', "Standard") + self.capacity = kwargs.get('capacity', None) + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.platform = kwargs.get('platform', None) + self.version = kwargs.get('version', None) + + +class TemporaryDisk(Model): + """Temporary disk payload. + + :param size_in_gb: Size of the temporary disk in GB + :type size_in_gb: int + :param mount_path: Mount path of the temporary disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 5, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TemporaryDisk, self).__init__(**kwargs) + self.size_in_gb = kwargs.get('size_in_gb', None) + self.mount_path = kwargs.get('mount_path', None) + + +class TestKeys(Model): + """Test keys payload. + + :param primary_key: Primary key + :type primary_key: str + :param secondary_key: Secondary key + :type secondary_key: str + :param primary_test_endpoint: Primary test endpoint + :type primary_test_endpoint: str + :param secondary_test_endpoint: Secondary test endpoint + :type secondary_test_endpoint: str + :param enabled: Indicates whether the test endpoint feature enabled or not + :type enabled: bool + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'primary_test_endpoint': {'key': 'primaryTestEndpoint', 'type': 'str'}, + 'secondary_test_endpoint': {'key': 'secondaryTestEndpoint', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(TestKeys, self).__init__(**kwargs) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.primary_test_endpoint = kwargs.get('primary_test_endpoint', None) + self.secondary_test_endpoint = kwargs.get('secondary_test_endpoint', None) + self.enabled = kwargs.get('enabled', None) + + +class UserSourceInfo(Model): + """Source information for a deployment. + + :param type: Type of the source uploaded. Possible values include: 'Jar', + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceType + :param relative_path: Relative path of the storage which stores the source + :type relative_path: str + :param version: Version of the source + :type version: str + :param artifact_selector: Selector for the artifact to be used for the + deployment for multi-module projects. This should be + the relative path to the target module/project. + :type artifact_selector: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'artifact_selector': {'key': 'artifactSelector', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserSourceInfo, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.relative_path = kwargs.get('relative_path', None) + self.version = kwargs.get('version', None) + self.artifact_selector = kwargs.get('artifact_selector', None) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py new file mode 100644 index 00000000000..7c2b795d22e --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py @@ -0,0 +1,2160 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class ApplicationInsightsAgentVersions(Model): + """Application Insights agent versions properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar java: Indicates the version of application insight java agent + :vartype java: str + """ + + _validation = { + 'java': {'readonly': True}, + } + + _attribute_map = { + 'java': {'key': 'java', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ApplicationInsightsAgentVersions, self).__init__(**kwargs) + self.java = None + + +class Resource(Model): + """The core properties of ARM resources. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class AppResource(ProxyResource): + """App 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 App resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProperties + :param identity: The Managed Identity type of the app resource + :type identity: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityProperties + :param location: The GEO location of the application, always the same with + its parent resource + :type location: str + """ + + _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': 'AppResourceProperties'}, + 'identity': {'key': 'identity', 'type': 'ManagedIdentityProperties'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, properties=None, identity=None, location: str=None, **kwargs) -> None: + super(AppResource, self).__init__(**kwargs) + self.properties = properties + self.identity = identity + self.location = location + + +class AppResourceProperties(Model): + """App resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param public: Indicates whether the App exposes public endpoint + :type public: bool + :ivar url: URL of the App + :vartype url: str + :ivar provisioning_state: Provisioning state of the App. Possible values + include: 'Succeeded', 'Failed', 'Creating', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.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 + :type temporary_disk: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TemporaryDisk + :param persistent_disk: Persistent disk settings + :type persistent_disk: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.PersistentDisk + :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. + :type enable_end_to_end_tls: bool + """ + + _validation = { + 'url': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'created_time': {'readonly': True}, + } + + _attribute_map = { + 'public': {'key': 'public', 'type': 'bool'}, + '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'}, + 'enable_end_to_end_tls': {'key': 'enableEndToEndTLS', 'type': 'bool'}, + } + + def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: str=None, https_only: bool=None, temporary_disk=None, persistent_disk=None, enable_end_to_end_tls: bool=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 + self.enable_end_to_end_tls = enable_end_to_end_tls + + +class AvailableRuntimeVersions(Model): + """AvailableRuntimeVersions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: A list of all supported runtime versions. + :vartype value: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeVersion] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SupportedRuntimeVersion]'}, + } + + def __init__(self, **kwargs) -> None: + super(AvailableRuntimeVersions, self).__init__(**kwargs) + self.value = None + + +class BindingResource(ProxyResource): + """Binding 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 Binding resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + """ + + _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': 'BindingResourceProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(BindingResource, self).__init__(**kwargs) + self.properties = properties + + +class BindingResourceProperties(Model): + """Binding resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_name: The name of the bound resource + :vartype resource_name: str + :ivar resource_type: The standard Azure resource type of the bound + resource + :vartype resource_type: str + :param resource_id: The Azure resource id of the bound resource + :type resource_id: str + :param key: The key of the bound resource + :type key: str + :param binding_parameters: Binding parameters of the Binding resource + :type binding_parameters: dict[str, object] + :ivar generated_properties: The generated Spring Boot property file for + this binding. The secret will be deducted. + :vartype generated_properties: str + :ivar created_at: Creation time of the Binding resource + :vartype created_at: str + :ivar updated_at: Update time of the Binding resource + :vartype updated_at: str + """ + + _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, + 'generated_properties': {'readonly': True}, + 'created_at': {'readonly': True}, + 'updated_at': {'readonly': True}, + } + + _attribute_map = { + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'str'}, + 'binding_parameters': {'key': 'bindingParameters', 'type': '{object}'}, + 'generated_properties': {'key': 'generatedProperties', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'str'}, + 'updated_at': {'key': 'updatedAt', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, key: str=None, binding_parameters=None, **kwargs) -> None: + super(BindingResourceProperties, self).__init__(**kwargs) + self.resource_name = None + self.resource_type = None + self.resource_id = resource_id + self.key = key + self.binding_parameters = binding_parameters + self.generated_properties = None + self.created_at = None + self.updated_at = None + + +class CertificateProperties(Model): + """Certificate resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar thumbprint: The thumbprint of certificate. + :vartype 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 + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] + """ + + _validation = { + 'thumbprint': {'readonly': True}, + 'vault_uri': {'required': True}, + 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': 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, cert_version: str=None, **kwargs) -> None: + super(CertificateProperties, self).__init__(**kwargs) + self.thumbprint = None + self.vault_uri = vault_uri + self.key_vault_cert_name = key_vault_cert_name + self.cert_version = cert_version + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.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.v2021_03_03_preview.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. + + :param error: An error response from the service. + :type error: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ClusterResourceProperties(Model): + """Service properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: Provisioning state of the Service. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Deleted', + 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ProvisioningState + :param network_profile: Network profile of the Service + :type network_profile: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfile + :ivar version: Version of the Service + :vartype version: int + :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a + created resource + :vartype service_id: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version': {'readonly': True}, + 'service_id': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, + 'version': {'key': 'version', 'type': 'int'}, + 'service_id': {'key': 'serviceId', 'type': 'str'}, + } + + def __init__(self, *, network_profile=None, **kwargs) -> None: + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.network_profile = network_profile + self.version = None + self.service_id = None + + +class ConfigServerGitProperty(Model): + """Property of git. + + All required parameters must be populated in order to send to Azure. + + :param repositories: Repositories of git. + :type repositories: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.GitPatternRepository] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'uri': {'required': True}, + } + + _attribute_map = { + 'repositories': {'key': 'repositories', 'type': '[GitPatternRepository]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, *, uri: str, repositories=None, label: str=None, search_paths=None, username: str=None, password: str=None, host_key: str=None, host_key_algorithm: str=None, private_key: str=None, strict_host_key_checking: bool=None, **kwargs) -> None: + super(ConfigServerGitProperty, self).__init__(**kwargs) + self.repositories = repositories + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class ConfigServerProperties(Model): + """Config server git properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerState + :param error: Error when apply config server settings. + :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :param config_server: Settings of config server. + :type config_server: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettings + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'config_server': {'key': 'configServer', 'type': 'ConfigServerSettings'}, + } + + def __init__(self, *, error=None, config_server=None, **kwargs) -> None: + super(ConfigServerProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = error + self.config_server = config_server + + +class ConfigServerResource(ProxyResource): + """Config Server resource. + + 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 Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + """ + + _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': 'ConfigServerProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ConfigServerResource, self).__init__(**kwargs) + self.properties = properties + + +class ConfigServerSettings(Model): + """The settings of config server. + + :param git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + """ + + _attribute_map = { + 'git_property': {'key': 'gitProperty', 'type': 'ConfigServerGitProperty'}, + } + + def __init__(self, *, git_property=None, **kwargs) -> None: + super(ConfigServerSettings, self).__init__(**kwargs) + self.git_property = git_property + + +class ConfigServerSettingsErrorRecord(Model): + """Error record of the config server settings. + + :param name: The name of the config server settings error record + :type name: str + :param uri: The uri of the config server settings error record + :type uri: str + :param messages: The detail error messages of the record + :type messages: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'messages': {'key': 'messages', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, uri: str=None, messages=None, **kwargs) -> None: + super(ConfigServerSettingsErrorRecord, self).__init__(**kwargs) + self.name = name + self.uri = uri + self.messages = messages + + +class ConfigServerSettingsValidateResult(Model): + """Validation result for config server settings. + + :param is_valid: Indicate if the config server settings are valid + :type is_valid: bool + :param details: The detail validation results + :type details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsErrorRecord] + """ + + _attribute_map = { + 'is_valid': {'key': 'isValid', 'type': 'bool'}, + 'details': {'key': 'details', 'type': '[ConfigServerSettingsErrorRecord]'}, + } + + def __init__(self, *, is_valid: bool=None, details=None, **kwargs) -> None: + super(ConfigServerSettingsValidateResult, self).__init__(**kwargs) + self.is_valid = is_valid + self.details = details + + +class CustomDomainProperties(Model): + """Custom domain of app resource payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param thumbprint: The thumbprint of bound certificate. + :type thumbprint: str + :ivar app_name: The app name of domain. + :vartype app_name: str + :param cert_name: The bound certificate name of domain. + :type cert_name: str + """ + + _validation = { + 'app_name': {'readonly': True}, + } + + _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, cert_name: str=None, **kwargs) -> None: + super(CustomDomainProperties, self).__init__(**kwargs) + self.thumbprint = thumbprint + self.app_name = None + 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.v2021_03_03_preview.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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the deployment instance + :vartype name: str + :ivar status: Status of the deployment instance + :vartype status: str + :ivar reason: Failed reason of the deployment instance + :vartype reason: str + :ivar discovery_status: Discovery status of the deployment instance + :vartype discovery_status: str + :ivar start_time: Start time of the deployment instance + :vartype start_time: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'reason': {'readonly': True}, + 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'discovery_status': {'key': 'discoveryStatus', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DeploymentInstance, self).__init__(**kwargs) + self.name = None + self.status = None + self.reason = None + self.discovery_status = None + self.start_time = None + + +class DeploymentResource(ProxyResource): + """Deployment 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 Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + """ + + _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': 'DeploymentResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, properties=None, sku=None, **kwargs) -> None: + super(DeploymentResource, self).__init__(**kwargs) + self.properties = properties + self.sku = sku + + +class DeploymentResourceProperties(Model): + """Deployment resource properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param source: Uploaded source information of the deployment. + :type source: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceInfo + :ivar app_name: App name of the deployment + :vartype app_name: str + :param deployment_settings: Deployment settings of the Deployment + :type deployment_settings: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentSettings + :ivar provisioning_state: Provisioning state of the Deployment. Possible + values include: 'Creating', 'Updating', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProvisioningState + :ivar status: Status of the Deployment. Possible values include: + 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', + 'Compiling' + :vartype status: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceStatus + :ivar active: Indicates whether the Deployment is active + :vartype active: bool + :ivar created_time: Date time when the resource is created + :vartype created_time: datetime + :ivar instances: Collection of instances belong to the Deployment + :vartype instances: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentInstance] + """ + + _validation = { + 'app_name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'status': {'readonly': True}, + 'active': {'readonly': True}, + 'created_time': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'source': {'key': 'source', 'type': 'UserSourceInfo'}, + 'app_name': {'key': 'appName', 'type': 'str'}, + 'deployment_settings': {'key': 'deploymentSettings', 'type': 'DeploymentSettings'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'active': {'key': 'active', 'type': 'bool'}, + 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, + 'instances': {'key': 'instances', 'type': '[DeploymentInstance]'}, + } + + def __init__(self, *, source=None, deployment_settings=None, **kwargs) -> None: + super(DeploymentResourceProperties, self).__init__(**kwargs) + self.source = source + self.app_name = None + self.deployment_settings = deployment_settings + self.provisioning_state = None + self.status = None + self.active = None + self.created_time = None + self.instances = None + + +class DeploymentSettings(Model): + """Deployment settings payload. + + :param cpu: Required CPU. This should be 1 for Basic tier, and in range + [1, 4] for Standard tier. This is deprecated starting from API version + 2020-03-03-preview. Please use the resourceRequests field to set the CPU + size. Default value: 1 . + :type cpu: int + :param memory_in_gb: Required Memory size in GB. This should be in range + [1, 2] for Basic tier, and in range [1, 8] for Standard tier. This is + deprecated starting from API version 2020-03-03-preview. Please use the + resourceRequests field to set the the memory size. Default value: 1 . + :type memory_in_gb: int + :param resource_requests: The requested resource quantity for required CPU + and Memory. It is recommended that using this field to represent the + required CPU and Memory, the old field cpu and memoryInGB will be + deprecated later. + :type resource_requests: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceRequests + :param jvm_options: JVM parameter + :type jvm_options: str + :param net_core_main_entry_path: The path to the .NET executable relative + to zip root + :type net_core_main_entry_path: str + :param environment_variables: Collection of environment variables + :type environment_variables: dict[str, str] + :param runtime_version: Runtime version. Possible values include: + 'Java_8', 'Java_11', 'NetCore_31' + :type runtime_version: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.RuntimeVersion + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'int'}, + 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, + 'resource_requests': {'key': 'resourceRequests', 'type': 'ResourceRequests'}, + 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, + 'net_core_main_entry_path': {'key': 'netCoreMainEntryPath', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, + } + + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, resource_requests=None, jvm_options: str=None, net_core_main_entry_path: str=None, environment_variables=None, runtime_version=None, **kwargs) -> None: + super(DeploymentSettings, self).__init__(**kwargs) + self.cpu = cpu + self.memory_in_gb = memory_in_gb + self.resource_requests = resource_requests + self.jvm_options = jvm_options + self.net_core_main_entry_path = net_core_main_entry_path + self.environment_variables = environment_variables + self.runtime_version = runtime_version + + +class Error(Model): + """The error code compose of code and message. + + :param code: The code of error. + :type code: str + :param message: The message of error. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class GitPatternRepository(Model): + """Git repository property payload. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the repository + :type name: str + :param pattern: Collection of pattern of the repository + :type pattern: list[str] + :param uri: Required. URI of the repository + :type uri: str + :param label: Label of the repository + :type label: str + :param search_paths: Searching path of the repository + :type search_paths: list[str] + :param username: Username of git repository basic auth. + :type username: str + :param password: Password of git repository basic auth. + :type password: str + :param host_key: Public sshKey of git repository. + :type host_key: str + :param host_key_algorithm: SshKey algorithm of git repository. + :type host_key_algorithm: str + :param private_key: Private sshKey algorithm of git repository. + :type private_key: str + :param strict_host_key_checking: Strict host key checking or not. + :type strict_host_key_checking: bool + """ + + _validation = { + 'name': {'required': True}, + 'uri': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'pattern': {'key': 'pattern', 'type': '[str]'}, + 'uri': {'key': 'uri', 'type': 'str'}, + 'label': {'key': 'label', 'type': 'str'}, + 'search_paths': {'key': 'searchPaths', 'type': '[str]'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + 'host_key': {'key': 'hostKey', 'type': 'str'}, + 'host_key_algorithm': {'key': 'hostKeyAlgorithm', 'type': 'str'}, + 'private_key': {'key': 'privateKey', 'type': 'str'}, + 'strict_host_key_checking': {'key': 'strictHostKeyChecking', 'type': 'bool'}, + } + + def __init__(self, *, name: str, uri: str, pattern=None, label: str=None, search_paths=None, username: str=None, password: str=None, host_key: str=None, host_key_algorithm: str=None, private_key: str=None, strict_host_key_checking: bool=None, **kwargs) -> None: + super(GitPatternRepository, self).__init__(**kwargs) + self.name = name + self.pattern = pattern + self.uri = uri + self.label = label + self.search_paths = search_paths + self.username = username + self.password = password + self.host_key = host_key + self.host_key_algorithm = host_key_algorithm + self.private_key = private_key + self.strict_host_key_checking = strict_host_key_checking + + +class LogFileUrlResponse(Model): + """Log file URL payload. + + All required parameters must be populated in order to send to Azure. + + :param url: Required. URL of the log file + :type url: str + """ + + _validation = { + 'url': {'required': True}, + } + + _attribute_map = { + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__(self, *, url: str, **kwargs) -> None: + super(LogFileUrlResponse, self).__init__(**kwargs) + self.url = url + + +class LogSpecification(Model): + """Specifications of the Log for Azure Monitoring. + + :param name: Name of the log + :type name: str + :param display_name: Localized friendly display name of the log + :type display_name: str + :param blob_duration: Blob duration of the log + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration + + +class ManagedIdentityProperties(Model): + """Managed identity properties retrieved from ARM request headers. + + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityType + :param principal_id: Principal Id + :type principal_id: str + :param tenant_id: Tenant Id + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, principal_id: str=None, tenant_id: str=None, **kwargs) -> None: + super(ManagedIdentityProperties, self).__init__(**kwargs) + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + + +class MetricDimension(Model): + """Specifications of the Dimension of metrics. + + :param name: Name of the dimension + :type name: str + :param display_name: Localized friendly display name of the dimension + :type display_name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, **kwargs) -> None: + super(MetricDimension, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + + +class MetricSpecification(Model): + """Specifications of the Metrics for Azure Monitoring. + + :param name: Name of the metric + :type name: str + :param display_name: Localized friendly display name of the metric + :type display_name: str + :param display_description: Localized friendly description of the metric + :type display_description: str + :param unit: Unit that makes sense for the metric + :type unit: str + :param category: Name of the metric category that the metric belongs to. A + metric can only belong to a single category. + :type category: str + :param aggregation_type: Only provide one value for this field. Valid + values: Average, Minimum, Maximum, Total, Count. + :type aggregation_type: str + :param supported_aggregation_types: Supported aggregation types + :type supported_aggregation_types: list[str] + :param supported_time_grain_types: Supported time grain types + :type supported_time_grain_types: list[str] + :param fill_gap_with_zero: Optional. If set to true, then zero will be + returned for time duration where no metric is emitted/published. + :type fill_gap_with_zero: bool + :param dimensions: Dimensions of the metric + :type dimensions: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricDimension] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'fill_gap_with_zero': {'key': 'fillGapWithZero', 'type': 'bool'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, display_description: str=None, unit: str=None, category: str=None, aggregation_type: str=None, supported_aggregation_types=None, supported_time_grain_types=None, fill_gap_with_zero: bool=None, dimensions=None, **kwargs) -> None: + super(MetricSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.display_description = display_description + self.unit = unit + self.category = category + self.aggregation_type = aggregation_type + self.supported_aggregation_types = supported_aggregation_types + self.supported_time_grain_types = supported_time_grain_types + self.fill_gap_with_zero = fill_gap_with_zero + self.dimensions = dimensions + + +class MonitoringSettingProperties(Model): + """Monitoring Setting properties payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provisioning_state: State of the Monitoring Setting. Possible values + include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :param trace_enabled: Indicates whether enable the trace functionality, + which will be deprecated since api version 2021-03-03-preview. Please + leverage appInsightsInstrumentationKey to indicate if monitoringSettings + enabled or not + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key, null or whitespace include empty will disable + monitoringSettings + :type app_insights_instrumentation_key: str + :param app_insights_sampling_rate: Indicates the sampling rate of + application insight agent, should be in range [0.0, 100.0] + :type app_insights_sampling_rate: float + :param app_insights_agent_versions: Indicates the versions of application + insight agent + :type app_insights_agent_versions: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ApplicationInsightsAgentVersions + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'app_insights_sampling_rate': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'trace_enabled': {'key': 'traceEnabled', 'type': 'bool'}, + 'app_insights_instrumentation_key': {'key': 'appInsightsInstrumentationKey', 'type': 'str'}, + 'app_insights_sampling_rate': {'key': 'appInsightsSamplingRate', 'type': 'float'}, + 'app_insights_agent_versions': {'key': 'appInsightsAgentVersions', 'type': 'ApplicationInsightsAgentVersions'}, + } + + def __init__(self, *, error=None, trace_enabled: bool=None, app_insights_instrumentation_key: str=None, app_insights_sampling_rate: float=None, app_insights_agent_versions=None, **kwargs) -> None: + super(MonitoringSettingProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.error = error + self.trace_enabled = trace_enabled + self.app_insights_instrumentation_key = app_insights_instrumentation_key + self.app_insights_sampling_rate = app_insights_sampling_rate + self.app_insights_agent_versions = app_insights_agent_versions + + +class MonitoringSettingResource(ProxyResource): + """Monitoring Setting resource. + + 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 Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + """ + + _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': 'MonitoringSettingProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MonitoringSettingResource, self).__init__(**kwargs) + self.properties = properties + + +class NameAvailability(Model): + """Name availability result payload. + + :param name_available: Indicates whether the name is available + :type name_available: bool + :param reason: Reason why the name is not available + :type reason: str + :param message: Message why the name is not available + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, name_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(NameAvailability, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class NameAvailabilityParameters(Model): + """Name availability parameters payload. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the resource to check name availability + :type type: str + :param name: Required. Name to be checked + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, type: str, name: str, **kwargs) -> None: + super(NameAvailabilityParameters, self).__init__(**kwargs) + self.type = type + self.name = name + + +class NetworkProfile(Model): + """Service network profile payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param service_runtime_subnet_id: Fully qualified resource Id of the + subnet to host Azure Spring Cloud Service Runtime + :type service_runtime_subnet_id: str + :param app_subnet_id: Fully qualified resource Id of the subnet to host + Azure Spring Cloud Apps + :type app_subnet_id: str + :param service_cidr: Azure Spring Cloud service reserved CIDR + :type service_cidr: str + :param service_runtime_network_resource_group: Name of the resource group + containing network resources of Azure Spring Cloud Service Runtime + :type service_runtime_network_resource_group: str + :param app_network_resource_group: Name of the resource group containing + network resources of Azure Spring Cloud Apps + :type app_network_resource_group: str + :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud + instance. + :vartype outbound_ips: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfileOutboundIPs + :ivar required_traffics: Required inbound or outbound traffics for Azure + Spring Cloud instance. + :vartype required_traffics: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.RequiredTraffic] + """ + + _validation = { + 'outbound_ips': {'readonly': True}, + 'required_traffics': {'readonly': True}, + } + + _attribute_map = { + 'service_runtime_subnet_id': {'key': 'serviceRuntimeSubnetId', 'type': 'str'}, + 'app_subnet_id': {'key': 'appSubnetId', 'type': 'str'}, + 'service_cidr': {'key': 'serviceCidr', 'type': 'str'}, + 'service_runtime_network_resource_group': {'key': 'serviceRuntimeNetworkResourceGroup', 'type': 'str'}, + 'app_network_resource_group': {'key': 'appNetworkResourceGroup', 'type': 'str'}, + 'outbound_ips': {'key': 'outboundIPs', 'type': 'NetworkProfileOutboundIPs'}, + 'required_traffics': {'key': 'requiredTraffics', 'type': '[RequiredTraffic]'}, + } + + def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=None, service_cidr: str=None, service_runtime_network_resource_group: str=None, app_network_resource_group: str=None, **kwargs) -> None: + super(NetworkProfile, self).__init__(**kwargs) + self.service_runtime_subnet_id = service_runtime_subnet_id + self.app_subnet_id = app_subnet_id + self.service_cidr = service_cidr + self.service_runtime_network_resource_group = service_runtime_network_resource_group + self.app_network_resource_group = app_network_resource_group + self.outbound_ips = None + self.required_traffics = None + + +class NetworkProfileOutboundIPs(Model): + """Desired outbound IP resources for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar public_ips: A list of public IP addresses. + :vartype public_ips: list[str] + """ + + _validation = { + 'public_ips': {'readonly': True}, + } + + _attribute_map = { + 'public_ips': {'key': 'publicIPs', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(NetworkProfileOutboundIPs, self).__init__(**kwargs) + self.public_ips = None + + +class OperationDetail(Model): + """Operation detail payload. + + :param name: Name of the operation + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: Display of the operation + :type display: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDisplay + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationProperties + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'OperationProperties'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationDetail, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.properties = properties + + +class OperationDisplay(Model): + """Operation display payload. + + :param provider: Resource provider of the operation + :type provider: str + :param resource: Resource of the operation + :type resource: str + :param operation: Localized friendly name for the operation + :type operation: str + :param description: Localized friendly description for the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationProperties(Model): + """Extra Operation properties. + + :param service_specification: Service specifications of the operation + :type service_specification: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceSpecification + """ + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, service_specification=None, **kwargs) -> None: + super(OperationProperties, self).__init__(**kwargs) + self.service_specification = service_specification + + +class PersistentDisk(Model): + """Persistent disk payload. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param size_in_gb: Size of the persistent disk in GB + :type size_in_gb: int + :ivar used_in_gb: Size of the used persistent disk in GB + :vartype used_in_gb: int + :param mount_path: Mount path of the persistent disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 50, 'minimum': 0}, + 'used_in_gb': {'readonly': True, 'maximum': 50, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'used_in_gb': {'key': 'usedInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, *, size_in_gb: int=None, mount_path: str=None, **kwargs) -> None: + super(PersistentDisk, self).__init__(**kwargs) + self.size_in_gb = size_in_gb + self.used_in_gb = None + self.mount_path = mount_path + + +class RegenerateTestKeyRequestPayload(Model): + """Regenerate test key request payload. + + All required parameters must be populated in order to send to Azure. + + :param key_type: Required. Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + """ + + _validation = { + 'key_type': {'required': True}, + } + + _attribute_map = { + 'key_type': {'key': 'keyType', 'type': 'str'}, + } + + def __init__(self, *, key_type, **kwargs) -> None: + super(RegenerateTestKeyRequestPayload, self).__init__(**kwargs) + self.key_type = key_type + + +class RequiredTraffic(Model): + """Required inbound or outbound traffic for Azure Spring Cloud instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar protocol: The protocol of required traffic + :vartype protocol: str + :ivar port: The port of required traffic + :vartype port: int + :ivar ips: The ip list of required traffic + :vartype ips: list[str] + :ivar fqdns: The FQDN list of required traffic + :vartype fqdns: list[str] + :ivar direction: The direction of required traffic. Possible values + include: 'Inbound', 'Outbound' + :vartype direction: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TrafficDirection + """ + + _validation = { + 'protocol': {'readonly': True}, + 'port': {'readonly': True}, + 'ips': {'readonly': True}, + 'fqdns': {'readonly': True}, + 'direction': {'readonly': True}, + } + + _attribute_map = { + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'ips': {'key': 'ips', 'type': '[str]'}, + 'fqdns': {'key': 'fqdns', 'type': '[str]'}, + 'direction': {'key': 'direction', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RequiredTraffic, self).__init__(**kwargs) + self.protocol = None + self.port = None + self.ips = None + self.fqdns = None + self.direction = None + + +class ResourceRequests(Model): + """Deployment resource request payload. + + :param cpu: Required CPU. 1 core can be represented by 1 or 1000m. This + should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} for Standard + tier. + :type cpu: str + :param memory: Required memory. 1 GB can be represented by 1Gi or 1024Mi. + This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, 1Gi, 2Gi, + ..., 8Gi} for Standard tier. + :type memory: str + """ + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'str'}, + 'memory': {'key': 'memory', 'type': 'str'}, + } + + def __init__(self, *, cpu: str=None, memory: str=None, **kwargs) -> None: + super(ResourceRequests, self).__init__(**kwargs) + self.cpu = cpu + self.memory = memory + + +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuCapacity + :param locations: Gets the set of locations that the SKU is available. + :type locations: list[str] + :param location_info: Gets a list of locations and availability zones in + those locations where the SKU is available. + :type location_info: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuLocationInfo] + :param restrictions: Gets the restrictions because of which SKU cannot be + used. This is + empty if there are no restrictions. + :type restrictions: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictions] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, *, resource_type: str=None, name: str=None, tier: str=None, capacity=None, locations=None, location_info=None, restrictions=None, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.name = name + self.tier = tier + self.capacity = capacity + self.locations = locations + self.location_info = location_info + self.restrictions = restrictions + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = name + self.value = value + + +class ResourceSkuLocationInfo(Model): + """Locations and availability zones where the SKU is available. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, *, location: str=None, zones=None, zone_details=None, **kwargs) -> None: + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + + +class ResourceSkuRestrictionInfo(Model): + """Information about the restriction where the SKU cannot be used. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, locations=None, zones=None, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = locations + self.zones = zones + + +class ResourceSkuRestrictions(Model): + """Restrictions where the SKU cannot be used. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionInfo + :param reason_code: Gets the reason for restriction. Possible values + include: 'QuotaId', 'NotAvailableForSubscription' + :type reason_code: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsReasonCode + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, type=None, values=None, restriction_info=None, reason_code=None, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code + + +class ResourceSkuZoneDetails(Model): + """Details of capabilities available to a SKU in specific zones. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, *, name=None, capabilities=None, **kwargs) -> None: + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = name + self.capabilities = capabilities + + +class ResourceUploadDefinition(Model): + """Resource upload definition payload. + + :param relative_path: Source relative path + :type relative_path: str + :param upload_url: Upload URL + :type upload_url: str + """ + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'upload_url': {'key': 'uploadUrl', 'type': 'str'}, + } + + def __init__(self, *, relative_path: str=None, upload_url: str=None, **kwargs) -> None: + super(ResourceUploadDefinition, self).__init__(**kwargs) + self.relative_path = relative_path + self.upload_url = upload_url + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + +class ServiceResource(TrackedResource): + """Service resource. + + 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 location: The GEO location of the resource. + :type location: str + :param tags: Tags of the service which is a list of key value pairs that + describe the resource. + :type tags: dict[str, str] + :param properties: Properties of the Service resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str=None, tags=None, properties=None, sku=None, **kwargs) -> None: + super(ServiceResource, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties + self.sku = sku + + +class ServiceSpecification(Model): + """Service specification payload. + + :param log_specifications: Specifications of the Log for Azure Monitoring + :type log_specifications: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.LogSpecification] + :param metric_specifications: Specifications of the Metrics for Azure + Monitoring + :type metric_specifications: + list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__(self, *, log_specifications=None, metric_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications + self.metric_specifications = metric_specifications + + +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku. Default value: "S0" . + :type name: str + :param tier: Tier of the Sku. Default value: "Standard" . + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str="S0", tier: str="Standard", capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_type=None, **kwargs) -> None: + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + +class SupportedRuntimeVersion(Model): + """Supported deployment runtime version descriptor. + + :param value: The raw value which could be passed to deployment CRUD + operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' + :type value: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeValue + :param platform: The platform of this runtime version (possible values: + "Java" or ".NET"). Possible values include: 'Java', '.NET Core' + :type platform: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimePlatform + :param version: The detailed version (major.minor) of the platform. + :type version: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'platform': {'key': 'platform', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + } + + def __init__(self, *, value=None, platform=None, version: str=None, **kwargs) -> None: + super(SupportedRuntimeVersion, self).__init__(**kwargs) + self.value = value + self.platform = platform + self.version = version + + +class TemporaryDisk(Model): + """Temporary disk payload. + + :param size_in_gb: Size of the temporary disk in GB + :type size_in_gb: int + :param mount_path: Mount path of the temporary disk + :type mount_path: str + """ + + _validation = { + 'size_in_gb': {'maximum': 5, 'minimum': 0}, + } + + _attribute_map = { + 'size_in_gb': {'key': 'sizeInGB', 'type': 'int'}, + 'mount_path': {'key': 'mountPath', 'type': 'str'}, + } + + def __init__(self, *, size_in_gb: int=None, mount_path: str=None, **kwargs) -> None: + super(TemporaryDisk, self).__init__(**kwargs) + self.size_in_gb = size_in_gb + self.mount_path = mount_path + + +class TestKeys(Model): + """Test keys payload. + + :param primary_key: Primary key + :type primary_key: str + :param secondary_key: Secondary key + :type secondary_key: str + :param primary_test_endpoint: Primary test endpoint + :type primary_test_endpoint: str + :param secondary_test_endpoint: Secondary test endpoint + :type secondary_test_endpoint: str + :param enabled: Indicates whether the test endpoint feature enabled or not + :type enabled: bool + """ + + _attribute_map = { + 'primary_key': {'key': 'primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, + 'primary_test_endpoint': {'key': 'primaryTestEndpoint', 'type': 'str'}, + 'secondary_test_endpoint': {'key': 'secondaryTestEndpoint', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__(self, *, primary_key: str=None, secondary_key: str=None, primary_test_endpoint: str=None, secondary_test_endpoint: str=None, enabled: bool=None, **kwargs) -> None: + super(TestKeys, self).__init__(**kwargs) + self.primary_key = primary_key + self.secondary_key = secondary_key + self.primary_test_endpoint = primary_test_endpoint + self.secondary_test_endpoint = secondary_test_endpoint + self.enabled = enabled + + +class UserSourceInfo(Model): + """Source information for a deployment. + + :param type: Type of the source uploaded. Possible values include: 'Jar', + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceType + :param relative_path: Relative path of the storage which stores the source + :type relative_path: str + :param version: Version of the source + :type version: str + :param artifact_selector: Selector for the artifact to be used for the + deployment for multi-module projects. This should be + the relative path to the target module/project. + :type artifact_selector: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'str'}, + 'artifact_selector': {'key': 'artifactSelector', 'type': 'str'}, + } + + def __init__(self, *, type=None, relative_path: str=None, version: str=None, artifact_selector: str=None, **kwargs) -> None: + super(UserSourceInfo, self).__init__(**kwargs) + self.type = type + self.relative_path = relative_path + self.version = version + self.artifact_selector = artifact_selector diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py new file mode 100644 index 00000000000..b14d56b2177 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ServiceResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`ServiceResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServiceResource]'} + } + + def __init__(self, *args, **kwargs): + + super(ServiceResourcePaged, self).__init__(*args, **kwargs) +class AppResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`AppResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AppResource]'} + } + + def __init__(self, *args, **kwargs): + + super(AppResourcePaged, self).__init__(*args, **kwargs) +class BindingResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`BindingResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BindingResource]'} + } + + 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 + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeploymentResource]'} + } + + def __init__(self, *args, **kwargs): + + super(DeploymentResourcePaged, self).__init__(*args, **kwargs) +class OperationDetailPaged(Paged): + """ + A paging container for iterating over a list of :class:`OperationDetail ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[OperationDetail]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationDetailPaged, self).__init__(*args, **kwargs) +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py new file mode 100644 index 00000000000..0a24a9df9f9 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py @@ -0,0 +1,36 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._services_operations import ServicesOperations +from ._config_servers_operations import ConfigServersOperations +from ._monitoring_settings_operations import MonitoringSettingsOperations +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 +from ._runtime_versions_operations import RuntimeVersionsOperations +from ._skus_operations import SkusOperations + +__all__ = [ + 'ServicesOperations', + 'ConfigServersOperations', + 'MonitoringSettingsOperations', + 'AppsOperations', + 'BindingsOperations', + 'CertificatesOperations', + 'CustomDomainsOperations', + 'DeploymentsOperations', + 'Operations', + 'RuntimeVersionsOperations', + 'SkusOperations', +] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py new file mode 100644 index 00000000000..daa8ca17391 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py @@ -0,0 +1,634 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AppsOperations(object): + """AppsOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, sync_status=None, custom_headers=None, raw=False, **operation_config): + """Get an App and its properties. + + :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 sync_status: Indicates whether sync status + :type sync_status: 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: AppResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + 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') + } + 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', min_length=1) + if sync_status is not None: + query_parameters['syncStatus'] = self._serialize.query("sync_status", sync_status, '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('AppResource', 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}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + # 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') + } + 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', min_length=1) + + # 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(app_resource, 'AppResource') + + # 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, 201, 202]: + 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('AppResource', response) + if response.status_code == 201: + deserialized = self._deserialize('AppResource', response) + if response.status_code == 202: + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new App or update an exiting App. + + :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 app_resource: Parameters for the create or update operation + :type app_resource: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AppResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + # 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') + } + 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', min_length=1) + + # 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, 202, 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 + + def delete( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete an App. + + :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: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.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') + } + 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', min_length=1) + + # 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(app_resource, 'AppResource') + + # 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, 202]: + 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('AppResource', response) + if response.status_code == 202: + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, app_resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting App. + + :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 app_resource: Parameters for the update operation + :type app_resource: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AppResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + app_resource=app_resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AppResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}'} + + def list( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a Service. + + :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 AppResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + :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', min_length=1) + + 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.AppResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps'} + + def get_resource_upload_url( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """Get an resource upload URL for an App, which may be artifacts or source + archive. + + :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: ResourceUploadDefinition or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceUploadDefinition + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_resource_upload_url.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', min_length=1) + + # 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.post(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('ResourceUploadDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_resource_upload_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/getResourceUploadUrl'} + + def validate_domain( + 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.v2021_03_03_preview.models.CustomDomainValidateResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + validate_payload = models.CustomDomainValidatePayload(name=name) + + # Construct URL + url = self.validate_domain.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', min_length=1) + + # 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_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/validateDomain'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py new file mode 100644 index 00000000000..96c3754e5d3 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py @@ -0,0 +1,510 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class BindingsOperations(object): + """BindingsOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, **operation_config): + """Get a Binding and its properties. + + :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 binding_name: The name of the Binding resource. + :type binding_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: BindingResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource 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'), + 'bindingName': self._serialize.url("binding_name", binding_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', min_length=1) + + # 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('BindingResource', 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}/bindings/{bindingName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **operation_config): + binding_resource = models.BindingResource(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'), + 'bindingName': self._serialize.url("binding_name", binding_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', min_length=1) + + # 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(binding_resource, 'BindingResource') + + # 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, 201, 202]: + 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('BindingResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BindingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Binding or update an exiting Binding. + + :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 binding_name: The name of the Binding resource. + :type binding_name: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BindingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'bindingName': self._serialize.url("binding_name", binding_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', min_length=1) + + # 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, 202, 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 + + def delete( + self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Binding. + + :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 binding_name: The name of the Binding resource. + :type binding_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **operation_config): + binding_resource = models.BindingResource(properties=properties) + + # Construct URL + url = self.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'), + 'bindingName': self._serialize.url("binding_name", binding_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', min_length=1) + + # 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(binding_resource, 'BindingResource') + + # 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, 202]: + 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('BindingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Binding. + + :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 binding_name: The name of the Binding resource. + :type binding_name: str + :param properties: Properties of the Binding resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns BindingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + binding_name=binding_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('BindingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} + + def list( + self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in an App. + + :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 BindingResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + :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', min_length=1) + + 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.BindingResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py new file mode 100644 index 00000000000..45d9961025c --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py @@ -0,0 +1,381 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-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.v2021_03_03_preview.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', min_length=1) + + # 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_initial( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, **operation_config): + 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', min_length=1) + + # 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, 201, 202]: + 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 response.status_code == 201: + deserialized = self._deserialize('CertificateResource', response) + if response.status_code == 202: + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, polling=True, **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.v2021_03_03_preview.models.CertificateProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CertificateResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CertificateResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} + + + def _delete_initial( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1) + + # 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, 202, 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 + + def delete( + self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, polling=True, **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: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + certificate_name=certificate_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + 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.v2021_03_03_preview.models.CertificateResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.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', min_length=1) + + 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/v2021_03_03_preview/operations/_config_servers_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py new file mode 100644 index 00000000000..2ddb6805781 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py @@ -0,0 +1,428 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ConfigServersOperations(object): + """ConfigServersOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get the config server and its properties. + + :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: ConfigServerResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource + 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') + } + 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', min_length=1) + + # 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('ConfigServerResource', 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}/configServers/default'} + + + def _update_put_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + config_server_resource = models.ConfigServerResource(properties=properties) + + # Construct URL + url = self.update_put.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', min_length=1) + + # 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(config_server_resource, 'ConfigServerResource') + + # 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, 202]: + 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('ConfigServerResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_put( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the config server. + + :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 properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfigServerResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _update_patch_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + config_server_resource = models.ConfigServerResource(properties=properties) + + # Construct URL + url = self.update_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') + } + 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', min_length=1) + + # 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(config_server_resource, 'ConfigServerResource') + + # 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, 202]: + 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('ConfigServerResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_patch( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the config server. + + :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 properties: Properties of the Config Server resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ConfigServerResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/default'} + + + def _validate_initial( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, **operation_config): + config_server_settings = models.ConfigServerSettings(git_property=git_property) + + # 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') + } + 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', min_length=1) + + # 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(config_server_settings, 'ConfigServerSettings') + + # 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, 202]: + 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('ConfigServerSettingsValidateResult', response) + if response.status_code == 202: + deserialized = self._deserialize('ConfigServerSettingsValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def validate( + self, resource_group_name, service_name, git_property=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Check if the config server settings are valid. + + :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 git_property: Property of git environment. + :type git_property: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ConfigServerSettingsValidateResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsValidateResult]] + :raises: :class:`CloudError` + """ + raw_result = self._validate_initial( + resource_group_name=resource_group_name, + service_name=service_name, + git_property=git_property, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ConfigServerSettingsValidateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configServers/validate'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py new file mode 100644 index 00000000000..2ae109f2081 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py @@ -0,0 +1,510 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-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.v2021_03_03_preview.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', min_length=1) + + # 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_initial( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + 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', min_length=1) + + # 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, 201, 202]: + 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 response.status_code == 201: + deserialized = self._deserialize('CustomDomainResource', response) + if response.status_code == 202: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, polling=True, **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.v2021_03_03_preview.models.CustomDomainProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CustomDomainResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1) + + # 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, 202, 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 + + def delete( + self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, polling=True, **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: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): + domain_resource = models.CustomDomainResource(properties=properties) + + # Construct URL + url = self.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', min_length=1) + + # 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, 202]: + 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 response.status_code == 202: + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, polling=True, **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.v2021_03_03_preview.models.CustomDomainProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns CustomDomainResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + domain_name=domain_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('CustomDomainResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.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.v2021_03_03_preview.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.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', min_length=1) + + 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'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py new file mode 100644 index 00000000000..ef97c15a184 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py @@ -0,0 +1,935 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeploymentsOperations(object): + """DeploymentsOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Get a Deployment and its properties. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_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: DeploymentResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource + 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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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('DeploymentResource', 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}/deployments/{deploymentName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) + + # 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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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(deployment_resource, 'DeploymentResource') + + # 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, 201, 202]: + 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('DeploymentResource', response) + if response.status_code == 201: + deserialized = self._deserialize('DeploymentResource', response) + if response.status_code == 202: + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Deployment or update an exiting Deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + properties=properties, + sku=sku, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + + def _delete_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # 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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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, 202, 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 + + def delete( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + + def _update_initial( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, **operation_config): + deployment_resource = models.DeploymentResource(properties=properties, sku=sku) + + # Construct URL + url = self.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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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(deployment_resource, 'DeploymentResource') + + # 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, 202]: + 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('DeploymentResource', response) + if response.status_code == 202: + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, app_name, deployment_name, properties=None, sku=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param properties: Properties of the Deployment resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeploymentResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + properties=properties, + sku=sku, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeploymentResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}'} + + def list( + self, resource_group_name, service_name, app_name, version=None, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in an App. + + :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 version: Version of the deployments to be listed + :type version: list[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 DeploymentResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + :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', min_length=1) + if version is not None: + query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',') + + 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.DeploymentResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments'} + + def list_for_cluster( + self, resource_group_name, service_name, version=None, custom_headers=None, raw=False, **operation_config): + """List deployments for a certain service. + + :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 version: Version of the deployments to be listed + :type version: list[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 DeploymentResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_for_cluster.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', min_length=1) + if version is not None: + query_parameters['version'] = self._serialize.query("version", version, '[str]', div=',') + + 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.DeploymentResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_for_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments'} + + + def _start_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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 + + def start( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Start the deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/start'} + + + def _stop_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.stop.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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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 + + def stop( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Stop the deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/stop'} + + + def _restart_initial( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.restart.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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + 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 + + def restart( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Restart the deployment. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._restart_initial( + resource_group_name=resource_group_name, + service_name=service_name, + app_name=app_name, + deployment_name=deployment_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + restart.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/restart'} + + def get_log_file_url( + self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **operation_config): + """Get deployment log file URL. + + :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 deployment_name: The name of the Deployment resource. + :type deployment_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: LogFileUrlResponse or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.LogFileUrlResponse + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_log_file_url.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'), + 'deploymentName': self._serialize.url("deployment_name", deployment_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', min_length=1) + + # 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.post(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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogFileUrlResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_log_file_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getLogFileUrl'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py new file mode 100644 index 00000000000..b2aafcf8bde --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py @@ -0,0 +1,322 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class MonitoringSettingsOperations(object): + """MonitoringSettingsOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get the Monitoring Setting and its properties. + + :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: MonitoringSettingResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource + 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') + } + 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', min_length=1) + + # 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('MonitoringSettingResource', 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}/monitoringSettings/default'} + + + def _update_put_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + monitoring_setting_resource = models.MonitoringSettingResource(properties=properties) + + # Construct URL + url = self.update_put.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', min_length=1) + + # 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(monitoring_setting_resource, 'MonitoringSettingResource') + + # 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, 202]: + 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('MonitoringSettingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_put( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the Monitoring Setting. + + :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 properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + MonitoringSettingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_put_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default'} + + + def _update_patch_initial( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, **operation_config): + monitoring_setting_resource = models.MonitoringSettingResource(properties=properties) + + # Construct URL + url = self.update_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') + } + 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', min_length=1) + + # 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(monitoring_setting_resource, 'MonitoringSettingResource') + + # 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, 202]: + 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('MonitoringSettingResource', response) + if response.status_code == 202: + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_patch( + self, resource_group_name, service_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update the Monitoring Setting. + + :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 properties: Properties of the Monitoring Setting resource + :type properties: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + MonitoringSettingResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_patch_initial( + resource_group_name=resource_group_name, + service_name=service_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MonitoringSettingResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/monitoringSettings/default'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py new file mode 100644 index 00000000000..0ea9d79961a --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py @@ -0,0 +1,103 @@ +# 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 Operations(object): + """Operations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available REST API operations of the + Microsoft.AppPlatform provider. + + :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 OperationDetail + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDetailPaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDetail] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + 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.OperationDetailPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.AppPlatform/operations'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py new file mode 100644 index 00000000000..20864fe2415 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py @@ -0,0 +1,93 @@ +# 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 RuntimeVersionsOperations(object): + """RuntimeVersionsOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list_runtime_versions( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available runtime versions supported by + Microsoft.AppPlatform provider. + + :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: AvailableRuntimeVersions or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.AvailableRuntimeVersions + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_runtime_versions.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # 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('AvailableRuntimeVersions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_runtime_versions.metadata = {'url': '/providers/Microsoft.AppPlatform/runtimeVersions'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py new file mode 100644 index 00000000000..beb2c674350 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py @@ -0,0 +1,859 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ServicesOperations(object): + """ServicesOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Get a Service and its properties. + + :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: ServiceResource or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource 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') + } + 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', min_length=1) + + # 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('ServiceResource', 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}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, **operation_config): + # 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') + } + 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', min_length=1) + + # 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(resource, 'ServiceResource') + + # 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, 201, 202]: + 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('ServiceResource', response) + if response.status_code == 201: + deserialized = self._deserialize('ServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a new Service or update an exiting Service. + + :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 resource: Parameters for the create or update operation + :type resource: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + + def _delete_initial( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + # 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') + } + 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', min_length=1) + + # 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 [202, 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 + + def delete( + self, resource_group_name, service_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to delete a Service. + + :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: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + + def _update_initial( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.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') + } + 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', min_length=1) + + # 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(resource, 'ServiceResource') + + # 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, 202]: + 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('ServiceResource', response) + if response.status_code == 202: + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, resource, custom_headers=None, raw=False, polling=True, **operation_config): + """Operation to update an exiting Service. + + :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 resource: Parameters for the update operation + :type resource: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns ServiceResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + resource=resource, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}'} + + def list_test_keys( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """List test keys for a Service. + + :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: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_test_keys.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', min_length=1) + + # 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.post(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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_test_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listTestKeys'} + + def regenerate_test_key( + self, resource_group_name, service_name, key_type, custom_headers=None, raw=False, **operation_config): + """Regenerate a test key for a Service. + + :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 key_type: Type of the test key. Possible values include: + 'Primary', 'Secondary' + :type key_type: str or + ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + :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: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_test_key_request = models.RegenerateTestKeyRequestPayload(key_type=key_type) + + # Construct URL + url = self.regenerate_test_key.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', min_length=1) + + # 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(regenerate_test_key_request, 'RegenerateTestKeyRequestPayload') + + # 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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_test_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/regenerateTestKey'} + + def disable_test_endpoint( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Disable test endpoint functionality for a Service. + + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disable_test_endpoint.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', min_length=1) + + # 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.post(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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + disable_test_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableTestEndpoint'} + + def enable_test_endpoint( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Enable test endpoint functionality for a Service. + + :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: TestKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.enable_test_endpoint.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', min_length=1) + + # 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.post(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('TestKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + enable_test_endpoint.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableTestEndpoint'} + + def check_name_availability( + self, location, type, name, custom_headers=None, raw=False, **operation_config): + """Checks that the resource name is valid and is not already in use. + + :param location: the region + :type location: str + :param type: Type of the resource to check name availability + :type type: str + :param name: Name to be checked + :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: NameAvailability or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.NameAvailability or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + availability_parameters = models.NameAvailabilityParameters(type=type, name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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', min_length=1) + + # 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(availability_parameters, 'NameAvailabilityParameters') + + # 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('NameAvailability', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/locations/{location}/checkNameAvailability'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a subscription. + + :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 ServiceResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, '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', min_length=1) + + 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.ServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/Spring'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Handles requests to list all resources in a resource group. + + :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 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 ServiceResource + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + :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') + } + 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', min_length=1) + + 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.ServiceResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py new file mode 100644 index 00000000000..1e69bd16e71 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py @@ -0,0 +1,106 @@ +# 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 SkusOperations(object): + """SkusOperations 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: The API version to use for this operation. Constant value: "2021-03-03-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-03-03-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available skus of the Microsoft.AppPlatform provider. + + :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 ResourceSku + :rtype: + ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuPaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSku] + :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') + } + 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', min_length=1) + + 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.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/skus'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py new file mode 100644 index 00000000000..ec3b9c5c053 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2021-03-03-preview" + diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/version.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/version.py index a39916c162c..9c644827672 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/version.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.2.0" From c611c8911649b161985f53ee312fc8707916009a Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 7 May 2021 13:52:17 +0800 Subject: [PATCH 02/14] Add support for 0.5 core, 512 Mi resource requests in app deployment --- src/spring-cloud/HISTORY.md | 5 + .../azext_spring_cloud/_client_factory.py | 102 ++++++++-------- .../azext_spring_cloud/_params.py | 16 +-- .../azext_spring_cloud/commands.py | 11 +- src/spring-cloud/azext_spring_cloud/custom.py | 109 ++++++++++-------- src/spring-cloud/setup.py | 2 +- 6 files changed, 138 insertions(+), 107 deletions(-) diff --git a/src/spring-cloud/HISTORY.md b/src/spring-cloud/HISTORY.md index 094631ba8ab..0770e532385 100644 --- a/src/spring-cloud/HISTORY.md +++ b/src/spring-cloud/HISTORY.md @@ -1,5 +1,10 @@ Release History =============== + +2.4.0 +----- +* Add support for 0.5 core, 512 Mi resource requests in app deployment + 2.3.1 ----- * Fix disable-ssl in redis binding. diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index 3e99cbb1e32..719e48c1af4 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -1,49 +1,53 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- -from azure.cli.core.commands.client_factory import get_mgmt_service_client -from azure.cli.core.profiles import ResourceType -from .vendored_sdks.appplatform.v2020_07_01 import AppPlatformManagementClient -from .vendored_sdks.appplatform.v2020_11_01_preview import AppPlatformManagementClient as AppPlatformManagementClient_20201101preview - - -def cf_spring_cloud(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient) - - -def cf_spring_cloud_20201101preview(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20201101preview) - - -def cf_resource_groups(cli_ctx, subscription_id=None): - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, - subscription_id=subscription_id).resource_groups - - -def cf_app_services(cli_ctx, *_): - return cf_spring_cloud(cli_ctx).services - - -def cf_apps(cli_ctx, *_): - return cf_spring_cloud(cli_ctx).apps - - -def cf_deployments(cli_ctx, *_): - return cf_spring_cloud(cli_ctx).deployments - - -def cf_bindings(cli_ctx, *_): - return cf_spring_cloud(cli_ctx).bindings - - -def cf_config_servers(cli_ctx, *_): - return cf_spring_cloud(cli_ctx).config_servers - - -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 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.profiles import ResourceType +from .vendored_sdks.appplatform.v2020_07_01 import AppPlatformManagementClient +from .vendored_sdks.appplatform.v2020_11_01_preview import AppPlatformManagementClient as AppPlatformManagementClient_20201101preview +from .vendored_sdks.appplatform.v2021_03_03_preview import AppPlatformManagementClient as AppPlatformManagementClient_20210303preview + +def cf_spring_cloud(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient) + + +def cf_spring_cloud_20201101preview(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20201101preview) + + +def cf_spring_cloud_20210303preview(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20210303preview) + + +def cf_resource_groups(cli_ctx, subscription_id=None): + return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, + subscription_id=subscription_id).resource_groups + + +def cf_app_services(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).services + + +def cf_apps(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).apps + + +def cf_deployments(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).deployments + + +def cf_bindings(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).bindings + + +def cf_config_servers(cli_ctx, *_): + return cf_spring_cloud(cli_ctx).config_servers + + +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/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 05b39dfcb9c..82df67614b8 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -79,10 +79,10 @@ def load_arguments(self, _): options_list=['--assign-endpoint', c.deprecate(target='--is-public', redirect='--assign-endpoint', hide=True)]) c.argument('assign_identity', arg_type=get_three_state_flag(), help='If true, assign managed service identity.') - c.argument('cpu', type=int, default=1, - help='Number of virtual cpu cores per instance.') - c.argument('memory', type=int, default=1, - help='Number of GB of memory per instance.') + c.argument('cpu', type=str, default="1", + help='CPU resource quantity. Should be 500m or number of CPU cores.') + c.argument('memory', type=str, default="1Gi", + help='Memory resource quantity. Should be 512Mi or #Gi, e.g., 1Gi, 3Gi.') c.argument('instance_count', type=int, default=1, help='Number of instance.', validator=validate_instance_count) @@ -140,8 +140,8 @@ def load_arguments(self, _): c.argument('env', env_type) with self.argument_context('spring-cloud app scale') as c: - c.argument('cpu', type=int, help='Number of virtual cpu cores per instance.') - c.argument('memory', type=int, help='Number of GB of memory per instance.') + c.argument('cpu', type=str, help='CPU resource quantity. Should be 500m or number of CPU cores.') + c.argument('memory', type=str, help='Memory resource quantity. Should be 512Mi or #Gi, e.g., 1Gi, 3Gi.') c.argument('instance_count', type=int, help='Number of instance.', validator=validate_instance_count) for scope in ['spring-cloud app deploy', 'spring-cloud app deployment create']: @@ -160,8 +160,8 @@ def load_arguments(self, _): with self.argument_context('spring-cloud app deployment create') as c: c.argument('skip_clone_settings', help='Create staging deployment will automatically copy settings from production deployment.', action='store_true') - c.argument('cpu', type=int, help='Number of virtual cpu cores per instance.') - c.argument('memory', type=int, help='Number of GB of memory per instance.') + c.argument('cpu', type=str, help='CPU resource quantity. Should be 500m or number of CPU cores.') + c.argument('memory', type=str, help='Memory resource quantity. Should be 512Mi or #Gi, e.g., 1Gi, 3Gi.') c.argument('instance_count', type=int, help='Number of instance.', validator=validate_instance_count) with self.argument_context('spring-cloud app deployment') as c: diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index d0c05339a16..4a53fcb3e3f 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -4,7 +4,12 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -from ._client_factory import (cf_app_services, cf_spring_cloud, cf_spring_cloud_20201101preview, cf_bindings, cf_config_servers) +from ._client_factory import (cf_app_services, + cf_spring_cloud, + cf_spring_cloud_20201101preview, + cf_spring_cloud_20210303preview, + cf_bindings, + cf_config_servers) from ._transformers import (transform_spring_cloud_table_output, transform_app_table_output, transform_spring_cloud_deployment_output, @@ -40,7 +45,7 @@ def load_command_table(self, _): g.custom_command('repo update', 'config_repo_update') g.custom_command('repo list', 'config_repo_list') - with self.command_group('spring-cloud app', client_factory=cf_spring_cloud_20201101preview) as g: + with self.command_group('spring-cloud app', client_factory=cf_spring_cloud_20210303preview) as g: g.custom_command('create', 'app_create') g.custom_command('update', 'app_update') g.custom_command('deploy', 'app_deploy', supports_no_wait=True) @@ -69,7 +74,7 @@ def load_command_table(self, _): deprecate_info=g.deprecate(redirect='az spring-cloud app logs', hide=True)) as g: g.custom_command('tail', 'app_tail_log') - with self.command_group('spring-cloud app deployment', client_factory=cf_spring_cloud) as g: + with self.command_group('spring-cloud app deployment', client_factory=cf_spring_cloud_20210303preview) as g: g.custom_command('create', 'deployment_create', supports_no_wait=True) g.custom_command('list', 'deployment_list', table_transformer=transform_spring_cloud_deployment_output) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index c7b2197d9d6..00f28fbc5a7 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -16,6 +16,7 @@ from knack.util import CLIError from .vendored_sdks.appplatform.v2020_07_01 import models from .vendored_sdks.appplatform.v2020_11_01_preview import models as models_20201101preview +from .vendored_sdks.appplatform.v2021_03_03_preview import models as models_20210303preview from .vendored_sdks.appplatform.v2020_07_01.models import _app_platform_management_client_enums as AppPlatformEnums from .vendored_sdks.appplatform.v2020_11_01_preview import AppPlatformManagementClient as AppPlatformManagementClient_20201101preview from knack.log import get_logger @@ -219,31 +220,33 @@ def app_create(cmd, client, resource_group, service, name, env=None, enable_persistent_storage=None, assign_identity=None): + memory = _unify_memory(memory) apps = _get_all_apps(client, resource_group, service) if name in apps: raise CLIError("App '{}' already exists.".format(name)) logger.warning("[1/4] Creating app with name '{}'".format(name)) - properties = models.AppResourceProperties() - properties.temporary_disk = models.TemporaryDisk( + properties = models_20210303preview.AppResourceProperties() + properties.temporary_disk = models_20210303preview.TemporaryDisk( size_in_gb=5, mount_path="/tmp") resource = client.services.get(resource_group, service) _validate_instance_count(resource.sku.tier, instance_count) - app_resource = models.AppResource() + app_resource = models_20210303preview.AppResource() app_resource.properties = properties app_resource.location = resource.location if assign_identity is True: - app_resource.identity = models.ManagedIdentityProperties(type="systemassigned") + app_resource.identity = models_20210303preview.ManagedIdentityProperties(type="systemassigned") poller = client.apps.create_or_update( resource_group, service, name, app_resource) while poller.done() is False: sleep(APP_CREATE_OR_UPDATE_SLEEP_INTERVAL) - deployment_settings = models.DeploymentSettings( - cpu=cpu, - memory_in_gb=memory, + resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + + deployment_settings = models_20210303preview.DeploymentSettings( + resource_requests=resource_requests, environment_variables=env, jvm_options=jvm_options, net_core_main_entry_path=None, @@ -251,28 +254,29 @@ def app_create(cmd, client, resource_group, service, name, file_type = "NetCoreZip" if runtime_version == AppPlatformEnums.RuntimeVersion.net_core_31 else "Jar" - user_source_info = models.UserSourceInfo( + user_source_info = models_20210303preview.UserSourceInfo( relative_path='', type=file_type) - properties = models.DeploymentResourceProperties( + properties = models_20210303preview.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) # create default deployment logger.warning( "[2/4] Creating default deployment with name '{}'".format(DEFAULT_DEPLOYMENT_NAME)) + sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) poller = client.deployments.create_or_update(resource_group, service, name, DEFAULT_DEPLOYMENT_NAME, properties=properties, - sku=models.Sku(name="S0", tier="STANDARD", capacity=instance_count)) + sku=sku) logger.warning("[3/4] Setting default deployment to production") - properties = models.AppResourceProperties( + properties = models_20210303preview.AppResourceProperties( active_deployment_name=DEFAULT_DEPLOYMENT_NAME, public=assign_endpoint) if enable_persistent_storage: - properties.persistent_disk = models.PersistentDisk( + properties.persistent_disk = models_20210303preview.PersistentDisk( size_in_gb=_get_persistent_disk_size(resource.sku.tier), mount_path="/persistent") else: - properties.persistent_disk = models.PersistentDisk( + properties.persistent_disk = models_20210303preview.PersistentDisk( size_in_gb=0, mount_path="/persistent") app_resource.properties = properties @@ -312,15 +316,15 @@ def app_update(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) location = resource.location - properties = models_20201101preview.AppResourceProperties(public=assign_endpoint, https_only=https_only, + properties = models_20210303preview.AppResourceProperties(public=assign_endpoint, https_only=https_only, enable_end_to_end_tls=enable_end_to_end_tls) if enable_persistent_storage is True: - properties.persistent_disk = models.PersistentDisk( + properties.persistent_disk = models_20210303preview.PersistentDisk( size_in_gb=_get_persistent_disk_size(resource.sku.tier), mount_path="/persistent") if enable_persistent_storage is False: - properties.persistent_disk = models.PersistentDisk(size_in_gb=0) + properties.persistent_disk = models_20210303preview.PersistentDisk(size_in_gb=0) - app_resource = models_20201101preview.AppResource() + app_resource = models_20210303preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -342,14 +346,12 @@ def app_update(cmd, client, resource_group, service, name, return app_updated logger.warning("[2/2] Updating deployment '{}'".format(deployment)) - deployment_settings = models.DeploymentSettings( - cpu=None, - memory_in_gb=None, + deployment_settings = models_20210303preview.DeploymentSettings( environment_variables=env, jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version,) - properties = models.DeploymentResourceProperties( + properties = models_20210303preview.DeploymentResourceProperties( deployment_settings=deployment_settings) poller = client.deployments.update( resource_group, service, name, deployment, properties) @@ -497,6 +499,7 @@ def app_scale(cmd, client, resource_group, service, name, memory=None, instance_count=None, no_wait=False): + memory = _unify_memory(memory) if deployment is None: deployment = client.apps.get( resource_group, service, name).properties.active_deployment_name @@ -507,12 +510,12 @@ def app_scale(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) _validate_instance_count(resource.sku.tier, instance_count) - deployment_settings = models.DeploymentSettings( - cpu=cpu, - memory_in_gb=memory) - properties = models.DeploymentResourceProperties( + resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + + deployment_settings = models_20210303preview.DeploymentSettings(resource_requests=resource_requests) + properties = models_20210303preview.DeploymentResourceProperties( deployment_settings=deployment_settings) - sku = models.Sku(name="S0", tier="STANDARD", capacity=instance_count) + sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) return sdk_no_wait(no_wait, client.deployments.update, resource_group, service, name, deployment, properties=properties, sku=sku) @@ -587,9 +590,9 @@ def app_tail_log(cmd, client, resource_group, service, name, deployment=None, in def app_identity_assign(cmd, client, resource_group, service, name, role=None, scope=None): _check_active_deployment_exist(client, resource_group, service, name) - app_resource = models.AppResource() - identity = models.ManagedIdentityProperties(type="systemassigned") - properties = models.AppResourceProperties() + app_resource = models_20210303preview.AppResource() + identity = models_20210303preview.ManagedIdentityProperties(type="systemassigned") + properties = models_20210303preview.AppResourceProperties() resource = client.services.get(resource_group, service) location = resource.location @@ -631,9 +634,9 @@ def app_identity_assign(cmd, client, resource_group, service, name, role=None, s def app_identity_remove(cmd, client, resource_group, service, name): - app_resource = models.AppResource() - identity = models.ManagedIdentityProperties(type="none") - properties = models.AppResourceProperties() + app_resource = models_20210303preview.AppResource() + identity = models_20210303preview.ManagedIdentityProperties(type="none") + properties = models_20210303preview.AppResourceProperties() resource = client.services.get(resource_group, service) location = resource.location @@ -659,13 +662,13 @@ def app_set_deployment(cmd, client, resource_group, service, name, deployment): if deployment not in deployments: raise CLIError("Deployment '" + deployment + "' not found, please use 'az spring-cloud app deployment create' to create the new deployment") - properties = models.AppResourceProperties( + properties = models_20210303preview.AppResourceProperties( active_deployment_name=deployment) resource = client.services.get(resource_group, service) location = resource.location - app_resource = models.AppResource() + app_resource = models_20210303preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -679,12 +682,12 @@ def app_unset_deployment(cmd, client, resource_group, service, name): raise CLIError(NO_PRODUCTION_DEPLOYMENT_SET_ERROR) # It's designed to use empty string for active_deployment_name to unset active deployment - properties = models.AppResourceProperties(active_deployment_name="") + properties = models_20210303preview.AppResourceProperties(active_deployment_name="") resource = client.services.get(resource_group, service) location = resource.location - app_resource = models.AppResource() + app_resource = models_20210303preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -704,6 +707,7 @@ def deployment_create(cmd, client, resource_group, service, app, name, instance_count=None, env=None, no_wait=False): + memory = _unify_memory(memory) logger.warning(LOG_RUNNING_PROMPT) deployments = _get_all_deployments(client, resource_group, service, app) if name in deployments: @@ -722,14 +726,14 @@ def deployment_create(cmd, client, resource_group, service, app, name, active_deployment = client.deployments.get( resource_group, service, app, active_deployment_name) if active_deployment: - cpu = cpu or active_deployment.properties.deployment_settings.cpu - memory = memory or active_deployment.properties.deployment_settings.memory_in_gb + cpu = cpu or active_deployment.properties.deployment_settings.resource_requests.cpu + memory = memory or active_deployment.properties.deployment_settings.resource_requests.memory instance_count = instance_count or active_deployment.sku.capacity jvm_options = jvm_options or active_deployment.properties.deployment_settings.jvm_options env = env or active_deployment.properties.deployment_settings.environment_variables else: - cpu = cpu or 1 - memory = memory or 1 + cpu = cpu or "1" + memory = memory or "1Gi" instance_count = instance_count or 1 file_type, file_path = _get_upload_local_file(runtime_version, artifact_path) @@ -1252,6 +1256,16 @@ def _get_all_apps(client, resource_group, service): apps = (app.name for app in apps) return apps +def _unify_memory(memory): + if memory is None: + return None + try: + int(memory) + logger.warning("Memory resource quantity [--memory] should be specified with unit, such as 512Mi, 1Gi. " + "Support for integer quantity will be dropped in future release.") + return memory + "Gi" + except ValueError: + return memory # pylint: disable=too-many-locals, no-member def _app_deploy(client, resource_group, service, app, name, version, path, runtime_version, jvm_options, cpu, memory, @@ -1278,20 +1292,23 @@ def _app_deploy(client, resource_group, service, app, name, version, path, runti raise CLIError( "Failed to get a SAS URL to upload context. Error: {}".format(e.message)) - deployment_settings = models.DeploymentSettings( - cpu=cpu, - memory_in_gb=memory, + resource_requests = None + if cpu is not None or memory is not None: + resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + + deployment_settings = models_20210303preview.DeploymentSettings( + resource_requests=resource_requests, environment_variables=env, jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version) - sku = models.Sku(name="S0", tier="STANDARD", capacity=instance_count) - user_source_info = models.UserSourceInfo( + sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) + user_source_info = models_20210303preview.UserSourceInfo( version=version, relative_path=relative_path, type=file_type, artifact_selector=target_module) - properties = models.DeploymentResourceProperties( + properties = models_20210303preview.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) diff --git a/src/spring-cloud/setup.py b/src/spring-cloud/setup.py index f3f04212257..70158d028a6 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 = '2.3.1' +VERSION = '2.4.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 0f938bd5e3f72efa757f45388d35b87660a444b4 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 7 May 2021 18:27:28 +0800 Subject: [PATCH 03/14] Add support to format log streaming of structured JSON output --- src/spring-cloud/HISTORY.md | 1 + .../azext_spring_cloud/_params.py | 2 + src/spring-cloud/azext_spring_cloud/custom.py | 65 ++++++++++++++++--- 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/spring-cloud/HISTORY.md b/src/spring-cloud/HISTORY.md index 0770e532385..cdc9d7cf9dd 100644 --- a/src/spring-cloud/HISTORY.md +++ b/src/spring-cloud/HISTORY.md @@ -4,6 +4,7 @@ Release History 2.4.0 ----- * Add support for 0.5 core, 512 Mi resource requests in app deployment +* Add support to format log streaming of structured JSON output 2.3.1 ----- diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 82df67614b8..a393e51422f 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -112,6 +112,8 @@ def load_arguments(self, _): c.argument('limit', type=int, help='Maximum kilobytes of logs to return. Ceiling number is 2048.', validator=validate_log_limit) 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) + c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger}: {message} {stackTrace}', + help='Format JSON logs if structured log is enabled') with self.argument_context('spring-cloud app log tail') as c: c.argument('instance', options_list=['--instance', '-i'], help='Name of an existing instance of the deployment.') diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 00f28fbc5a7..af2b72ed73f 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -33,6 +33,8 @@ from threading import Thread from threading import Timer import sys +import json +from collections import defaultdict logger = get_logger(__name__) DEFAULT_DEPLOYMENT_NAME = "default" @@ -533,7 +535,8 @@ def app_get_build_log(cmd, client, resource_group, service, name, deployment=Non return stream_logs(client.deployments, resource_group, service, name, deployment) -def app_tail_log(cmd, client, resource_group, service, name, deployment=None, instance=None, follow=False, lines=50, since=None, limit=2048): +def app_tail_log(cmd, client, resource_group, service, name, + deployment=None, instance=None, follow=False, lines=50, since=None, limit=2048, format_json=None): if not instance: if deployment is None: deployment = client.apps.get( @@ -577,7 +580,7 @@ def app_tail_log(cmd, client, resource_group, service, name, deployment=None, in exceptions = [] streaming_url += "?{}".format(parse.urlencode(params)) if params else "" t = Thread(target=_get_app_log, args=( - streaming_url, "primary", primary_key, exceptions)) + streaming_url, "primary", primary_key, format_json, exceptions)) t.daemon = True t.start() @@ -1361,18 +1364,64 @@ def get_logs_loop(): resource_group, service, app, name, properties=properties, sku=sku) -def _get_app_log(url, user_name, password, exceptions): +def _get_app_log(url, user_name, password, format_json, exceptions): + def iter_lines(response, limit=2**20): + ''' + Return a line iterator from the response content. If no line ending was found and the buffered content size is + large than the limit, the buffer will be yielded directly. + ''' + buffer = [] + total = 0 + for content in response.iter_content(chunk_size=None): + if not content: + if len(buffer) > 0: + yield b''.join(buffer) + break + + start = 0 + while start < len(content): + line_end = content.find(b'\n', start) + should_print = False + if line_end < 0: + next = (start == 0 and content or content[start:]) + buffer.append(next) + total += len(next) + start = len(content) + should_print = total >= limit + else: + buffer.append(content[start:line_end+1]) + start = line_end + 1 + should_print = True + + if should_print: + yield b''.join(buffer) + buffer.clear() + total = 0 + + def write_line(line): + ''' + Output formatted output from JSON if applicable, otherwise the line directly. + ''' + if format_json is not None and len(format_json) > 0: + try: + log = json.loads(line) + print(format_json.format_map(defaultdict(str, **log))) + except: + print(line, end='') + else: + print(line, end='') + with requests.get(url, stream=True, auth=HTTPBasicAuth(user_name, password)) as response: try: if response.status_code != 200: raise CLIError("Failed to connect to the server with status code '{}' and reason '{}'".format( response.status_code, response.reason)) std_encoding = sys.stdout.encoding - for content in response.iter_content(): - if content: - sys.stdout.write(content.decode(encoding='utf-8', errors='replace') - .encode(std_encoding, errors='replace') - .decode(std_encoding, errors='replace')) + + for line in iter_lines(response): + decoded = line.decode(encoding='utf-8', errors='replace').encode(std_encoding, errors='replace').decode(std_encoding, errors='replace') + write_line(decoded) + except CLIError as e: exceptions.append(e) From 79175dfa30aed378af6b2f2c093b55988c6297fc Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Sat, 8 May 2021 12:42:12 +0800 Subject: [PATCH 04/14] fix: default logging style --- src/spring-cloud/azext_spring_cloud/_params.py | 2 +- src/spring-cloud/azext_spring_cloud/custom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index a393e51422f..44e5b1b7df9 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -112,7 +112,7 @@ def load_arguments(self, _): c.argument('limit', type=int, help='Maximum kilobytes of logs to return. Ceiling number is 2048.', validator=validate_log_limit) 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) - c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger}: {message} {stackTrace}', + c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger}: {message}\n{stackTrace}', help='Format JSON logs if structured log is enabled') with self.argument_context('spring-cloud app log tail') as c: diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index af2b72ed73f..6b3a1cc663a 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -1405,7 +1405,7 @@ def write_line(line): if format_json is not None and len(format_json) > 0: try: log = json.loads(line) - print(format_json.format_map(defaultdict(str, **log))) + print(format_json.format_map(defaultdict(str, **log)), end='') except: print(line, end='') else: From 10eefe47c13bf81a46a03227917c6d2cb09ba3a5 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Sat, 8 May 2021 14:21:41 +0800 Subject: [PATCH 05/14] Add support to output Spring Boot flavored logger name --- .../azext_spring_cloud/_params.py | 2 +- src/spring-cloud/azext_spring_cloud/custom.py | 80 +++++++++++++++---- 2 files changed, 66 insertions(+), 16 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 44e5b1b7df9..3bf33583c5b 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -112,7 +112,7 @@ def load_arguments(self, _): c.argument('limit', type=int, help='Maximum kilobytes of logs to return. Ceiling number is 2048.', validator=validate_log_limit) 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) - c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger}: {message}\n{stackTrace}', + c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger{39}:<40.40}: {message}\n{stackTrace}', help='Format JSON logs if structured log is enabled') with self.argument_context('spring-cloud app log tail') as c: diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 6b3a1cc663a..55be923e4e5 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -1365,6 +1365,65 @@ def get_logs_loop(): def _get_app_log(url, user_name, password, format_json, exceptions): + logger_seg_regex = re.compile(r'([^\.])[^\.]+\.') + + def shorten_logger(record, length): + ''' + Try shorten the logger property to the specified length before feeding it to the formatter. + ''' + if length <= 0: + raise CLIError('Logger length in `logger{length}` should be positive') + logger = record.get('logger', None) + if logger is None: + return record + + # first, try to shorten the package name to one letter, e.g., + # org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration + # to: o.s.c.n.e.c.DiscoveryClientOptionalArgsConfiguration + while len(logger) > length: + logger, count = logger_seg_regex.subn(r'\1.', logger, 1) + if count < 1: + break + + # then, cut off the leading packages if necessary + logger = logger[-length:] + record['logger'] = logger + return record + + def build_formatter(): + ''' + Build the log line formatter based on the format_json argument. + ''' + nonlocal format_json + if format_json is None or len(format_json) == 0: + return lambda line: line + + logger_regex = re.compile(r'\blogger\{(\d+)\}') + match = logger_regex.search(format_json) + pre_processor = lambda x: x + if match: + length = int(match[1]) + pre_processor = lambda log: shorten_logger(log, length) + format_json = logger_regex.sub('logger', format_json, 1) + + first_exception = True + + def format_line(line): + nonlocal first_exception + try: + log_record = json.loads(line) + # Add n=\n so that in Windows CMD it's easy to specify customized format with line ending + # e.g., "{timestamp} {message}{n}" + # (Windows CMD does not escape \n in string literal.) + return format_json.format_map(pre_processor(defaultdict(str, n="\n", **log_record))) + except: + if first_exception: + logger.exception(f"Failed to format log line '{line}'") + first_exception = False + return line + + return format_line + def iter_lines(response, limit=2**20): ''' Return a line iterator from the response content. If no line ending was found and the buffered content size is @@ -1398,19 +1457,6 @@ def iter_lines(response, limit=2**20): buffer.clear() total = 0 - def write_line(line): - ''' - Output formatted output from JSON if applicable, otherwise the line directly. - ''' - if format_json is not None and len(format_json) > 0: - try: - log = json.loads(line) - print(format_json.format_map(defaultdict(str, **log)), end='') - except: - print(line, end='') - else: - print(line, end='') - with requests.get(url, stream=True, auth=HTTPBasicAuth(user_name, password)) as response: try: if response.status_code != 200: @@ -1418,9 +1464,13 @@ def write_line(line): response.status_code, response.reason)) std_encoding = sys.stdout.encoding + formatter = build_formatter() + for line in iter_lines(response): - decoded = line.decode(encoding='utf-8', errors='replace').encode(std_encoding, errors='replace').decode(std_encoding, errors='replace') - write_line(decoded) + decoded = (line.decode(encoding='utf-8', errors='replace') + .encode(std_encoding, errors='replace') + .decode(std_encoding, errors='replace')) + print(formatter(decoded), end='') except CLIError as e: exceptions.append(e) From cd93f0cdea7dd62d67f2727e828540502e4c1415 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Sat, 8 May 2021 15:10:43 +0800 Subject: [PATCH 06/14] fix style and linter issue in new code --- .../azext_spring_cloud/_client_factory.py | 9 ++- .../azext_spring_cloud/_params.py | 14 ++--- src/spring-cloud/azext_spring_cloud/custom.py | 63 +++++++++++-------- 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index 719e48c1af4..d0cc00995fb 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -5,8 +5,13 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType from .vendored_sdks.appplatform.v2020_07_01 import AppPlatformManagementClient -from .vendored_sdks.appplatform.v2020_11_01_preview import AppPlatformManagementClient as AppPlatformManagementClient_20201101preview -from .vendored_sdks.appplatform.v2021_03_03_preview import AppPlatformManagementClient as AppPlatformManagementClient_20210303preview +from .vendored_sdks.appplatform.v2020_11_01_preview import ( + AppPlatformManagementClient as AppPlatformManagementClient_20201101preview +) +from .vendored_sdks.appplatform.v2021_03_03_preview import ( + AppPlatformManagementClient as AppPlatformManagementClient_20210303preview +) + def cf_spring_cloud(cli_ctx, *_): return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 3bf33583c5b..426798fba89 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -104,7 +104,8 @@ def load_arguments(self, _): c.argument('scope', help="The scope the managed identity has access to") c.argument('role', help="Role name or id the managed identity will be assigned") - with self.argument_context('spring-cloud app logs') as c: + def prepare_logs_argument(c): + '''`app log tail` is deprecated. `app logs` is the new choice. They share the same command processor.''' c.argument('instance', options_list=['--instance', '-i'], help='Name of an existing instance of the deployment.') c.argument('lines', type=int, help='Number of lines to show. Maximum is 10000', validator=validate_log_lines) c.argument('follow', options_list=['--follow ', '-f'], help='Specify if the logs should be streamed.', action='store_true') @@ -115,14 +116,11 @@ def load_arguments(self, _): c.argument('format_json', nargs='?', const='{timestamp} {level:>5} [{thread:>15.15}] {logger{39}:<40.40}: {message}\n{stackTrace}', help='Format JSON logs if structured log is enabled') + with self.argument_context('spring-cloud app logs') as c: + prepare_logs_argument(c) + with self.argument_context('spring-cloud app log tail') as c: - c.argument('instance', options_list=['--instance', '-i'], help='Name of an existing instance of the deployment.') - c.argument('lines', type=int, help='Number of lines to show. Maximum is 10000', validator=validate_log_lines) - c.argument('follow', options_list=['--follow ', '-f'], help='Specify if the logs should be streamed.', action='store_true') - c.argument('since', help='Only return logs newer than a relative duration like 5s, 2m, or 1h. Maximum is 1h', validator=validate_log_since) - c.argument('limit', type=int, help='Maximum kilobytes of logs to return. Ceiling number is 2048.', validator=validate_log_limit) - 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) + prepare_logs_argument(c) with self.argument_context('spring-cloud app set-deployment') as c: c.argument('deployment', options_list=[ diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 55be923e4e5..188ba0e3120 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -18,7 +18,9 @@ from .vendored_sdks.appplatform.v2020_11_01_preview import models as models_20201101preview from .vendored_sdks.appplatform.v2021_03_03_preview import models as models_20210303preview from .vendored_sdks.appplatform.v2020_07_01.models import _app_platform_management_client_enums as AppPlatformEnums -from .vendored_sdks.appplatform.v2020_11_01_preview import AppPlatformManagementClient as AppPlatformManagementClient_20201101preview +from .vendored_sdks.appplatform.v2020_11_01_preview import ( + AppPlatformManagementClient as AppPlatformManagementClient_20201101preview +) from knack.log import get_logger from .azure_storage_file import FileService from azure.cli.core.commands.client_factory import get_mgmt_service_client @@ -1259,6 +1261,7 @@ def _get_all_apps(client, resource_group, service): apps = (app.name for app in apps) return apps + def _unify_memory(memory): if memory is None: return None @@ -1270,6 +1273,7 @@ def _unify_memory(memory): except ValueError: return memory + # pylint: disable=too-many-locals, no-member def _app_deploy(client, resource_group, service, app, name, version, path, runtime_version, jvm_options, cpu, memory, instance_count, @@ -1363,47 +1367,54 @@ def get_logs_loop(): return sdk_no_wait(no_wait, client.deployments.create_or_update, resource_group, service, app, name, properties=properties, sku=sku) - +# pylint: disable=bare-except, too-many-statements def _get_app_log(url, user_name, password, format_json, exceptions): logger_seg_regex = re.compile(r'([^\.])[^\.]+\.') - def shorten_logger(record, length): - ''' - Try shorten the logger property to the specified length before feeding it to the formatter. - ''' + def build_log_shortener(length): if length <= 0: raise CLIError('Logger length in `logger{length}` should be positive') - logger = record.get('logger', None) - if logger is None: - return record + def shortener(record): + ''' + Try shorten the logger property to the specified length before feeding it to the formatter. + ''' + logger_name = record.get('logger', None) + if logger_name is None: + return record + + # first, try to shorten the package name to one letter, e.g., + # org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration + # to: o.s.c.n.e.c.DiscoveryClientOptionalArgsConfiguration + while len(logger_name) > length: + logger_name, count = logger_seg_regex.subn(r'\1.', logger_name, 1) + if count < 1: + break - # first, try to shorten the package name to one letter, e.g., - # org.springframework.cloud.netflix.eureka.config.DiscoveryClientOptionalArgsConfiguration - # to: o.s.c.n.e.c.DiscoveryClientOptionalArgsConfiguration - while len(logger) > length: - logger, count = logger_seg_regex.subn(r'\1.', logger, 1) - if count < 1: - break + # then, cut off the leading packages if necessary + logger_name = logger_name[-length:] + record['logger'] = logger_name + return record - # then, cut off the leading packages if necessary - logger = logger[-length:] - record['logger'] = logger - return record + return shortener def build_formatter(): ''' Build the log line formatter based on the format_json argument. ''' nonlocal format_json + + def identity(o): + return o + if format_json is None or len(format_json) == 0: - return lambda line: line + return identity logger_regex = re.compile(r'\blogger\{(\d+)\}') match = logger_regex.search(format_json) - pre_processor = lambda x: x + pre_processor = identity if match: length = int(match[1]) - pre_processor = lambda log: shorten_logger(log, length) + pre_processor = build_log_shortener(length) format_json = logger_regex.sub('logger', format_json, 1) first_exception = True @@ -1418,7 +1429,7 @@ def format_line(line): return format_json.format_map(pre_processor(defaultdict(str, n="\n", **log_record))) except: if first_exception: - logger.exception(f"Failed to format log line '{line}'") + logger.exception("Failed to format log line '{}'".format(line)) first_exception = False return line @@ -1442,13 +1453,13 @@ def iter_lines(response, limit=2**20): line_end = content.find(b'\n', start) should_print = False if line_end < 0: - next = (start == 0 and content or content[start:]) + next = (content if start == 0 else content[start:]) buffer.append(next) total += len(next) start = len(content) should_print = total >= limit else: - buffer.append(content[start:line_end+1]) + buffer.append(content[start:line_end + 1]) start = line_end + 1 should_print = True From 0068a06c2ec8f463314b8f29b47cb8c05f66de47 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Mon, 10 May 2021 16:36:06 +0800 Subject: [PATCH 07/14] change new api-version from 2021-03-03-preview to 2021-06-01-preview --- .../_app_platform_management_client.py | 72 +++++------ .../__init__.py | 0 .../_app_platform_management_client.py | 24 ++-- .../_configuration.py | 0 .../models/__init__.py | 0 .../_app_platform_management_client_enums.py | 0 .../models/_models.py | 122 +++++++++--------- .../models/_models_py3.py | 122 +++++++++--------- .../models/_paged_models.py | 16 +-- .../operations/__init__.py | 0 .../operations/_apps_operations.py | 24 ++-- .../operations/_bindings_operations.py | 20 +-- .../operations/_certificates_operations.py | 14 +- .../operations/_config_servers_operations.py | 24 ++-- .../operations/_custom_domains_operations.py | 20 +-- .../operations/_deployments_operations.py | 28 ++-- .../_monitoring_settings_operations.py | 18 +-- .../operations/_operations.py | 6 +- .../_runtime_versions_operations.py | 6 +- .../operations/_services_operations.py | 32 ++--- .../operations/_skus_operations.py | 6 +- .../version.py | 2 +- 22 files changed, 278 insertions(+), 278 deletions(-) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/__init__.py (100%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/_app_platform_management_client.py (85%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/_configuration.py (100%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/models/__init__.py (100%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/models/_app_platform_management_client_enums.py (100%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/models/_models.py (95%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/models/_models_py3.py (95%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/models/_paged_models.py (88%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/__init__.py (100%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_apps_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_bindings_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_certificates_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_config_servers_operations.py (95%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_custom_domains_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_deployments_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_monitoring_settings_operations.py (95%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_operations.py (94%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_runtime_versions_operations.py (96%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_services_operations.py (97%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/operations/_skus_operations.py (95%) rename src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/{v2021_03_03_preview => v2021_06_01_preview}/version.py (93%) 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 e60c3c5d4e0..d2ce20bbe77 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 @@ -76,7 +76,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-05-01-preview: :mod:`v2019_05_01_preview.models` * 2020-07-01: :mod:`v2020_07_01.models` * 2020-11-01-preview: :mod:`v2020_11_01_preview.models` - * 2021-03-03-preview: :mod:`v2021_03_03_preview.models` + * 2021-06-01-preview: :mod:`v2021_06_01_preview.models` """ if api_version == '2019-05-01-preview': from .v2019_05_01_preview import models @@ -87,8 +87,8 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-11-01-preview': from .v2020_11_01_preview import models return models - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview import models + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview import models return models raise NotImplementedError("APIVersion {} is not available".format(api_version)) @@ -99,7 +99,7 @@ def apps(self): * 2019-05-01-preview: :class:`AppsOperations` * 2020-07-01: :class:`AppsOperations` * 2020-11-01-preview: :class:`AppsOperations` - * 2021-03-03-preview: :class:`AppsOperations` + * 2021-06-01-preview: :class:`AppsOperations` """ api_version = self._get_api_version('apps') if api_version == '2019-05-01-preview': @@ -108,8 +108,8 @@ def apps(self): from .v2020_07_01.operations import AppsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import AppsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import AppsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import AppsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -121,7 +121,7 @@ def bindings(self): * 2019-05-01-preview: :class:`BindingsOperations` * 2020-07-01: :class:`BindingsOperations` * 2020-11-01-preview: :class:`BindingsOperations` - * 2021-03-03-preview: :class:`BindingsOperations` + * 2021-06-01-preview: :class:`BindingsOperations` """ api_version = self._get_api_version('bindings') if api_version == '2019-05-01-preview': @@ -130,8 +130,8 @@ def bindings(self): from .v2020_07_01.operations import BindingsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import BindingsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import BindingsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import BindingsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -143,7 +143,7 @@ def certificates(self): * 2019-05-01-preview: :class:`CertificatesOperations` * 2020-07-01: :class:`CertificatesOperations` * 2020-11-01-preview: :class:`CertificatesOperations` - * 2021-03-03-preview: :class:`CertificatesOperations` + * 2021-06-01-preview: :class:`CertificatesOperations` """ api_version = self._get_api_version('certificates') if api_version == '2019-05-01-preview': @@ -152,8 +152,8 @@ def certificates(self): from .v2020_07_01.operations import CertificatesOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import CertificatesOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import CertificatesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import CertificatesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -164,15 +164,15 @@ def config_servers(self): * 2020-07-01: :class:`ConfigServersOperations` * 2020-11-01-preview: :class:`ConfigServersOperations` - * 2021-03-03-preview: :class:`ConfigServersOperations` + * 2021-06-01-preview: :class:`ConfigServersOperations` """ api_version = self._get_api_version('config_servers') if api_version == '2020-07-01': from .v2020_07_01.operations import ConfigServersOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import ConfigServersOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import ConfigServersOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import ConfigServersOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -184,7 +184,7 @@ def custom_domains(self): * 2019-05-01-preview: :class:`CustomDomainsOperations` * 2020-07-01: :class:`CustomDomainsOperations` * 2020-11-01-preview: :class:`CustomDomainsOperations` - * 2021-03-03-preview: :class:`CustomDomainsOperations` + * 2021-06-01-preview: :class:`CustomDomainsOperations` """ api_version = self._get_api_version('custom_domains') if api_version == '2019-05-01-preview': @@ -193,8 +193,8 @@ def custom_domains(self): from .v2020_07_01.operations import CustomDomainsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import CustomDomainsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import CustomDomainsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import CustomDomainsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -206,7 +206,7 @@ def deployments(self): * 2019-05-01-preview: :class:`DeploymentsOperations` * 2020-07-01: :class:`DeploymentsOperations` * 2020-11-01-preview: :class:`DeploymentsOperations` - * 2021-03-03-preview: :class:`DeploymentsOperations` + * 2021-06-01-preview: :class:`DeploymentsOperations` """ api_version = self._get_api_version('deployments') if api_version == '2019-05-01-preview': @@ -215,8 +215,8 @@ def deployments(self): from .v2020_07_01.operations import DeploymentsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import DeploymentsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import DeploymentsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import DeploymentsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -227,15 +227,15 @@ def monitoring_settings(self): * 2020-07-01: :class:`MonitoringSettingsOperations` * 2020-11-01-preview: :class:`MonitoringSettingsOperations` - * 2021-03-03-preview: :class:`MonitoringSettingsOperations` + * 2021-06-01-preview: :class:`MonitoringSettingsOperations` """ api_version = self._get_api_version('monitoring_settings') if api_version == '2020-07-01': from .v2020_07_01.operations import MonitoringSettingsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import MonitoringSettingsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import MonitoringSettingsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import MonitoringSettingsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -247,7 +247,7 @@ def operations(self): * 2019-05-01-preview: :class:`Operations` * 2020-07-01: :class:`Operations` * 2020-11-01-preview: :class:`Operations` - * 2021-03-03-preview: :class:`Operations` + * 2021-06-01-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2019-05-01-preview': @@ -256,8 +256,8 @@ def operations(self): from .v2020_07_01.operations import Operations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import Operations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import Operations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import Operations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -269,7 +269,7 @@ def runtime_versions(self): * 2019-05-01-preview: :class:`RuntimeVersionsOperations` * 2020-07-01: :class:`RuntimeVersionsOperations` * 2020-11-01-preview: :class:`RuntimeVersionsOperations` - * 2021-03-03-preview: :class:`RuntimeVersionsOperations` + * 2021-06-01-preview: :class:`RuntimeVersionsOperations` """ api_version = self._get_api_version('runtime_versions') if api_version == '2019-05-01-preview': @@ -278,8 +278,8 @@ def runtime_versions(self): from .v2020_07_01.operations import RuntimeVersionsOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import RuntimeVersionsOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import RuntimeVersionsOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import RuntimeVersionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -291,7 +291,7 @@ def services(self): * 2019-05-01-preview: :class:`ServicesOperations` * 2020-07-01: :class:`ServicesOperations` * 2020-11-01-preview: :class:`ServicesOperations` - * 2021-03-03-preview: :class:`ServicesOperations` + * 2021-06-01-preview: :class:`ServicesOperations` """ api_version = self._get_api_version('services') if api_version == '2019-05-01-preview': @@ -300,8 +300,8 @@ def services(self): from .v2020_07_01.operations import ServicesOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import ServicesOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import ServicesOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import ServicesOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -325,15 +325,15 @@ def skus(self): * 2020-07-01: :class:`SkusOperations` * 2020-11-01-preview: :class:`SkusOperations` - * 2021-03-03-preview: :class:`SkusOperations` + * 2021-06-01-preview: :class:`SkusOperations` """ api_version = self._get_api_version('skus') if api_version == '2020-07-01': from .v2020_07_01.operations import SkusOperations as OperationClass elif api_version == '2020-11-01-preview': from .v2020_11_01_preview.operations import SkusOperations as OperationClass - elif api_version == '2021-03-03-preview': - from .v2021_03_03_preview.operations import SkusOperations as OperationClass + elif api_version == '2021-06-01-preview': + from .v2021_06_01_preview.operations import SkusOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/__init__.py similarity index 100% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/__init__.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/__init__.py diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py similarity index 85% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py index 00f0759c6b2..a057464c518 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_app_platform_management_client.py @@ -34,27 +34,27 @@ class AppPlatformManagementClient(SDKClient): :vartype config: AppPlatformManagementClientConfiguration :ivar services: Services operations - :vartype services: azure.mgmt.appplatform.v2021_03_03_preview.operations.ServicesOperations + :vartype services: azure.mgmt.appplatform.v2021_06_01_preview.operations.ServicesOperations :ivar config_servers: ConfigServers operations - :vartype config_servers: azure.mgmt.appplatform.v2021_03_03_preview.operations.ConfigServersOperations + :vartype config_servers: azure.mgmt.appplatform.v2021_06_01_preview.operations.ConfigServersOperations :ivar monitoring_settings: MonitoringSettings operations - :vartype monitoring_settings: azure.mgmt.appplatform.v2021_03_03_preview.operations.MonitoringSettingsOperations + :vartype monitoring_settings: azure.mgmt.appplatform.v2021_06_01_preview.operations.MonitoringSettingsOperations :ivar apps: Apps operations - :vartype apps: azure.mgmt.appplatform.v2021_03_03_preview.operations.AppsOperations + :vartype apps: azure.mgmt.appplatform.v2021_06_01_preview.operations.AppsOperations :ivar bindings: Bindings operations - :vartype bindings: azure.mgmt.appplatform.v2021_03_03_preview.operations.BindingsOperations + :vartype bindings: azure.mgmt.appplatform.v2021_06_01_preview.operations.BindingsOperations :ivar certificates: Certificates operations - :vartype certificates: azure.mgmt.appplatform.v2021_03_03_preview.operations.CertificatesOperations + :vartype certificates: azure.mgmt.appplatform.v2021_06_01_preview.operations.CertificatesOperations :ivar custom_domains: CustomDomains operations - :vartype custom_domains: azure.mgmt.appplatform.v2021_03_03_preview.operations.CustomDomainsOperations + :vartype custom_domains: azure.mgmt.appplatform.v2021_06_01_preview.operations.CustomDomainsOperations :ivar deployments: Deployments operations - :vartype deployments: azure.mgmt.appplatform.v2021_03_03_preview.operations.DeploymentsOperations + :vartype deployments: azure.mgmt.appplatform.v2021_06_01_preview.operations.DeploymentsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.appplatform.v2021_03_03_preview.operations.Operations + :vartype operations: azure.mgmt.appplatform.v2021_06_01_preview.operations.Operations :ivar runtime_versions: RuntimeVersions operations - :vartype runtime_versions: azure.mgmt.appplatform.v2021_03_03_preview.operations.RuntimeVersionsOperations + :vartype runtime_versions: azure.mgmt.appplatform.v2021_06_01_preview.operations.RuntimeVersionsOperations :ivar skus: Skus operations - :vartype skus: azure.mgmt.appplatform.v2021_03_03_preview.operations.SkusOperations + :vartype skus: azure.mgmt.appplatform.v2021_06_01_preview.operations.SkusOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -73,7 +73,7 @@ def __init__( super(AppPlatformManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2021-03-03-preview' + self.api_version = '2021-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py similarity index 100% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/_configuration.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_configuration.py diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/__init__.py similarity index 100% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/__init__.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/__init__.py diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_app_platform_management_client_enums.py similarity index 100% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_app_platform_management_client_enums.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_app_platform_management_client_enums.py diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models.py similarity index 95% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models.py index 45ff19a0944..e7be2477a24 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models.py @@ -114,10 +114,10 @@ class AppResource(ProxyResource): :vartype type: str :param properties: Properties of the App resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResourceProperties :param identity: The Managed Identity type of the app resource :type identity: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -158,7 +158,7 @@ class AppResourceProperties(Model): :ivar provisioning_state: Provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.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. @@ -169,10 +169,10 @@ class AppResourceProperties(Model): :vartype created_time: datetime :param temporary_disk: Temporary disk settings :type temporary_disk: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TemporaryDisk + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TemporaryDisk :param persistent_disk: Persistent disk settings :type persistent_disk: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.PersistentDisk + ~azure.mgmt.appplatform.v2021_06_01_preview.models.PersistentDisk :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. :type enable_end_to_end_tls: bool """ @@ -218,7 +218,7 @@ class AvailableRuntimeVersions(Model): :ivar value: A list of all supported runtime versions. :vartype value: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeVersion] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimeVersion] """ _validation = { @@ -248,7 +248,7 @@ class BindingResource(ProxyResource): :vartype type: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResourceProperties """ _validation = { @@ -409,7 +409,7 @@ class CertificateResource(ProxyResource): :vartype type: str :param properties: Properties of the certificate resource payload. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateProperties """ _validation = { @@ -435,7 +435,7 @@ class CloudError(Model): :param error: An error response from the service. :type error: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CloudErrorBody """ _attribute_map = { @@ -473,7 +473,7 @@ class CloudErrorBody(Model): :type target: str :param details: A list of additional details about the error. :type details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -501,10 +501,10 @@ class ClusterResourceProperties(Model): values include: 'Creating', 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ProvisioningState :param network_profile: Network profile of the Service :type network_profile: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfile + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NetworkProfile :ivar version: Version of the Service :vartype version: int :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a @@ -540,7 +540,7 @@ class ConfigServerGitProperty(Model): :param repositories: Repositories of git. :type repositories: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.GitPatternRepository] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.GitPatternRepository] :param uri: Required. URI of the repository :type uri: str :param label: Label of the repository @@ -601,12 +601,12 @@ class ConfigServerProperties(Model): :ivar provisioning_state: State of the config server. Possible values include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerState :param error: Error when apply config server settings. - :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :type error: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Error :param config_server: Settings of config server. :type config_server: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettings + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings """ _validation = { @@ -640,7 +640,7 @@ class ConfigServerResource(ProxyResource): :vartype type: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerProperties """ _validation = { @@ -666,7 +666,7 @@ class ConfigServerSettings(Model): :param git_property: Property of git environment. :type git_property: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerGitProperty """ _attribute_map = { @@ -709,7 +709,7 @@ class ConfigServerSettingsValidateResult(Model): :type is_valid: bool :param details: The detail validation results :type details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsErrorRecord] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettingsErrorRecord] """ _attribute_map = { @@ -768,7 +768,7 @@ class CustomDomainResource(ProxyResource): :vartype type: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainProperties """ _validation = { @@ -888,9 +888,9 @@ class DeploymentResource(ProxyResource): :vartype type: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku """ _validation = { @@ -921,28 +921,28 @@ class DeploymentResourceProperties(Model): :param source: Uploaded source information of the deployment. :type source: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceInfo + ~azure.mgmt.appplatform.v2021_06_01_preview.models.UserSourceInfo :ivar app_name: App name of the deployment :vartype app_name: str :param deployment_settings: Deployment settings of the Deployment :type deployment_settings: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentSettings + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentSettings :ivar provisioning_state: Provisioning state of the Deployment. Possible values include: 'Creating', 'Updating', 'Succeeded', 'Failed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProvisioningState :ivar status: Status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling' :vartype status: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceStatus + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceStatus :ivar active: Indicates whether the Deployment is active :vartype active: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :ivar instances: Collection of instances belong to the Deployment :vartype instances: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentInstance] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentInstance] """ _validation = { @@ -982,12 +982,12 @@ class DeploymentSettings(Model): :param cpu: Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard tier. This is deprecated starting from API version - 2020-03-03-preview. Please use the resourceRequests field to set the CPU + 2021-06-01-preview. Please use the resourceRequests field to set the CPU size. Default value: 1 . :type cpu: int :param memory_in_gb: Required Memory size in GB. This should be in range [1, 2] for Basic tier, and in range [1, 8] for Standard tier. This is - deprecated starting from API version 2020-03-03-preview. Please use the + deprecated starting from API version 2021-06-01-preview. Please use the resourceRequests field to set the the memory size. Default value: 1 . :type memory_in_gb: int :param resource_requests: The requested resource quantity for required CPU @@ -995,7 +995,7 @@ class DeploymentSettings(Model): required CPU and Memory, the old field cpu and memoryInGB will be deprecated later. :type resource_requests: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceRequests + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceRequests :param jvm_options: JVM parameter :type jvm_options: str :param net_core_main_entry_path: The path to the .NET executable relative @@ -1006,7 +1006,7 @@ class DeploymentSettings(Model): :param runtime_version: Runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.RuntimeVersion + ~azure.mgmt.appplatform.v2021_06_01_preview.models.RuntimeVersion """ _attribute_map = { @@ -1165,7 +1165,7 @@ class ManagedIdentityProperties(Model): :param type: Type of the managed identity. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ManagedIdentityType :param principal_id: Principal Id :type principal_id: str :param tenant_id: Tenant Id @@ -1231,7 +1231,7 @@ class MetricSpecification(Model): :type fill_gap_with_zero: bool :param dimensions: Dimensions of the metric :type dimensions: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricDimension] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.MetricDimension] """ _attribute_map = { @@ -1270,11 +1270,11 @@ class MonitoringSettingProperties(Model): :ivar provisioning_state: State of the Monitoring Setting. Possible values include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingState :param error: Error when apply Monitoring Setting changes. - :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :type error: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Error :param trace_enabled: Indicates whether enable the trace functionality, - which will be deprecated since api version 2021-03-03-preview. Please + which will be deprecated since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled or not :type trace_enabled: bool @@ -1288,7 +1288,7 @@ class MonitoringSettingProperties(Model): :param app_insights_agent_versions: Indicates the versions of application insight agent :type app_insights_agent_versions: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ApplicationInsightsAgentVersions + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ApplicationInsightsAgentVersions """ _validation = { @@ -1329,7 +1329,7 @@ class MonitoringSettingResource(ProxyResource): :vartype type: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingProperties """ _validation = { @@ -1424,11 +1424,11 @@ class NetworkProfile(Model): :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud instance. :vartype outbound_ips: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfileOutboundIPs + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NetworkProfileOutboundIPs :ivar required_traffics: Required inbound or outbound traffics for Azure Spring Cloud instance. :vartype required_traffics: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.RequiredTraffic] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.RequiredTraffic] """ _validation = { @@ -1489,12 +1489,12 @@ class OperationDetail(Model): :type is_data_action: bool :param display: Display of the operation :type display: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDisplay + ~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDisplay :param origin: Origin of the operation :type origin: str :param properties: Properties of the operation :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationProperties """ _attribute_map = { @@ -1547,7 +1547,7 @@ class OperationProperties(Model): :param service_specification: Service specifications of the operation :type service_specification: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceSpecification + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceSpecification """ _attribute_map = { @@ -1599,7 +1599,7 @@ class RegenerateTestKeyRequestPayload(Model): :param key_type: Required. Type of the test key. Possible values include: 'Primary', 'Secondary' :type key_type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeyType """ _validation = { @@ -1632,7 +1632,7 @@ class RequiredTraffic(Model): :ivar direction: The direction of required traffic. Possible values include: 'Inbound', 'Outbound' :vartype direction: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TrafficDirection + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TrafficDirection """ _validation = { @@ -1695,18 +1695,18 @@ class ResourceSku(Model): :type tier: str :param capacity: Gets the capacity of SKU. :type capacity: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuCapacity + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SkuCapacity :param locations: Gets the set of locations that the SKU is available. :type locations: list[str] :param location_info: Gets a list of locations and availability zones in those locations where the SKU is available. :type location_info: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuLocationInfo] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuLocationInfo] :param restrictions: Gets the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. :type restrictions: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictions] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictions] """ _attribute_map = { @@ -1760,7 +1760,7 @@ class ResourceSkuLocationInfo(Model): :param zone_details: Gets details of capabilities available to a SKU in specific zones. :type zone_details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuZoneDetails] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuZoneDetails] """ _attribute_map = { @@ -1802,7 +1802,7 @@ class ResourceSkuRestrictions(Model): :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionsType :param values: Gets the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. @@ -1810,11 +1810,11 @@ class ResourceSkuRestrictions(Model): :param restriction_info: Gets the information about the restriction where the SKU cannot be used. :type restriction_info: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionInfo + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionInfo :param reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' :type reason_code: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsReasonCode + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionsReasonCode """ _attribute_map = { @@ -1842,7 +1842,7 @@ class ResourceSkuZoneDetails(Model): the SKU in the specified list of zones. :type capabilities: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuCapabilities] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuCapabilities] """ _attribute_map = { @@ -1934,9 +1934,9 @@ class ServiceResource(TrackedResource): :type tags: dict[str, str] :param properties: Properties of the Service resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ClusterResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ClusterResourceProperties :param sku: Sku of the Service resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku """ _validation = { @@ -1966,11 +1966,11 @@ class ServiceSpecification(Model): :param log_specifications: Specifications of the Log for Azure Monitoring :type log_specifications: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.LogSpecification] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.LogSpecification] :param metric_specifications: Specifications of the Metrics for Azure Monitoring :type metric_specifications: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricSpecification] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.MetricSpecification] """ _attribute_map = { @@ -2022,7 +2022,7 @@ class SkuCapacity(Model): :param scale_type: Gets or sets the type of the scale. Possible values include: 'None', 'Manual', 'Automatic' :type scale_type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuScaleType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SkuScaleType """ _validation = { @@ -2050,11 +2050,11 @@ class SupportedRuntimeVersion(Model): :param value: The raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' :type value: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeValue + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimeValue :param platform: The platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core' :type platform: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimePlatform + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimePlatform :param version: The detailed version (major.minor) of the platform. :type version: str """ @@ -2134,7 +2134,7 @@ class UserSourceInfo(Model): :param type: Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.UserSourceType :param relative_path: Relative path of the storage which stores the source :type relative_path: str :param version: Version of the source diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py similarity index 95% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py index 7c2b795d22e..5efc5bf4c4b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_models_py3.py @@ -114,10 +114,10 @@ class AppResource(ProxyResource): :vartype type: str :param properties: Properties of the App resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResourceProperties :param identity: The Managed Identity type of the app resource :type identity: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -158,7 +158,7 @@ class AppResourceProperties(Model): :ivar provisioning_state: Provisioning state of the App. Possible values include: 'Succeeded', 'Failed', 'Creating', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourceProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.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. @@ -169,10 +169,10 @@ class AppResourceProperties(Model): :vartype created_time: datetime :param temporary_disk: Temporary disk settings :type temporary_disk: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TemporaryDisk + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TemporaryDisk :param persistent_disk: Persistent disk settings :type persistent_disk: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.PersistentDisk + ~azure.mgmt.appplatform.v2021_06_01_preview.models.PersistentDisk :param enable_end_to_end_tls: Indicate if end to end TLS is enabled. :type enable_end_to_end_tls: bool """ @@ -218,7 +218,7 @@ class AvailableRuntimeVersions(Model): :ivar value: A list of all supported runtime versions. :vartype value: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeVersion] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimeVersion] """ _validation = { @@ -248,7 +248,7 @@ class BindingResource(ProxyResource): :vartype type: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResourceProperties """ _validation = { @@ -409,7 +409,7 @@ class CertificateResource(ProxyResource): :vartype type: str :param properties: Properties of the certificate resource payload. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateProperties """ _validation = { @@ -435,7 +435,7 @@ class CloudError(Model): :param error: An error response from the service. :type error: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CloudErrorBody """ _attribute_map = { @@ -473,7 +473,7 @@ class CloudErrorBody(Model): :type target: str :param details: A list of additional details about the error. :type details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.CloudErrorBody] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.CloudErrorBody] """ _attribute_map = { @@ -501,10 +501,10 @@ class ClusterResourceProperties(Model): values include: 'Creating', 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ProvisioningState :param network_profile: Network profile of the Service :type network_profile: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfile + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NetworkProfile :ivar version: Version of the Service :vartype version: int :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a @@ -540,7 +540,7 @@ class ConfigServerGitProperty(Model): :param repositories: Repositories of git. :type repositories: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.GitPatternRepository] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.GitPatternRepository] :param uri: Required. URI of the repository :type uri: str :param label: Label of the repository @@ -601,12 +601,12 @@ class ConfigServerProperties(Model): :ivar provisioning_state: State of the config server. Possible values include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerState :param error: Error when apply config server settings. - :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :type error: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Error :param config_server: Settings of config server. :type config_server: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettings + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettings """ _validation = { @@ -640,7 +640,7 @@ class ConfigServerResource(ProxyResource): :vartype type: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerProperties """ _validation = { @@ -666,7 +666,7 @@ class ConfigServerSettings(Model): :param git_property: Property of git environment. :type git_property: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerGitProperty """ _attribute_map = { @@ -709,7 +709,7 @@ class ConfigServerSettingsValidateResult(Model): :type is_valid: bool :param details: The detail validation results :type details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsErrorRecord] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettingsErrorRecord] """ _attribute_map = { @@ -768,7 +768,7 @@ class CustomDomainResource(ProxyResource): :vartype type: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainProperties """ _validation = { @@ -888,9 +888,9 @@ class DeploymentResource(ProxyResource): :vartype type: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku """ _validation = { @@ -921,28 +921,28 @@ class DeploymentResourceProperties(Model): :param source: Uploaded source information of the deployment. :type source: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceInfo + ~azure.mgmt.appplatform.v2021_06_01_preview.models.UserSourceInfo :ivar app_name: App name of the deployment :vartype app_name: str :param deployment_settings: Deployment settings of the Deployment :type deployment_settings: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentSettings + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentSettings :ivar provisioning_state: Provisioning state of the Deployment. Possible values include: 'Creating', 'Updating', 'Succeeded', 'Failed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProvisioningState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProvisioningState :ivar status: Status of the Deployment. Possible values include: 'Unknown', 'Stopped', 'Running', 'Failed', 'Allocating', 'Upgrading', 'Compiling' :vartype status: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceStatus + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceStatus :ivar active: Indicates whether the Deployment is active :vartype active: bool :ivar created_time: Date time when the resource is created :vartype created_time: datetime :ivar instances: Collection of instances belong to the Deployment :vartype instances: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentInstance] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentInstance] """ _validation = { @@ -982,12 +982,12 @@ class DeploymentSettings(Model): :param cpu: Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard tier. This is deprecated starting from API version - 2020-03-03-preview. Please use the resourceRequests field to set the CPU + 2021-06-01-preview. Please use the resourceRequests field to set the CPU size. Default value: 1 . :type cpu: int :param memory_in_gb: Required Memory size in GB. This should be in range [1, 2] for Basic tier, and in range [1, 8] for Standard tier. This is - deprecated starting from API version 2020-03-03-preview. Please use the + deprecated starting from API version 2021-06-01-preview. Please use the resourceRequests field to set the the memory size. Default value: 1 . :type memory_in_gb: int :param resource_requests: The requested resource quantity for required CPU @@ -995,7 +995,7 @@ class DeploymentSettings(Model): required CPU and Memory, the old field cpu and memoryInGB will be deprecated later. :type resource_requests: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceRequests + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceRequests :param jvm_options: JVM parameter :type jvm_options: str :param net_core_main_entry_path: The path to the .NET executable relative @@ -1006,7 +1006,7 @@ class DeploymentSettings(Model): :param runtime_version: Runtime version. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.RuntimeVersion + ~azure.mgmt.appplatform.v2021_06_01_preview.models.RuntimeVersion """ _attribute_map = { @@ -1165,7 +1165,7 @@ class ManagedIdentityProperties(Model): :param type: Type of the managed identity. Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ManagedIdentityType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ManagedIdentityType :param principal_id: Principal Id :type principal_id: str :param tenant_id: Tenant Id @@ -1231,7 +1231,7 @@ class MetricSpecification(Model): :type fill_gap_with_zero: bool :param dimensions: Dimensions of the metric :type dimensions: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricDimension] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.MetricDimension] """ _attribute_map = { @@ -1270,11 +1270,11 @@ class MonitoringSettingProperties(Model): :ivar provisioning_state: State of the Monitoring Setting. Possible values include: 'NotAvailable', 'Failed', 'Succeeded', 'Updating' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingState + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingState :param error: Error when apply Monitoring Setting changes. - :type error: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Error + :type error: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Error :param trace_enabled: Indicates whether enable the trace functionality, - which will be deprecated since api version 2021-03-03-preview. Please + which will be deprecated since api version 2020-11-01-preview. Please leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled or not :type trace_enabled: bool @@ -1288,7 +1288,7 @@ class MonitoringSettingProperties(Model): :param app_insights_agent_versions: Indicates the versions of application insight agent :type app_insights_agent_versions: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ApplicationInsightsAgentVersions + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ApplicationInsightsAgentVersions """ _validation = { @@ -1329,7 +1329,7 @@ class MonitoringSettingResource(ProxyResource): :vartype type: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingProperties """ _validation = { @@ -1424,11 +1424,11 @@ class NetworkProfile(Model): :ivar outbound_ips: Desired outbound IP resources for Azure Spring Cloud instance. :vartype outbound_ips: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.NetworkProfileOutboundIPs + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NetworkProfileOutboundIPs :ivar required_traffics: Required inbound or outbound traffics for Azure Spring Cloud instance. :vartype required_traffics: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.RequiredTraffic] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.RequiredTraffic] """ _validation = { @@ -1489,12 +1489,12 @@ class OperationDetail(Model): :type is_data_action: bool :param display: Display of the operation :type display: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDisplay + ~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDisplay :param origin: Origin of the operation :type origin: str :param properties: Properties of the operation :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationProperties """ _attribute_map = { @@ -1547,7 +1547,7 @@ class OperationProperties(Model): :param service_specification: Service specifications of the operation :type service_specification: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceSpecification + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceSpecification """ _attribute_map = { @@ -1599,7 +1599,7 @@ class RegenerateTestKeyRequestPayload(Model): :param key_type: Required. Type of the test key. Possible values include: 'Primary', 'Secondary' :type key_type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeyType """ _validation = { @@ -1632,7 +1632,7 @@ class RequiredTraffic(Model): :ivar direction: The direction of required traffic. Possible values include: 'Inbound', 'Outbound' :vartype direction: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TrafficDirection + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TrafficDirection """ _validation = { @@ -1695,18 +1695,18 @@ class ResourceSku(Model): :type tier: str :param capacity: Gets the capacity of SKU. :type capacity: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuCapacity + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SkuCapacity :param locations: Gets the set of locations that the SKU is available. :type locations: list[str] :param location_info: Gets a list of locations and availability zones in those locations where the SKU is available. :type location_info: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuLocationInfo] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuLocationInfo] :param restrictions: Gets the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. :type restrictions: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictions] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictions] """ _attribute_map = { @@ -1760,7 +1760,7 @@ class ResourceSkuLocationInfo(Model): :param zone_details: Gets details of capabilities available to a SKU in specific zones. :type zone_details: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuZoneDetails] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuZoneDetails] """ _attribute_map = { @@ -1802,7 +1802,7 @@ class ResourceSkuRestrictions(Model): :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionsType :param values: Gets the value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. @@ -1810,11 +1810,11 @@ class ResourceSkuRestrictions(Model): :param restriction_info: Gets the information about the restriction where the SKU cannot be used. :type restriction_info: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionInfo + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionInfo :param reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' :type reason_code: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuRestrictionsReasonCode + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuRestrictionsReasonCode """ _attribute_map = { @@ -1842,7 +1842,7 @@ class ResourceSkuZoneDetails(Model): the SKU in the specified list of zones. :type capabilities: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuCapabilities] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuCapabilities] """ _attribute_map = { @@ -1934,9 +1934,9 @@ class ServiceResource(TrackedResource): :type tags: dict[str, str] :param properties: Properties of the Service resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ClusterResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ClusterResourceProperties :param sku: Sku of the Service resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku """ _validation = { @@ -1966,11 +1966,11 @@ class ServiceSpecification(Model): :param log_specifications: Specifications of the Log for Azure Monitoring :type log_specifications: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.LogSpecification] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.LogSpecification] :param metric_specifications: Specifications of the Metrics for Azure Monitoring :type metric_specifications: - list[~azure.mgmt.appplatform.v2021_03_03_preview.models.MetricSpecification] + list[~azure.mgmt.appplatform.v2021_06_01_preview.models.MetricSpecification] """ _attribute_map = { @@ -2022,7 +2022,7 @@ class SkuCapacity(Model): :param scale_type: Gets or sets the type of the scale. Possible values include: 'None', 'Manual', 'Automatic' :type scale_type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SkuScaleType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SkuScaleType """ _validation = { @@ -2050,11 +2050,11 @@ class SupportedRuntimeVersion(Model): :param value: The raw value which could be passed to deployment CRUD operations. Possible values include: 'Java_8', 'Java_11', 'NetCore_31' :type value: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimeValue + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimeValue :param platform: The platform of this runtime version (possible values: "Java" or ".NET"). Possible values include: 'Java', '.NET Core' :type platform: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.SupportedRuntimePlatform + ~azure.mgmt.appplatform.v2021_06_01_preview.models.SupportedRuntimePlatform :param version: The detailed version (major.minor) of the platform. :type version: str """ @@ -2134,7 +2134,7 @@ class UserSourceInfo(Model): :param type: Type of the source uploaded. Possible values include: 'Jar', 'NetCoreZip', 'Source' :type type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.UserSourceType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.UserSourceType :param relative_path: Relative path of the storage which stores the source :type relative_path: str :param version: Version of the source diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_paged_models.py similarity index 88% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_paged_models.py index b14d56b2177..a7f5e8da6ab 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/models/_paged_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/models/_paged_models.py @@ -14,7 +14,7 @@ class ServiceResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`ServiceResource ` object + A paging container for iterating over a list of :class:`ServiceResource ` object """ _attribute_map = { @@ -27,7 +27,7 @@ def __init__(self, *args, **kwargs): super(ServiceResourcePaged, self).__init__(*args, **kwargs) class AppResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`AppResource ` object + A paging container for iterating over a list of :class:`AppResource ` object """ _attribute_map = { @@ -40,7 +40,7 @@ def __init__(self, *args, **kwargs): super(AppResourcePaged, self).__init__(*args, **kwargs) class BindingResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`BindingResource ` object + A paging container for iterating over a list of :class:`BindingResource ` object """ _attribute_map = { @@ -53,7 +53,7 @@ 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 + A paging container for iterating over a list of :class:`CertificateResource ` object """ _attribute_map = { @@ -66,7 +66,7 @@ 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 + A paging container for iterating over a list of :class:`CustomDomainResource ` object """ _attribute_map = { @@ -79,7 +79,7 @@ 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 + A paging container for iterating over a list of :class:`DeploymentResource ` object """ _attribute_map = { @@ -92,7 +92,7 @@ def __init__(self, *args, **kwargs): super(DeploymentResourcePaged, self).__init__(*args, **kwargs) class OperationDetailPaged(Paged): """ - A paging container for iterating over a list of :class:`OperationDetail ` object + A paging container for iterating over a list of :class:`OperationDetail ` object """ _attribute_map = { @@ -105,7 +105,7 @@ def __init__(self, *args, **kwargs): super(OperationDetailPaged, self).__init__(*args, **kwargs) class ResourceSkuPaged(Paged): """ - A paging container for iterating over a list of :class:`ResourceSku ` object + A paging container for iterating over a list of :class:`ResourceSku ` object """ _attribute_map = { diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/__init__.py similarity index 100% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/__init__.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/__init__.py diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py index daa8ca17391..bf31ff9bec7 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_apps_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_apps_operations.py @@ -27,7 +27,7 @@ class AppsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -61,7 +61,7 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: AppResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -180,7 +180,7 @@ def create_or_update( :type app_name: str :param app_resource: Parameters for the create or update operation :type app_resource: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -189,9 +189,9 @@ def create_or_update( :return: An instance of LROPoller that returns AppResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -374,7 +374,7 @@ def update( :type app_name: str :param app_resource: Parameters for the update operation :type app_resource: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -383,9 +383,9 @@ def update( :return: An instance of LROPoller that returns AppResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -433,7 +433,7 @@ def list( overrides`. :return: An iterator like instance of AppResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.AppResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.AppResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -510,7 +510,7 @@ def get_resource_upload_url( overrides`. :return: ResourceUploadDefinition or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceUploadDefinition + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceUploadDefinition or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -579,7 +579,7 @@ def validate_domain( overrides`. :return: CustomDomainValidateResult or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainValidateResult + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainValidateResult or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py index 96c3754e5d3..e174262aabf 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_bindings_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_bindings_operations.py @@ -27,7 +27,7 @@ class BindingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -62,7 +62,7 @@ def get( overrides`. :return: BindingResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource or + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -185,7 +185,7 @@ def create_or_update( :type binding_name: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResourceProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -194,9 +194,9 @@ def create_or_update( :return: An instance of LROPoller that returns BindingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -389,7 +389,7 @@ def update( :type binding_name: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResourceProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -398,9 +398,9 @@ def update( :return: An instance of LROPoller that returns BindingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -451,7 +451,7 @@ def list( overrides`. :return: An iterator like instance of BindingResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.BindingResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.BindingResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py index 45d9961025c..bc4a01feace 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_certificates_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_certificates_operations.py @@ -27,7 +27,7 @@ class CertificatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -60,7 +60,7 @@ def get( overrides`. :return: CertificateResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -179,7 +179,7 @@ def create_or_update( :type certificate_name: str :param properties: Properties of the certificate resource payload. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -188,9 +188,9 @@ def create_or_update( :return: An instance of LROPoller that returns CertificateResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -323,7 +323,7 @@ def list( overrides`. :return: An iterator like instance of CertificateResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.CertificateResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.CertificateResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py similarity index 95% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py index 2ddb6805781..d7d77ccf976 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_config_servers_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_config_servers_operations.py @@ -27,7 +27,7 @@ class ConfigServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -58,7 +58,7 @@ def get( overrides`. :return: ConfigServerResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -171,7 +171,7 @@ def update_put( :type service_name: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -180,9 +180,9 @@ def update_put( :return: An instance of LROPoller that returns ConfigServerResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource]] :raises: :class:`CloudError` """ raw_result = self._update_put_initial( @@ -278,7 +278,7 @@ def update_patch( :type service_name: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -287,9 +287,9 @@ def update_patch( :return: An instance of LROPoller that returns ConfigServerResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerResource]] :raises: :class:`CloudError` """ raw_result = self._update_patch_initial( @@ -385,7 +385,7 @@ def validate( :type service_name: str :param git_property: Property of git environment. :type git_property: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerGitProperty + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerGitProperty :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -395,9 +395,9 @@ def validate( ConfigServerSettingsValidateResult or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsValidateResult] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettingsValidateResult] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ConfigServerSettingsValidateResult]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.ConfigServerSettingsValidateResult]] :raises: :class:`CloudError` """ raw_result = self._validate_initial( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py index 2ae109f2081..ea9c40362bf 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_custom_domains_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_custom_domains_operations.py @@ -27,7 +27,7 @@ class CustomDomainsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -62,7 +62,7 @@ def get( overrides`. :return: CustomDomainResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -185,7 +185,7 @@ def create_or_update( :type domain_name: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -194,9 +194,9 @@ def create_or_update( :return: An instance of LROPoller that returns CustomDomainResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -389,7 +389,7 @@ def update( :type domain_name: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -398,9 +398,9 @@ def update( :return: An instance of LROPoller that returns CustomDomainResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -451,7 +451,7 @@ def list( overrides`. :return: An iterator like instance of CustomDomainResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.CustomDomainResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.CustomDomainResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py index ef97c15a184..1ff5f294302 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_deployments_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_deployments_operations.py @@ -27,7 +27,7 @@ class DeploymentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -62,7 +62,7 @@ def get( overrides`. :return: DeploymentResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -185,9 +185,9 @@ def create_or_update( :type deployment_name: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -196,9 +196,9 @@ def create_or_update( :return: An instance of LROPoller that returns DeploymentResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -392,9 +392,9 @@ def update( :type deployment_name: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.v2021_03_03_preview.models.Sku + :type sku: ~azure.mgmt.appplatform.v2021_06_01_preview.models.Sku :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -403,9 +403,9 @@ def update( :return: An instance of LROPoller that returns DeploymentResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -459,7 +459,7 @@ def list( overrides`. :return: An iterator like instance of DeploymentResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -538,7 +538,7 @@ def list_for_cluster( overrides`. :return: An iterator like instance of DeploymentResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.DeploymentResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.DeploymentResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -885,7 +885,7 @@ def get_log_file_url( overrides`. :return: LogFileUrlResponse or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.LogFileUrlResponse + ~azure.mgmt.appplatform.v2021_06_01_preview.models.LogFileUrlResponse or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py similarity index 95% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py index b2aafcf8bde..0bf89fa82af 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_monitoring_settings_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_monitoring_settings_operations.py @@ -27,7 +27,7 @@ class MonitoringSettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -58,7 +58,7 @@ def get( overrides`. :return: MonitoringSettingResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -171,7 +171,7 @@ def update_put( :type service_name: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -181,9 +181,9 @@ def update_put( MonitoringSettingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource]] :raises: :class:`CloudError` """ raw_result = self._update_put_initial( @@ -279,7 +279,7 @@ def update_patch( :type service_name: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingProperties :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -289,9 +289,9 @@ def update_patch( MonitoringSettingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.MonitoringSettingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.MonitoringSettingResource]] :raises: :class:`CloudError` """ raw_result = self._update_patch_initial( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py similarity index 94% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py index 0ea9d79961a..d4951ff128c 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -51,7 +51,7 @@ def list( overrides`. :return: An iterator like instance of OperationDetail :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDetailPaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.OperationDetail] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDetailPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.OperationDetail] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py similarity index 96% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py index 20864fe2415..ff859f927be 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_runtime_versions_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_runtime_versions_operations.py @@ -25,7 +25,7 @@ class RuntimeVersionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -51,7 +51,7 @@ def list_runtime_versions( overrides`. :return: AvailableRuntimeVersions or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.AvailableRuntimeVersions + ~azure.mgmt.appplatform.v2021_06_01_preview.models.AvailableRuntimeVersions or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py similarity index 97% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py index beb2c674350..8372978d908 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_services_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_services_operations.py @@ -27,7 +27,7 @@ class ServicesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -58,7 +58,7 @@ def get( overrides`. :return: ServiceResource or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource or + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -171,7 +171,7 @@ def create_or_update( :type service_name: str :param resource: Parameters for the create or update operation :type resource: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -180,9 +180,9 @@ def create_or_update( :return: An instance of LROPoller that returns ServiceResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -357,7 +357,7 @@ def update( :type service_name: str :param resource: Parameters for the update operation :type resource: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -366,9 +366,9 @@ def update( :return: An instance of LROPoller that returns ServiceResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -414,7 +414,7 @@ def list_test_keys( :param operation_config: :ref:`Operation configuration overrides`. :return: TestKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -474,14 +474,14 @@ def regenerate_test_key( :param key_type: Type of the test key. Possible values include: 'Primary', 'Secondary' :type key_type: str or - ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeyType + ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeyType :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: TestKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -605,7 +605,7 @@ def enable_test_endpoint( :param operation_config: :ref:`Operation configuration overrides`. :return: TestKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.v2021_03_03_preview.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2021_06_01_preview.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -669,7 +669,7 @@ def check_name_availability( overrides`. :return: NameAvailability or ClientRawResponse if raw=true :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.NameAvailability or + ~azure.mgmt.appplatform.v2021_06_01_preview.models.NameAvailability or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -732,7 +732,7 @@ def list_by_subscription( overrides`. :return: An iterator like instance of ServiceResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -802,7 +802,7 @@ def list( overrides`. :return: An iterator like instance of ServiceResource :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ServiceResource] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ServiceResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py similarity index 95% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py index 1e69bd16e71..43af9938c8b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/operations/_skus_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/operations/_skus_operations.py @@ -25,7 +25,7 @@ class SkusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2021-03-03-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2021-06-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2021-03-03-preview" + self.api_version = "2021-06-01-preview" self.config = config @@ -50,7 +50,7 @@ def list( overrides`. :return: An iterator like instance of ResourceSku :rtype: - ~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSkuPaged[~azure.mgmt.appplatform.v2021_03_03_preview.models.ResourceSku] + ~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSkuPaged[~azure.mgmt.appplatform.v2021_06_01_preview.models.ResourceSku] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/version.py similarity index 93% rename from src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py rename to src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/version.py index ec3b9c5c053..a0ac0f4d505 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_03_03_preview/version.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2021-03-03-preview" +VERSION = "2021-06-01-preview" From 20cfeb8dfa1db179d735088ea836687f45e2ce76 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Mon, 10 May 2021 16:42:27 +0800 Subject: [PATCH 08/14] update to use 2021-06-01-preview api-version --- .../azext_spring_cloud/_client_factory.py | 8 +- .../azext_spring_cloud/commands.py | 6 +- src/spring-cloud/azext_spring_cloud/custom.py | 76 +++++++++---------- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index d0cc00995fb..90b0fbb4ec4 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -8,8 +8,8 @@ from .vendored_sdks.appplatform.v2020_11_01_preview import ( AppPlatformManagementClient as AppPlatformManagementClient_20201101preview ) -from .vendored_sdks.appplatform.v2021_03_03_preview import ( - AppPlatformManagementClient as AppPlatformManagementClient_20210303preview +from .vendored_sdks.appplatform.v2021_06_01_preview import ( + AppPlatformManagementClient as AppPlatformManagementClient_20210601preview ) @@ -21,8 +21,8 @@ def cf_spring_cloud_20201101preview(cli_ctx, *_): return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20201101preview) -def cf_spring_cloud_20210303preview(cli_ctx, *_): - return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20210303preview) +def cf_spring_cloud_20210601preview(cli_ctx, *_): + return get_mgmt_service_client(cli_ctx, AppPlatformManagementClient_20210601preview) def cf_resource_groups(cli_ctx, subscription_id=None): diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 4a53fcb3e3f..ef61aed689c 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -7,7 +7,7 @@ from ._client_factory import (cf_app_services, cf_spring_cloud, cf_spring_cloud_20201101preview, - cf_spring_cloud_20210303preview, + cf_spring_cloud_20210601preview, cf_bindings, cf_config_servers) from ._transformers import (transform_spring_cloud_table_output, @@ -45,7 +45,7 @@ def load_command_table(self, _): g.custom_command('repo update', 'config_repo_update') g.custom_command('repo list', 'config_repo_list') - with self.command_group('spring-cloud app', client_factory=cf_spring_cloud_20210303preview) as g: + with self.command_group('spring-cloud app', client_factory=cf_spring_cloud_20210601preview) as g: g.custom_command('create', 'app_create') g.custom_command('update', 'app_update') g.custom_command('deploy', 'app_deploy', supports_no_wait=True) @@ -74,7 +74,7 @@ def load_command_table(self, _): deprecate_info=g.deprecate(redirect='az spring-cloud app logs', hide=True)) as g: g.custom_command('tail', 'app_tail_log') - with self.command_group('spring-cloud app deployment', client_factory=cf_spring_cloud_20210303preview) as g: + with self.command_group('spring-cloud app deployment', client_factory=cf_spring_cloud_20210601preview) as g: g.custom_command('create', 'deployment_create', supports_no_wait=True) g.custom_command('list', 'deployment_list', table_transformer=transform_spring_cloud_deployment_output) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 188ba0e3120..286ea934e96 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -16,7 +16,7 @@ from knack.util import CLIError from .vendored_sdks.appplatform.v2020_07_01 import models from .vendored_sdks.appplatform.v2020_11_01_preview import models as models_20201101preview -from .vendored_sdks.appplatform.v2021_03_03_preview import models as models_20210303preview +from .vendored_sdks.appplatform.v2021_06_01_preview import models as models_20210601preview from .vendored_sdks.appplatform.v2020_07_01.models import _app_platform_management_client_enums as AppPlatformEnums from .vendored_sdks.appplatform.v2020_11_01_preview import ( AppPlatformManagementClient as AppPlatformManagementClient_20201101preview @@ -229,27 +229,27 @@ def app_create(cmd, client, resource_group, service, name, if name in apps: raise CLIError("App '{}' already exists.".format(name)) logger.warning("[1/4] Creating app with name '{}'".format(name)) - properties = models_20210303preview.AppResourceProperties() - properties.temporary_disk = models_20210303preview.TemporaryDisk( + properties = models_20210601preview.AppResourceProperties() + properties.temporary_disk = models_20210601preview.TemporaryDisk( size_in_gb=5, mount_path="/tmp") resource = client.services.get(resource_group, service) _validate_instance_count(resource.sku.tier, instance_count) - app_resource = models_20210303preview.AppResource() + app_resource = models_20210601preview.AppResource() app_resource.properties = properties app_resource.location = resource.location if assign_identity is True: - app_resource.identity = models_20210303preview.ManagedIdentityProperties(type="systemassigned") + app_resource.identity = models_20210601preview.ManagedIdentityProperties(type="systemassigned") poller = client.apps.create_or_update( resource_group, service, name, app_resource) while poller.done() is False: sleep(APP_CREATE_OR_UPDATE_SLEEP_INTERVAL) - resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + resource_requests = models_20210601preview.ResourceRequests(cpu=cpu, memory=memory) - deployment_settings = models_20210303preview.DeploymentSettings( + deployment_settings = models_20210601preview.DeploymentSettings( resource_requests=resource_requests, environment_variables=env, jvm_options=jvm_options, @@ -258,29 +258,29 @@ def app_create(cmd, client, resource_group, service, name, file_type = "NetCoreZip" if runtime_version == AppPlatformEnums.RuntimeVersion.net_core_31 else "Jar" - user_source_info = models_20210303preview.UserSourceInfo( + user_source_info = models_20210601preview.UserSourceInfo( relative_path='', type=file_type) - properties = models_20210303preview.DeploymentResourceProperties( + properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) # create default deployment logger.warning( "[2/4] Creating default deployment with name '{}'".format(DEFAULT_DEPLOYMENT_NAME)) - sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) + sku = models_20210601preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) poller = client.deployments.create_or_update(resource_group, service, name, DEFAULT_DEPLOYMENT_NAME, properties=properties, sku=sku) logger.warning("[3/4] Setting default deployment to production") - properties = models_20210303preview.AppResourceProperties( + properties = models_20210601preview.AppResourceProperties( active_deployment_name=DEFAULT_DEPLOYMENT_NAME, public=assign_endpoint) if enable_persistent_storage: - properties.persistent_disk = models_20210303preview.PersistentDisk( + properties.persistent_disk = models_20210601preview.PersistentDisk( size_in_gb=_get_persistent_disk_size(resource.sku.tier), mount_path="/persistent") else: - properties.persistent_disk = models_20210303preview.PersistentDisk( + properties.persistent_disk = models_20210601preview.PersistentDisk( size_in_gb=0, mount_path="/persistent") app_resource.properties = properties @@ -320,15 +320,15 @@ def app_update(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) location = resource.location - properties = models_20210303preview.AppResourceProperties(public=assign_endpoint, https_only=https_only, + properties = models_20210601preview.AppResourceProperties(public=assign_endpoint, https_only=https_only, enable_end_to_end_tls=enable_end_to_end_tls) if enable_persistent_storage is True: - properties.persistent_disk = models_20210303preview.PersistentDisk( + properties.persistent_disk = models_20210601preview.PersistentDisk( size_in_gb=_get_persistent_disk_size(resource.sku.tier), mount_path="/persistent") if enable_persistent_storage is False: - properties.persistent_disk = models_20210303preview.PersistentDisk(size_in_gb=0) + properties.persistent_disk = models_20210601preview.PersistentDisk(size_in_gb=0) - app_resource = models_20210303preview.AppResource() + app_resource = models_20210601preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -350,12 +350,12 @@ def app_update(cmd, client, resource_group, service, name, return app_updated logger.warning("[2/2] Updating deployment '{}'".format(deployment)) - deployment_settings = models_20210303preview.DeploymentSettings( + deployment_settings = models_20210601preview.DeploymentSettings( environment_variables=env, jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version,) - properties = models_20210303preview.DeploymentResourceProperties( + properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings) poller = client.deployments.update( resource_group, service, name, deployment, properties) @@ -514,12 +514,12 @@ def app_scale(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) _validate_instance_count(resource.sku.tier, instance_count) - resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + resource_requests = models_20210601preview.ResourceRequests(cpu=cpu, memory=memory) - deployment_settings = models_20210303preview.DeploymentSettings(resource_requests=resource_requests) - properties = models_20210303preview.DeploymentResourceProperties( + deployment_settings = models_20210601preview.DeploymentSettings(resource_requests=resource_requests) + properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings) - sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) + sku = models_20210601preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) return sdk_no_wait(no_wait, client.deployments.update, resource_group, service, name, deployment, properties=properties, sku=sku) @@ -595,9 +595,9 @@ def app_tail_log(cmd, client, resource_group, service, name, def app_identity_assign(cmd, client, resource_group, service, name, role=None, scope=None): _check_active_deployment_exist(client, resource_group, service, name) - app_resource = models_20210303preview.AppResource() - identity = models_20210303preview.ManagedIdentityProperties(type="systemassigned") - properties = models_20210303preview.AppResourceProperties() + app_resource = models_20210601preview.AppResource() + identity = models_20210601preview.ManagedIdentityProperties(type="systemassigned") + properties = models_20210601preview.AppResourceProperties() resource = client.services.get(resource_group, service) location = resource.location @@ -639,9 +639,9 @@ def app_identity_assign(cmd, client, resource_group, service, name, role=None, s def app_identity_remove(cmd, client, resource_group, service, name): - app_resource = models_20210303preview.AppResource() - identity = models_20210303preview.ManagedIdentityProperties(type="none") - properties = models_20210303preview.AppResourceProperties() + app_resource = models_20210601preview.AppResource() + identity = models_20210601preview.ManagedIdentityProperties(type="none") + properties = models_20210601preview.AppResourceProperties() resource = client.services.get(resource_group, service) location = resource.location @@ -667,13 +667,13 @@ def app_set_deployment(cmd, client, resource_group, service, name, deployment): if deployment not in deployments: raise CLIError("Deployment '" + deployment + "' not found, please use 'az spring-cloud app deployment create' to create the new deployment") - properties = models_20210303preview.AppResourceProperties( + properties = models_20210601preview.AppResourceProperties( active_deployment_name=deployment) resource = client.services.get(resource_group, service) location = resource.location - app_resource = models_20210303preview.AppResource() + app_resource = models_20210601preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -687,12 +687,12 @@ def app_unset_deployment(cmd, client, resource_group, service, name): raise CLIError(NO_PRODUCTION_DEPLOYMENT_SET_ERROR) # It's designed to use empty string for active_deployment_name to unset active deployment - properties = models_20210303preview.AppResourceProperties(active_deployment_name="") + properties = models_20210601preview.AppResourceProperties(active_deployment_name="") resource = client.services.get(resource_group, service) location = resource.location - app_resource = models_20210303preview.AppResource() + app_resource = models_20210601preview.AppResource() app_resource.properties = properties app_resource.location = location @@ -1301,21 +1301,21 @@ def _app_deploy(client, resource_group, service, app, name, version, path, runti resource_requests = None if cpu is not None or memory is not None: - resource_requests = models_20210303preview.ResourceRequests(cpu=cpu, memory=memory) + resource_requests = models_20210601preview.ResourceRequests(cpu=cpu, memory=memory) - deployment_settings = models_20210303preview.DeploymentSettings( + deployment_settings = models_20210601preview.DeploymentSettings( resource_requests=resource_requests, environment_variables=env, jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version) - sku = models_20210303preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) - user_source_info = models_20210303preview.UserSourceInfo( + sku = models_20210601preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) + user_source_info = models_20210601preview.UserSourceInfo( version=version, relative_path=relative_path, type=file_type, artifact_selector=target_module) - properties = models_20210303preview.DeploymentResourceProperties( + properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) From e3e2426e18795c13708d0560a06b8a4c17ecde22 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 14 May 2021 14:02:15 +0800 Subject: [PATCH 09/14] fix resource quantity validation --- .../azext_spring_cloud/_resource_quantity.py | 34 +++++++++++++++++++ src/spring-cloud/azext_spring_cloud/custom.py | 28 +++++++-------- 2 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 src/spring-cloud/azext_spring_cloud/_resource_quantity.py diff --git a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py new file mode 100644 index 00000000000..7836b774cba --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py @@ -0,0 +1,34 @@ +import re +from knack.util import CLIError +from knack.log import get_logger + +logger = get_logger(__name__) + +def validate_cpu(cpu): + if cpu is None: + return None + + if not re.match(r"^\d+m?$", cpu): + raise CLIError("CPU quantity should be millis (500m) or integer (1, 2, ...)") + + return cpu + + +def validate_memory(memory): + if memory is None: + return None + + unified = memory + try: + # For backward compatibility, to convert integer value to value with Gi unit + int(memory) + logger.warning("Memory quantity [--memory] should be specified with unit, such as 512Mi, 1Gi. " + "Support for integer quantity will be dropped in future release.") + unified = memory + "Gi" + except ValueError: + pass + + if not re.match(r"^\d+[MG]i$", unified): + raise CLIError("Memory quantity should be integer followed by unit (Mi/Gi)") + + return unified diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 286ea934e96..d345325c7fd 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -31,6 +31,7 @@ from azure.cli.core.commands import cached_put from ._utils import _get_rg_location from ._utils import _get_sku_name +from ._resource_quantity import validate_cpu, validate_memory from six.moves.urllib import parse from threading import Thread from threading import Timer @@ -224,7 +225,8 @@ def app_create(cmd, client, resource_group, service, name, env=None, enable_persistent_storage=None, assign_identity=None): - memory = _unify_memory(memory) + cpu = validate_cpu(cpu) + memory = validate_memory(memory) apps = _get_all_apps(client, resource_group, service) if name in apps: raise CLIError("App '{}' already exists.".format(name)) @@ -255,6 +257,8 @@ def app_create(cmd, client, resource_group, service, name, jvm_options=jvm_options, net_core_main_entry_path=None, runtime_version=runtime_version) + deployment_settings.cpu = None + deployment_settings.memory_in_gb = None file_type = "NetCoreZip" if runtime_version == AppPlatformEnums.RuntimeVersion.net_core_31 else "Jar" @@ -503,7 +507,8 @@ def app_scale(cmd, client, resource_group, service, name, memory=None, instance_count=None, no_wait=False): - memory = _unify_memory(memory) + cpu = validate_cpu(cpu) + memory = validate_memory(memory) if deployment is None: deployment = client.apps.get( resource_group, service, name).properties.active_deployment_name @@ -517,6 +522,8 @@ def app_scale(cmd, client, resource_group, service, name, resource_requests = models_20210601preview.ResourceRequests(cpu=cpu, memory=memory) deployment_settings = models_20210601preview.DeploymentSettings(resource_requests=resource_requests) + deployment_settings.cpu = None + deployment_settings.memory_in_gb = None properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings) sku = models_20210601preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) @@ -712,7 +719,8 @@ def deployment_create(cmd, client, resource_group, service, app, name, instance_count=None, env=None, no_wait=False): - memory = _unify_memory(memory) + cpu = validate_cpu(cpu) + memory = validate_memory(memory) logger.warning(LOG_RUNNING_PROMPT) deployments = _get_all_deployments(client, resource_group, service, app) if name in deployments: @@ -1262,18 +1270,6 @@ def _get_all_apps(client, resource_group, service): return apps -def _unify_memory(memory): - if memory is None: - return None - try: - int(memory) - logger.warning("Memory resource quantity [--memory] should be specified with unit, such as 512Mi, 1Gi. " - "Support for integer quantity will be dropped in future release.") - return memory + "Gi" - except ValueError: - return memory - - # pylint: disable=too-many-locals, no-member def _app_deploy(client, resource_group, service, app, name, version, path, runtime_version, jvm_options, cpu, memory, instance_count, @@ -1309,6 +1305,8 @@ def _app_deploy(client, resource_group, service, app, name, version, path, runti jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version) + deployment_settings.cpu = None + deployment_settings.memory_in_gb = None sku = models_20210601preview.Sku(name="S0", tier="STANDARD", capacity=instance_count) user_source_info = models_20210601preview.UserSourceInfo( version=version, From d2c6d9bd720698ce7fa1f30ebcc197fc634d1326 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Thu, 10 Jun 2021 10:55:22 +0800 Subject: [PATCH 10/14] bump the spring-cloud extension version to 2.5.0 --- src/spring-cloud/HISTORY.md | 4 ++++ src/spring-cloud/setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/HISTORY.md b/src/spring-cloud/HISTORY.md index d00ea50bf4a..23b95b759f8 100644 --- a/src/spring-cloud/HISTORY.md +++ b/src/spring-cloud/HISTORY.md @@ -1,6 +1,10 @@ Release History =============== +2.5.0 +----- +* Add support for 0.5 core, 512 Mi resource requests in app deployment + 2.4.0 ----- * Add support to format log streaming of structured JSON output diff --git a/src/spring-cloud/setup.py b/src/spring-cloud/setup.py index 70158d028a6..937d3667156 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 = '2.4.0' +VERSION = '2.5.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 890817e72e0af649240b8d0dd966ac3f2781ad88 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 11 Jun 2021 09:51:03 +0800 Subject: [PATCH 11/14] update according to review comments --- .../azext_spring_cloud/_resource_quantity.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py index 7836b774cba..cc90eb14adb 100644 --- a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py +++ b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py @@ -1,26 +1,36 @@ import re from knack.util import CLIError from knack.log import get_logger +from azure.cli.core.azclierror import InvalidArgumentValueError logger = get_logger(__name__) def validate_cpu(cpu): + ''' + CPU quantity should be either integer, or millis. Currently, 500m (aka 0.5) is the only allowed fractional value. + Note that 1 can be represented as 1000m which is also allowed. + ''' if cpu is None: return None + # some digit(s) followed by an optional m if not re.match(r"^\d+m?$", cpu): - raise CLIError("CPU quantity should be millis (500m) or integer (1, 2, ...)") + raise InvalidArgumentValueError("CPU quantity should be millis (500m) or integer (1, 2, ...)") return cpu def validate_memory(memory): + ''' + Memory quantity should be in gigabytes (Gi) or megabytes (Mi). + In the legacy extension, gigabytes is specified with integer. This will generate a warning now. + ''' if memory is None: return None unified = memory try: - # For backward compatibility, to convert integer value to value with Gi unit + # For backward compatibility, convert integer value to value with Gi unit int(memory) logger.warning("Memory quantity [--memory] should be specified with unit, such as 512Mi, 1Gi. " "Support for integer quantity will be dropped in future release.") @@ -28,7 +38,8 @@ def validate_memory(memory): except ValueError: pass + # Some digit(s) followed by explicit unit (Mi or Gi) if not re.match(r"^\d+[MG]i$", unified): - raise CLIError("Memory quantity should be integer followed by unit (Mi/Gi)") + raise InvalidArgumentValueError("Memory quantity should be integer followed by unit (Mi/Gi)") return unified From 34612c6f8b855b527f5a1320f42358eae371f816 Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Wed, 16 Jun 2021 10:37:56 +0800 Subject: [PATCH 12/14] refine comments for cpu/memory validation --- src/spring-cloud/azext_spring_cloud/_resource_quantity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py index cc90eb14adb..ac2829f5e26 100644 --- a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py +++ b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py @@ -8,7 +8,7 @@ def validate_cpu(cpu): ''' CPU quantity should be either integer, or millis. Currently, 500m (aka 0.5) is the only allowed fractional value. - Note that 1 can be represented as 1000m which is also allowed. + Note that 1 can be represented as 1000m. ''' if cpu is None: return None @@ -22,7 +22,9 @@ def validate_cpu(cpu): def validate_memory(memory): ''' - Memory quantity should be in gigabytes (Gi) or megabytes (Mi). + Memory quantity should be in gigabytes (Gi) or megabytes (Mi). Currently, the only allowed fractional gigabytes + quantity is 512Mi. Note that 1Gi can be specified with 1024Mi. + In the legacy extension, gigabytes is specified with integer. This will generate a warning now. ''' if memory is None: From 97eb952e87750c88c92f1dc69b3efd309160868e Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Thu, 17 Jun 2021 10:57:40 +0800 Subject: [PATCH 13/14] fix: lint style for _resource_quantity.py --- .../azext_spring_cloud/_resource_quantity.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py index ac2829f5e26..128f58ebf61 100644 --- a/src/spring-cloud/azext_spring_cloud/_resource_quantity.py +++ b/src/spring-cloud/azext_spring_cloud/_resource_quantity.py @@ -1,10 +1,17 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + import re -from knack.util import CLIError from knack.log import get_logger from azure.cli.core.azclierror import InvalidArgumentValueError + logger = get_logger(__name__) + def validate_cpu(cpu): ''' CPU quantity should be either integer, or millis. Currently, 500m (aka 0.5) is the only allowed fractional value. From ff31a01154e8040cf9dc51eda2b0e73be2d0bf7e Mon Sep 17 00:00:00 2001 From: Menghua Xiao Date: Fri, 18 Jun 2021 09:30:12 +0800 Subject: [PATCH 14/14] fix: fix reset cpu/memory settings on env update --- src/spring-cloud/azext_spring_cloud/custom.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 843d2d1391c..c5dce3dafd0 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -360,6 +360,8 @@ def app_update(cmd, client, resource_group, service, name, jvm_options=jvm_options, net_core_main_entry_path=main_entry, runtime_version=runtime_version,) + deployment_settings.cpu = None + deployment_settings.memory_in_gb = None properties = models_20210601preview.DeploymentResourceProperties( deployment_settings=deployment_settings) poller = client.deployments.update(