From 1cc84dae9f5fa47b5c60f337af2ac4f0f5c2e973 Mon Sep 17 00:00:00 2001 From: yuwzho Date: Tue, 11 Aug 2020 14:36:24 +0800 Subject: [PATCH 01/37] vendor sdk --- .../_app_platform_management_client.py | 20 +- .../appplatform/models/__init__.py | 23 +- .../_app_platform_management_client_enums.py | 18 +- .../appplatform/models/_models.py | 261 +++++++++----- .../appplatform/models/_models_py3.py | 271 ++++++++++----- .../appplatform/operations/__init__.py | 8 +- .../operations/_apps_operations.py | 151 ++++++-- .../operations/_bindings_operations.py | 216 +++++++++--- .../operations/_certificates_operations.py | 141 ++++++-- .../operations/_config_servers_operations.py | 319 +++++++++++++++++ .../operations/_custom_domains_operations.py | 294 +++++++++------- .../operations/_deployments_operations.py | 106 ++++-- .../_monitoring_settings_operations.py | 321 ++++++++++++++++++ .../appplatform/operations/_operations.py | 4 +- .../operations/_services_operations.py | 12 +- .../operations/_skus_operations.py | 106 ++++++ 16 files changed, 1802 insertions(+), 469 deletions(-) create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.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 4b2272208ce..0f2d45899f7 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 @@ -14,13 +14,15 @@ 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 SkuOperations +from .operations import SkusOperations from . import models @@ -32,6 +34,10 @@ class AppPlatformManagementClient(SDKClient): :ivar services: Services operations :vartype services: azure.mgmt.appplatform.operations.ServicesOperations + :ivar config_servers: ConfigServers operations + :vartype config_servers: azure.mgmt.appplatform.operations.ConfigServersOperations + :ivar monitoring_settings: MonitoringSettings operations + :vartype monitoring_settings: azure.mgmt.appplatform.operations.MonitoringSettingsOperations :ivar apps: Apps operations :vartype apps: azure.mgmt.appplatform.operations.AppsOperations :ivar bindings: Bindings operations @@ -44,8 +50,8 @@ class AppPlatformManagementClient(SDKClient): :vartype deployments: azure.mgmt.appplatform.operations.DeploymentsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appplatform.operations.Operations - :ivar sku: Sku operations - :vartype sku: azure.mgmt.appplatform.operations.SkuOperations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.appplatform.operations.SkusOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -64,12 +70,16 @@ 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 = '2019-05-01-preview' + self.api_version = '2020-07-01' 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( @@ -82,5 +92,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.sku = SkuOperations( + self.skus = SkusOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py index d48ec1b4c2b..f344f11ac6f 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py @@ -19,6 +19,7 @@ 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 CustomDomainProperties from ._models_py3 import CustomDomainResource @@ -35,8 +36,11 @@ 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 OperationDetail from ._models_py3 import OperationDisplay from ._models_py3 import OperationProperties @@ -57,7 +61,6 @@ from ._models_py3 import SkuCapacity from ._models_py3 import TemporaryDisk from ._models_py3 import TestKeys - from ._models_py3 import TraceProperties from ._models_py3 import TrackedResource from ._models_py3 import UserSourceInfo except (SyntaxError, ImportError): @@ -70,6 +73,7 @@ from ._models import ClusterResourceProperties from ._models import ConfigServerGitProperty from ._models import ConfigServerProperties + from ._models import ConfigServerResource from ._models import ConfigServerSettings from ._models import CustomDomainProperties from ._models import CustomDomainResource @@ -86,8 +90,11 @@ 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 OperationDetail from ._models import OperationDisplay from ._models import OperationProperties @@ -108,7 +115,6 @@ from ._models import SkuCapacity from ._models import TemporaryDisk from ._models import TestKeys - from ._models import TraceProperties from ._models import TrackedResource from ._models import UserSourceInfo from ._paged_models import AppResourcePaged @@ -121,9 +127,9 @@ from ._paged_models import ServiceResourcePaged from ._app_platform_management_client_enums import ( ProvisioningState, - ConfigServerState, - TraceProxyState, ManagedIdentityType, + ConfigServerState, + MonitoringSettingState, TestKeyType, AppResourceProvisioningState, UserSourceType, @@ -145,6 +151,7 @@ 'ClusterResourceProperties', 'ConfigServerGitProperty', 'ConfigServerProperties', + 'ConfigServerResource', 'ConfigServerSettings', 'CustomDomainProperties', 'CustomDomainResource', @@ -161,8 +168,11 @@ 'ManagedIdentityProperties', 'MetricDimension', 'MetricSpecification', + 'MonitoringSettingProperties', + 'MonitoringSettingResource', 'NameAvailability', 'NameAvailabilityParameters', + 'NetworkProfile', 'OperationDetail', 'OperationDisplay', 'OperationProperties', @@ -183,7 +193,6 @@ 'SkuCapacity', 'TemporaryDisk', 'TestKeys', - 'TraceProperties', 'TrackedResource', 'UserSourceInfo', 'ServiceResourcePaged', @@ -195,9 +204,9 @@ 'OperationDetailPaged', 'ResourceSkuPaged', 'ProvisioningState', - 'ConfigServerState', - 'TraceProxyState', 'ManagedIdentityType', + 'ConfigServerState', + 'MonitoringSettingState', 'TestKeyType', 'AppResourceProvisioningState', 'UserSourceType', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py index 43b052634d0..bff22e84211 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py @@ -25,6 +25,14 @@ class ProvisioningState(str, Enum): move_failed = "MoveFailed" +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" @@ -34,7 +42,7 @@ class ConfigServerState(str, Enum): updating = "Updating" -class TraceProxyState(str, Enum): +class MonitoringSettingState(str, Enum): not_available = "NotAvailable" failed = "Failed" @@ -42,14 +50,6 @@ class TraceProxyState(str, Enum): updating = "Updating" -class ManagedIdentityType(str, Enum): - - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned,UserAssigned" - - class TestKeyType(str, Enum): primary = "Primary" diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py index b35beb03ae1..f2766a941e6 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py @@ -219,11 +219,11 @@ class BindingResourceProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param resource_name: The name of the bound resource - :type resource_name: str - :param resource_type: The standard Azure resource type of the bound + :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 - :type resource_type: str + :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 @@ -240,6 +240,8 @@ class BindingResourceProperties(Model): """ _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, 'generated_properties': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, @@ -258,8 +260,8 @@ class BindingResourceProperties(Model): def __init__(self, **kwargs): super(BindingResourceProperties, self).__init__(**kwargs) - self.resource_name = kwargs.get('resource_name', None) - self.resource_type = kwargs.get('resource_type', None) + 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) @@ -374,7 +376,7 @@ def __init__(self, **kwargs): class CloudError(Model): """An error response from the service. - :param error: + :param error: An error response from the service. :type error: ~azure.mgmt.appplatform.models.CloudErrorBody """ @@ -441,12 +443,8 @@ class ClusterResourceProperties(Model): 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or ~azure.mgmt.appplatform.models.ProvisioningState - :param config_server_properties: Config server git properties of the - Service - :type config_server_properties: - ~azure.mgmt.appplatform.models.ConfigServerProperties - :param trace: Trace properties of the Service - :type trace: ~azure.mgmt.appplatform.models.TraceProperties + :param network_profile: Network profile of the Service + :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile :ivar version: Version of the Service :vartype version: int :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a @@ -462,8 +460,7 @@ class ClusterResourceProperties(Model): _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'config_server_properties': {'key': 'configServerProperties', 'type': 'ConfigServerProperties'}, - 'trace': {'key': 'trace', 'type': 'TraceProperties'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, 'version': {'key': 'version', 'type': 'int'}, 'service_id': {'key': 'serviceId', 'type': 'str'}, } @@ -471,8 +468,7 @@ class ClusterResourceProperties(Model): def __init__(self, **kwargs): super(ClusterResourceProperties, self).__init__(**kwargs) self.provisioning_state = None - self.config_server_properties = kwargs.get('config_server_properties', None) - self.trace = kwargs.get('trace', None) + self.network_profile = kwargs.get('network_profile', None) self.version = None self.service_id = None @@ -542,9 +538,10 @@ class ConfigServerProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar state: State of the config server. Possible values include: - 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' - :vartype state: str or ~azure.mgmt.appplatform.models.ConfigServerState + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.models.ConfigServerState :param error: Error when apply config server settings. :type error: ~azure.mgmt.appplatform.models.Error :param config_server: Settings of config server. @@ -552,22 +549,56 @@ class ConfigServerProperties(Model): """ _validation = { - 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, + '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.state = None + 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.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. @@ -587,14 +618,21 @@ def __init__(self, **kwargs): 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 - :param app_name: The app name of domain. - :type app_name: 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'}, @@ -604,7 +642,7 @@ class CustomDomainProperties(Model): def __init__(self, **kwargs): super(CustomDomainProperties, self).__init__(**kwargs) self.thumbprint = kwargs.get('thumbprint', None) - self.app_name = kwargs.get('app_name', None) + self.app_name = None self.cert_name = kwargs.get('cert_name', None) @@ -737,6 +775,8 @@ class DeploymentResource(ProxyResource): :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.models.Sku """ _validation = { @@ -750,11 +790,13 @@ class DeploymentResource(ProxyResource): '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): @@ -831,9 +873,6 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str - :param instance_count: Instance count, basic tier should be in range (1, - 25), standard tier should be in range (1, 500). Default value: 1 . - :type instance_count: int :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: @@ -846,7 +885,6 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, } @@ -856,7 +894,6 @@ def __init__(self, **kwargs): self.cpu = kwargs.get('cpu', 1) self.memory_in_gb = kwargs.get('memory_in_gb', 1) self.jvm_options = kwargs.get('jvm_options', None) - self.instance_count = kwargs.get('instance_count', 1) self.environment_variables = kwargs.get('environment_variables', None) self.runtime_version = kwargs.get('runtime_version', None) @@ -993,12 +1030,12 @@ def __init__(self, **kwargs): class ManagedIdentityProperties(Model): """Managed identity properties retrieved from ARM request headers. - :param type: Possible values include: 'None', 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned' + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' :type type: str or ~azure.mgmt.appplatform.models.ManagedIdentityType - :param principal_id: + :param principal_id: Principal Id :type principal_id: str - :param tenant_id: + :param tenant_id: Tenant Id :type tenant_id: str """ @@ -1090,6 +1127,79 @@ def __init__(self, **kwargs): 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.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.models.Error + :param trace_enabled: Indicates whether enable the trace functionality + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key + :type app_insights_instrumentation_key: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _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'}, + } + + 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) + + +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.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. @@ -1141,6 +1251,42 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class NetworkProfile(Model): + """Service network profile payload. + + :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 + """ + + _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'}, + } + + 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) + + class OperationDetail(Model): """Operation detail payload. @@ -1339,7 +1485,7 @@ def __init__(self, **kwargs): class ResourceSkuLocationInfo(Model): - """ResourceSkuLocationInfo. + """Locations and availability zones where the SKU is available. :param location: Gets location of the SKU :type location: str @@ -1365,7 +1511,7 @@ def __init__(self, **kwargs): class ResourceSkuRestrictionInfo(Model): - """ResourceSkuRestrictionInfo. + """Information about the restriction where the SKU cannot be used. :param locations: Gets locations where the SKU is restricted :type locations: list[str] @@ -1385,7 +1531,7 @@ def __init__(self, **kwargs): class ResourceSkuRestrictions(Model): - """ResourceSkuRestrictions. + """Restrictions where the SKU cannot be used. :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' @@ -1421,7 +1567,7 @@ def __init__(self, **kwargs): class ResourceSkuZoneDetails(Model): - """ResourceSkuZoneDetails. + """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. @@ -1686,43 +1832,6 @@ def __init__(self, **kwargs): self.enabled = kwargs.get('enabled', None) -class TraceProperties(Model): - """Trace properties payload. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar state: State of the trace proxy. Possible values include: - 'NotAvailable', 'Failed', 'Succeeded', 'Updating' - :vartype state: str or ~azure.mgmt.appplatform.models.TraceProxyState - :param error: Error when apply trace proxy changes. - :type error: ~azure.mgmt.appplatform.models.Error - :param enabled: Indicates whether enable the tracing functionality - :type enabled: bool - :param app_insight_instrumentation_key: Target application insight - instrumentation key - :type app_insight_instrumentation_key: str - """ - - _validation = { - 'state': {'readonly': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'app_insight_instrumentation_key': {'key': 'appInsightInstrumentationKey', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TraceProperties, self).__init__(**kwargs) - self.state = None - self.error = kwargs.get('error', None) - self.enabled = kwargs.get('enabled', None) - self.app_insight_instrumentation_key = kwargs.get('app_insight_instrumentation_key', None) - - class UserSourceInfo(Model): """Source information for a deployment. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py index 02ca3876fb3..bc45a4a32dd 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py @@ -219,11 +219,11 @@ class BindingResourceProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param resource_name: The name of the bound resource - :type resource_name: str - :param resource_type: The standard Azure resource type of the bound + :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 - :type resource_type: str + :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 @@ -240,6 +240,8 @@ class BindingResourceProperties(Model): """ _validation = { + 'resource_name': {'readonly': True}, + 'resource_type': {'readonly': True}, 'generated_properties': {'readonly': True}, 'created_at': {'readonly': True}, 'updated_at': {'readonly': True}, @@ -256,10 +258,10 @@ class BindingResourceProperties(Model): 'updated_at': {'key': 'updatedAt', 'type': 'str'}, } - def __init__(self, *, resource_name: str=None, resource_type: str=None, resource_id: str=None, key: str=None, binding_parameters=None, **kwargs) -> None: + def __init__(self, *, resource_id: str=None, key: str=None, binding_parameters=None, **kwargs) -> None: super(BindingResourceProperties, self).__init__(**kwargs) - self.resource_name = resource_name - self.resource_type = resource_type + self.resource_name = None + self.resource_type = None self.resource_id = resource_id self.key = key self.binding_parameters = binding_parameters @@ -374,7 +376,7 @@ def __init__(self, *, properties=None, **kwargs) -> None: class CloudError(Model): """An error response from the service. - :param error: + :param error: An error response from the service. :type error: ~azure.mgmt.appplatform.models.CloudErrorBody """ @@ -441,12 +443,8 @@ class ClusterResourceProperties(Model): 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or ~azure.mgmt.appplatform.models.ProvisioningState - :param config_server_properties: Config server git properties of the - Service - :type config_server_properties: - ~azure.mgmt.appplatform.models.ConfigServerProperties - :param trace: Trace properties of the Service - :type trace: ~azure.mgmt.appplatform.models.TraceProperties + :param network_profile: Network profile of the Service + :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile :ivar version: Version of the Service :vartype version: int :ivar service_id: ServiceInstanceEntity GUID which uniquely identifies a @@ -462,17 +460,15 @@ class ClusterResourceProperties(Model): _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'config_server_properties': {'key': 'configServerProperties', 'type': 'ConfigServerProperties'}, - 'trace': {'key': 'trace', 'type': 'TraceProperties'}, + 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, 'version': {'key': 'version', 'type': 'int'}, 'service_id': {'key': 'serviceId', 'type': 'str'}, } - def __init__(self, *, config_server_properties=None, trace=None, **kwargs) -> None: + def __init__(self, *, network_profile=None, **kwargs) -> None: super(ClusterResourceProperties, self).__init__(**kwargs) self.provisioning_state = None - self.config_server_properties = config_server_properties - self.trace = trace + self.network_profile = network_profile self.version = None self.service_id = None @@ -542,9 +538,10 @@ class ConfigServerProperties(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar state: State of the config server. Possible values include: - 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' - :vartype state: str or ~azure.mgmt.appplatform.models.ConfigServerState + :ivar provisioning_state: State of the config server. Possible values + include: 'NotAvailable', 'Deleted', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.models.ConfigServerState :param error: Error when apply config server settings. :type error: ~azure.mgmt.appplatform.models.Error :param config_server: Settings of config server. @@ -552,22 +549,56 @@ class ConfigServerProperties(Model): """ _validation = { - 'state': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, + '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.state = None + 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.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. @@ -587,24 +618,31 @@ def __init__(self, *, git_property=None, **kwargs) -> 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 - :param app_name: The app name of domain. - :type app_name: 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, app_name: str=None, cert_name: str=None, **kwargs) -> None: + def __init__(self, *, thumbprint: str=None, cert_name: str=None, **kwargs) -> None: super(CustomDomainProperties, self).__init__(**kwargs) self.thumbprint = thumbprint - self.app_name = app_name + self.app_name = None self.cert_name = cert_name @@ -737,6 +775,8 @@ class DeploymentResource(ProxyResource): :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.models.Sku """ _validation = { @@ -750,11 +790,13 @@ class DeploymentResource(ProxyResource): '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, **kwargs) -> None: + def __init__(self, *, properties=None, sku=None, **kwargs) -> None: super(DeploymentResource, self).__init__(**kwargs) self.properties = properties + self.sku = sku class DeploymentResourceProperties(Model): @@ -831,9 +873,6 @@ class DeploymentSettings(Model): :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str - :param instance_count: Instance count, basic tier should be in range (1, - 25), standard tier should be in range (1, 500). Default value: 1 . - :type instance_count: int :param environment_variables: Collection of environment variables :type environment_variables: dict[str, str] :param runtime_version: Runtime version. Possible values include: @@ -846,17 +885,15 @@ class DeploymentSettings(Model): 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'jvm_options': {'key': 'jvmOptions', 'type': 'str'}, - 'instance_count': {'key': 'instanceCount', 'type': 'int'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'runtime_version': {'key': 'runtimeVersion', 'type': 'str'}, } - def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: str=None, instance_count: int=1, environment_variables=None, runtime_version=None, **kwargs) -> None: + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, jvm_options: 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.jvm_options = jvm_options - self.instance_count = instance_count self.environment_variables = environment_variables self.runtime_version = runtime_version @@ -993,12 +1030,12 @@ def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str class ManagedIdentityProperties(Model): """Managed identity properties retrieved from ARM request headers. - :param type: Possible values include: 'None', 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned' + :param type: Type of the managed identity. Possible values include: + 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' :type type: str or ~azure.mgmt.appplatform.models.ManagedIdentityType - :param principal_id: + :param principal_id: Principal Id :type principal_id: str - :param tenant_id: + :param tenant_id: Tenant Id :type tenant_id: str """ @@ -1090,6 +1127,79 @@ def __init__(self, *, name: str=None, display_name: str=None, display_descriptio 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.models.MonitoringSettingState + :param error: Error when apply Monitoring Setting changes. + :type error: ~azure.mgmt.appplatform.models.Error + :param trace_enabled: Indicates whether enable the trace functionality + :type trace_enabled: bool + :param app_insights_instrumentation_key: Target application insight + instrumentation key + :type app_insights_instrumentation_key: str + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _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'}, + } + + def __init__(self, *, error=None, trace_enabled: bool=None, app_insights_instrumentation_key: str=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 + + +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.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. @@ -1141,6 +1251,42 @@ def __init__(self, *, type: str, name: str, **kwargs) -> None: self.name = name +class NetworkProfile(Model): + """Service network profile payload. + + :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 + """ + + _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'}, + } + + 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 + + class OperationDetail(Model): """Operation detail payload. @@ -1339,7 +1485,7 @@ def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: class ResourceSkuLocationInfo(Model): - """ResourceSkuLocationInfo. + """Locations and availability zones where the SKU is available. :param location: Gets location of the SKU :type location: str @@ -1365,7 +1511,7 @@ def __init__(self, *, location: str=None, zones=None, zone_details=None, **kwarg class ResourceSkuRestrictionInfo(Model): - """ResourceSkuRestrictionInfo. + """Information about the restriction where the SKU cannot be used. :param locations: Gets locations where the SKU is restricted :type locations: list[str] @@ -1385,7 +1531,7 @@ def __init__(self, *, locations=None, zones=None, **kwargs) -> None: class ResourceSkuRestrictions(Model): - """ResourceSkuRestrictions. + """Restrictions where the SKU cannot be used. :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' @@ -1421,7 +1567,7 @@ def __init__(self, *, type=None, values=None, restriction_info=None, reason_code class ResourceSkuZoneDetails(Model): - """ResourceSkuZoneDetails. + """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. @@ -1686,43 +1832,6 @@ def __init__(self, *, primary_key: str=None, secondary_key: str=None, primary_te self.enabled = enabled -class TraceProperties(Model): - """Trace properties payload. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar state: State of the trace proxy. Possible values include: - 'NotAvailable', 'Failed', 'Succeeded', 'Updating' - :vartype state: str or ~azure.mgmt.appplatform.models.TraceProxyState - :param error: Error when apply trace proxy changes. - :type error: ~azure.mgmt.appplatform.models.Error - :param enabled: Indicates whether enable the tracing functionality - :type enabled: bool - :param app_insight_instrumentation_key: Target application insight - instrumentation key - :type app_insight_instrumentation_key: str - """ - - _validation = { - 'state': {'readonly': True}, - } - - _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'app_insight_instrumentation_key': {'key': 'appInsightInstrumentationKey', 'type': 'str'}, - } - - def __init__(self, *, error=None, enabled: bool=None, app_insight_instrumentation_key: str=None, **kwargs) -> None: - super(TraceProperties, self).__init__(**kwargs) - self.state = None - self.error = error - self.enabled = enabled - self.app_insight_instrumentation_key = app_insight_instrumentation_key - - class UserSourceInfo(Model): """Source information for a deployment. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py index 45301a531c0..b886c1ca927 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py @@ -10,21 +10,25 @@ # -------------------------------------------------------------------------- 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 ._sku_operations import SkuOperations +from ._skus_operations import SkusOperations __all__ = [ 'ServicesOperations', + 'ConfigServersOperations', + 'MonitoringSettingsOperations', 'AppsOperations', 'BindingsOperations', 'CertificatesOperations', 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', - 'SkuOperations', + 'SkusOperations', ] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py index 4b8a5e5d58c..719f0b52279 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ 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 = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -146,7 +146,7 @@ def _create_or_update_initial( 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]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -157,6 +157,8 @@ def _create_or_update_initial( 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) @@ -219,27 +221,9 @@ def get_long_running_output(response): 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( - self, resource_group_name, service_name, app_name, custom_headers=None, raw=False, **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: 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` - """ + 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 = { @@ -267,7 +251,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -275,6 +259,51 @@ def delete( 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}'} @@ -525,3 +554,77 @@ def get_resource_upload_url( 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.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') + + # 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/operations/_bindings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py index 1be603bdfc9..5965148cd72 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py @@ -12,6 +12,8 @@ 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 @@ -25,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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -108,33 +110,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} - def create_or_update( - self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **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.models.BindingResourceProperties - :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.models.BindingResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + 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 @@ -170,25 +148,29 @@ def create_or_update( 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]: + 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 - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} - def delete( - self, resource_group_name, service_name, app_name, binding_name, custom_headers=None, raw=False, **operation_config): - """Operation to delete a Binding. + 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 @@ -200,15 +182,54 @@ def delete( :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.models.BindingResourceProperties :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 + :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.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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 = { @@ -237,7 +258,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -245,11 +266,10 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/bindings/{bindingName}'} - def update( - self, resource_group_name, service_name, app_name, binding_name, properties=None, custom_headers=None, raw=False, **operation_config): - """Operation to update an exiting Binding. + 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 @@ -261,19 +281,44 @@ def update( :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.models.BindingResourceProperties :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.models.BindingResource or - ~msrest.pipeline.ClientRawResponse + :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 @@ -309,20 +354,81 @@ def update( 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]: + 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.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.models.BindingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py index 00428016758..51525c985e7 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py @@ -12,6 +12,8 @@ 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 @@ -25,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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -105,30 +107,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} - def create_or_update( - self, resource_group_name, service_name, certificate_name, properties=None, custom_headers=None, raw=False, **operation_config): - """Create or update certificate resource. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param service_name: The name of the Service resource. - :type service_name: str - :param certificate_name: The name of the certificate resource. - :type certificate_name: str - :param properties: Properties of the certificate resource payload. - :type properties: ~azure.mgmt.appplatform.models.CertificateProperties - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CertificateResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CertificateResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + 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 @@ -163,25 +144,29 @@ def create_or_update( 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]: + 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 - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/certificates/{certificateName}'} - def delete( - self, resource_group_name, service_name, certificate_name, custom_headers=None, raw=False, **operation_config): - """Delete the certificate resource. + 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 @@ -191,15 +176,52 @@ def delete( :type service_name: str :param certificate_name: The name of the certificate resource. :type certificate_name: str + :param properties: Properties of the certificate resource payload. + :type properties: ~azure.mgmt.appplatform.models.CertificateProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :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.models.CertificateResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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 = { @@ -227,7 +249,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -235,6 +257,51 @@ def delete( 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( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py new file mode 100644 index 00000000000..3536a2d8afd --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py @@ -0,0 +1,319 @@ +# 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: Client Api Version. Constant value: "2020-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01" + + 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.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') + + # 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') + + # 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.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.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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') + + # 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.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.models.ConfigServerResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py index f7f88db69a4..2b3c24bba50 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py @@ -12,6 +12,8 @@ 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 @@ -25,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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ models = models @@ -35,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -108,33 +110,9 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} - def create_or_update( - self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): - """Create or update custom domain of one lifecycle application. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param service_name: The name of the Service resource. - :type service_name: str - :param app_name: The name of the App resource. - :type app_name: str - :param domain_name: The name of the custom domain resource. - :type domain_name: str - :param properties: Properties of the custom domain resource. - :type properties: - ~azure.mgmt.appplatform.models.CustomDomainProperties - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CustomDomainResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + 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 @@ -170,25 +148,29 @@ def create_or_update( 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]: + 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 - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} - def delete( - self, resource_group_name, service_name, app_name, domain_name, custom_headers=None, raw=False, **operation_config): - """Delete the custom domain of one lifecycle application. + 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 @@ -200,15 +182,54 @@ def delete( :type app_name: str :param domain_name: The name of the custom domain resource. :type domain_name: str + :param properties: Properties of the custom domain resource. + :type properties: + ~azure.mgmt.appplatform.models.CustomDomainProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :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.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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 = { @@ -237,7 +258,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -245,11 +266,10 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} - def patch( - self, resource_group_name, service_name, app_name, domain_name, properties=None, custom_headers=None, raw=False, **operation_config): - """Update custom domain of one lifecycle application. + 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 @@ -261,23 +281,48 @@ def patch( :type app_name: str :param domain_name: The name of the custom domain resource. :type domain_name: str - :param properties: Properties of the custom domain resource. - :type properties: - ~azure.mgmt.appplatform.models.CustomDomainProperties :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CustomDomainResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or - ~msrest.pipeline.ClientRawResponse + :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.patch.metadata['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'), @@ -309,21 +354,82 @@ def patch( 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]: + 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 - patch.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/{domainName}'} + + 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.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.models.CustomDomainResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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): @@ -401,77 +507,3 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains'} - - def validate( - self, resource_group_name, service_name, app_name, name, custom_headers=None, raw=False, **operation_config): - """Check the resource name is valid as well as not in use. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param service_name: The name of the Service resource. - :type service_name: str - :param app_name: The name of the App resource. - :type app_name: str - :param name: Name to be validated - :type name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: CustomDomainValidateResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - validate_payload = models.CustomDomainValidatePayload(name=name) - - # Construct URL - url = self.validate.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str'), - 'appName': self._serialize.url("app_name", app_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(validate_payload, 'CustomDomainValidatePayload') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('CustomDomainValidateResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/domains/validate'} diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py index 53205447fd4..31d3f1f86aa 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ 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 = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -112,8 +112,8 @@ def get( def _create_or_update_initial( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, **operation_config): - deployment_resource = models.DeploymentResource(properties=properties) + 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'] @@ -148,7 +148,7 @@ def _create_or_update_initial( 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]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -159,6 +159,8 @@ def _create_or_update_initial( 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) @@ -167,7 +169,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 @@ -183,6 +185,8 @@ def create_or_update( :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.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 @@ -202,6 +206,7 @@ def create_or_update( app_name=app_name, deployment_name=deployment_name, properties=properties, + sku=sku, custom_headers=custom_headers, raw=True, **operation_config @@ -225,29 +230,9 @@ def get_long_running_output(response): 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( - self, resource_group_name, service_name, app_name, deployment_name, custom_headers=None, raw=False, **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: 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` - """ + 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 = { @@ -276,7 +261,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -284,12 +269,60 @@ def delete( 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, custom_headers=None, raw=False, **operation_config): - deployment_resource = models.DeploymentResource(properties=properties) + 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'] @@ -343,7 +376,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, service_name, app_name, deployment_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + 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 @@ -359,6 +392,8 @@ def update( :param properties: Properties of the Deployment resource :type properties: ~azure.mgmt.appplatform.models.DeploymentResourceProperties + :param sku: Sku of the Deployment resource + :type sku: ~azure.mgmt.appplatform.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 @@ -378,6 +413,7 @@ def update( app_name=app_name, deployment_name=deployment_name, properties=properties, + sku=sku, custom_headers=custom_headers, raw=True, **operation_config @@ -482,7 +518,7 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments'} - def list_cluster_all_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. @@ -507,7 +543,7 @@ def list_cluster_all_deployments( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_cluster_all_deployments.metadata['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'), @@ -558,7 +594,7 @@ def internal_paging(next_link=None): deserialized = models.DeploymentResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_cluster_all_deployments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments'} + list_for_cluster.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/deployments'} def _start_initial( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py new file mode 100644 index 00000000000..c10c7a87550 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py @@ -0,0 +1,321 @@ +# 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: Client Api Version. Constant value: "2020-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01" + + 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.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') + + # 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') + + # 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.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.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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') + + # 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.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.models.MonitoringSettingResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.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/operations/_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py index d69c8a0616e..ca9030a82e8 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ 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 = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py index 3fb045d7800..21266c872d2 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2019-05-01-preview". + :ivar api_version: Client Api Version. Constant value: "2020-07-01". """ 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 = "2019-05-01-preview" + self.api_version = "2020-07-01" self.config = config @@ -138,7 +138,7 @@ def _create_or_update_initial( 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]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -149,6 +149,8 @@ def _create_or_update_initial( 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) @@ -530,7 +532,7 @@ def regenerate_test_key( 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 @@ -585,7 +587,7 @@ def disable_test_endpoint( 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 diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.py new file mode 100644 index 00000000000..4fb808cac89 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2020-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01" + + 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.models.ResourceSkuPaged[~azure.mgmt.appplatform.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') + + 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'} From 1a27e3b33014d056b24beb1557ba3c5178b39044 Mon Sep 17 00:00:00 2001 From: yuwzho Date: Tue, 11 Aug 2020 15:42:40 +0800 Subject: [PATCH 02/37] move validation to validator --- src/spring-cloud/azext_spring_cloud/_params.py | 11 +++++++---- src/spring-cloud/azext_spring_cloud/_validators.py | 8 ++++++++ src/spring-cloud/azext_spring_cloud/custom.py | 13 +------------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 59610f6c140..f783c9c8ea5 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -9,7 +9,7 @@ from azure.cli.core.commands.parameters import (name_type, get_location_type, resource_group_name_type) from ._validators import (validate_env, validate_cosmos_type, validate_resource_id, validate_location, validate_name, validate_app_name, validate_deployment_name, validate_log_lines, - validate_log_limit, validate_log_since, validate_sku, validate_jvm_options) + validate_log_limit, validate_log_since, validate_sku, validate_jvm_options, validate_tracing_parameters) from ._utils import ApiType from .vendored_sdks.appplatform.models import RuntimeVersion, TestKeyType @@ -40,12 +40,15 @@ def load_arguments(self, _): for scope in ['spring-cloud create', 'spring-cloud update']: with self.argument_context(scope) as c: c.argument('app_insights_key', - help="Instrumentation key of the existing Application Insights to be added for the distributed tracing") + help="Instrumentation key of the existing Application Insights to be added for the distributed tracing", + validator=validate_tracing_parameters) c.argument('app_insights', - help="Name of the existing Application Insights in the same Resource Group. Or Resource ID of the existing Application Insights in a different Resource Group.") + help="Name of the existing Application Insights in the same Resource Group. Or Resource ID of the existing Application Insights in a different Resource Group.", + validator=validate_tracing_parameters) c.argument('disable_distributed_tracing', arg_type=get_three_state_flag(), - help="Disable distributed tracing, if not disabled and no existing Application Insights specified with --app-insights-key or --app-insights, will create a new Application Insights instance in the same resource group.") + help="Disable distributed tracing, if not disabled and no existing Application Insights specified with --app-insights-key or --app-insights, will create a new Application Insights instance in the same resource group.", + validator=validate_tracing_parameters) c.argument('tags', arg_type=tags_type) with self.argument_context('spring-cloud test-endpoint renew-key') as c: diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index d8a3f91e2ee..758a89ac842 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -138,3 +138,11 @@ def validate_log_since(namespace): def validate_jvm_options(namespace): if namespace.jvm_options is not None: namespace.jvm_options = namespace.jvm_options.strip('\'') + + +def validate_tracing_parameters(namespace): + if (namespace.app_insights or namespace.app_insights_key) and namespace.disable_distributed_tracing: + raise CLIError("Conflict detected: '--app-insights' or '--app-insights-key'" + "can not be set with '--disable-distributed-tracing'.") + if namespace.app_insights and namespace.app_insights_key: + raise CLIError("Conflict detected: '--app-insights' and '--app-insights-key' can not be set at the same time.") diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 74351d487be..84f6db87a62 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -40,18 +40,15 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_insights_key=None, app_insights=None, - disable_distributed_tracing=None, sku=None, tags=None, no_wait=False): + disable_distributed_tracing=None, sku='Standard', tags=None, no_wait=False): rg_location = _get_rg_location(cmd.cli_ctx, resource_group) if location is None: location = rg_location - if sku is None: - sku = "Standard" full_sku = models.Sku(name=_get_sku_name(sku), tier=sku) properties = models.ClusterResourceProperties() - check_tracing_parameters(app_insights_key, app_insights, disable_distributed_tracing) update_tracing_config(cmd, resource_group, name, location, properties, app_insights_key, app_insights, disable_distributed_tracing) @@ -77,7 +74,6 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None resource_properties = resource.properties updated_resource_properties = models.ClusterResourceProperties() - check_tracing_parameters(app_insights_key, app_insights, disable_distributed_tracing) app_insights_target_status = False if app_insights is not None or app_insights_key is not None or disable_distributed_tracing is False: app_insights_target_status = True @@ -1275,13 +1271,6 @@ def get_app_insights_key(cli_ctx, resource_group, name): return appinsights.instrumentation_key -def check_tracing_parameters(app_insights_key, app_insights, disable_distributed_tracing): - if (app_insights is not None or app_insights_key is not None) and disable_distributed_tracing is True: - raise CLIError("Conflict detected: '--app-insights' or '--app-insights-key' can not be set with '--disable-distributed-tracing true'.") - if app_insights is not None and app_insights_key is not None: - raise CLIError("Conflict detected: '--app-insights' and '--app-insights-key' can not be set at the same time.") - - def update_tracing_config(cmd, resource_group, service_name, location, resource_properties, app_insights_key, app_insights, disable_distributed_tracing): create_app_insights = False From 68ed6963749006ee9789142c30ef88c51a517fdf Mon Sep 17 00:00:00 2001 From: yuwzho Date: Tue, 11 Aug 2020 17:07:49 +0800 Subject: [PATCH 03/37] instance count --- .../azext_spring_cloud/_transformers.py | 4 ++-- src/spring-cloud/azext_spring_cloud/custom.py | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_transformers.py b/src/spring-cloud/azext_spring_cloud/_transformers.py index c9ac8bbfb7b..bb0d8f8fb9e 100644 --- a/src/spring-cloud/azext_spring_cloud/_transformers.py +++ b/src/spring-cloud/azext_spring_cloud/_transformers.py @@ -32,7 +32,7 @@ def transform_app_table_output(result): if 'activeDeployment' in item['properties']: isStarted = item['properties']['activeDeployment']['properties']['status'].upper() == "RUNNING" - instance_count = item['properties']['activeDeployment']['properties']['deploymentSettings']['instanceCount'] + instance_count = item['properties']['activeDeployment']['sku']['capacity'] instances = item['properties']['activeDeployment']['properties']['instances'] if instances is None: instances = [] @@ -61,7 +61,7 @@ def transform_spring_cloud_deployment_output(result): for item in result: isStarted = item['properties']['status'].upper() == "RUNNING" - instance_count = item['properties']['deploymentSettings']['instanceCount'] + instance_count = item['sku']['capacity'] instances = item['properties']['instances'] if instances is None: instances = [] diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 84f6db87a62..778742c9234 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -189,7 +189,6 @@ def app_create(cmd, client, resource_group, service, name, deployment_settings = models.DeploymentSettings( cpu=cpu, memory_in_gb=memory, - instance_count=instance_count, environment_variables=env, jvm_options=jvm_options, runtime_version=runtime_version,) @@ -198,12 +197,13 @@ def app_create(cmd, client, resource_group, service, name, properties = models.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) + sku = models.Sku(capacity=instance_count) # create default deployment logger.warning( "[2/4] Creating default deployment with name '{}'".format(DEFAULT_DEPLOYMENT_NAME)) poller = client.deployments.create_or_update( - resource_group, service, name, DEFAULT_DEPLOYMENT_NAME, properties) + resource_group, service, name, DEFAULT_DEPLOYMENT_NAME, properties=properties, sku=sku) logger.warning("[3/4] Setting default deployment to production") properties = models.AppResourceProperties( @@ -427,12 +427,12 @@ def app_scale(cmd, client, resource_group, service, name, raise CLIError(NO_PRODUCTION_DEPLOYMENT_ERROR) deployment_settings = models.DeploymentSettings( cpu=cpu, - memory_in_gb=memory, - instance_count=instance_count,) + memory_in_gb=memory) properties = models.DeploymentResourceProperties( deployment_settings=deployment_settings) + sku = models.Sku(capacity=instance_count) return sdk_no_wait(no_wait, client.deployments.update, - resource_group, service, name, deployment, properties) + resource_group, service, name, deployment, properties=properties, sku=sku) def app_get_build_log(cmd, client, resource_group, service, name, deployment=None): @@ -609,7 +609,7 @@ def deployment_create(cmd, client, resource_group, service, app, name, if active_deployment: cpu = cpu or active_deployment.properties.deployment_settings.cpu memory = memory or active_deployment.properties.deployment_settings.memory_in_gb - instance_count = instance_count or active_deployment.properties.deployment_settings.instance_count + 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: @@ -1130,8 +1130,8 @@ def _app_deploy(client, resource_group, service, app, name, version, path, runti memory_in_gb=memory, environment_variables=env, jvm_options=jvm_options, - runtime_version=runtime_version, - instance_count=instance_count,) + runtime_version=runtime_version) + sku = models.Sku(capacity=instance_count) user_source_info = models.UserSourceInfo( version=version, relative_path=relative_path, @@ -1181,10 +1181,10 @@ def get_logs_loop(): "[3/3] Updating deployment in app '{}' (this operation can take a while to complete)".format(app)) if update: return sdk_no_wait(no_wait, client.deployments.update, - resource_group, service, app, name, properties) + resource_group, service, app, name, properties=properties, sku=sku) return sdk_no_wait(no_wait, client.deployments.create_or_update, - resource_group, service, app, name, properties) + resource_group, service, app, name, properties=properties, sku=sku) def _get_app_log(url, user_name, password, exceptions): From 263af3411b0eb9b31639ea3c1792e43f2d30cbe4 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Mon, 17 Aug 2020 17:04:35 +0800 Subject: [PATCH 04/37] fix the merge errors --- src/spring-cloud/azext_spring_cloud/custom.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index a2b6d0e40e7..cc34d8b092e 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -60,8 +60,6 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in full_sku = models.Sku(name=_get_sku_name(sku), tier=sku) - properties = models.ClusterResourceProperties() - update_tracing_config(cmd, resource_group, name, location, properties, app_insights_key, app_insights, disable_distributed_tracing) From ea416031ff2abf6c2fd267d405aff75fb01c2573 Mon Sep 17 00:00:00 2001 From: shipeng Date: Tue, 25 Aug 2020 10:09:21 +0800 Subject: [PATCH 05/37] Distributed tracing support new api-version --- .../azext_spring_cloud/commands.py | 206 +++++++++--------- src/spring-cloud/azext_spring_cloud/custom.py | 64 +++--- 2 files changed, 140 insertions(+), 130 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 54101e9b2d8..b8106be518d 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -1,103 +1,103 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------------- - -# pylint: disable=line-too-long -from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings) -from ._transformers import (transform_spring_cloud_table_output, - transform_app_table_output, - transform_spring_cloud_deployment_output, - transform_spring_cloud_certificate_output, - transform_spring_cloud_custom_domain_output) - - -# pylint: disable=too-many-statements -def load_command_table(self, _): - with self.command_group('spring-cloud', client_factory=cf_app_services) as g: - g.custom_command('create', 'spring_cloud_create', supports_no_wait=True) - g.custom_command('update', 'spring_cloud_update', supports_no_wait=True) - g.custom_command('delete', 'spring_cloud_delete', supports_no_wait=True) - g.custom_command('list', 'spring_cloud_list', table_transformer=transform_spring_cloud_table_output) - g.custom_show_command('show', 'spring_cloud_get', table_transformer=transform_spring_cloud_table_output) - - with self.command_group('spring-cloud test-endpoint', client_factory=cf_spring_cloud) as g: - g.custom_command('enable ', 'enable_test_endpoint') - g.custom_show_command('disable ', 'disable_test_endpoint') - g.custom_command('renew-key', 'regenerate_keys') - g.custom_command('list', 'list_keys') - - with self.command_group('spring-cloud config-server', client_factory=cf_app_services) as g: - g.custom_command('set', 'config_set', supports_no_wait=True) - g.custom_command('clear', 'config_delete') - g.custom_show_command('show', 'config_get') - - with self.command_group('spring-cloud config-server git', client_factory=cf_app_services, - supports_local_cache=True) as g: - g.custom_command('set', 'config_git_set') - g.custom_command('repo add', 'config_repo_add') - g.custom_command('repo remove', 'config_repo_delete') - 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) as g: - g.custom_command('create', 'app_create') - g.custom_command('update', 'app_update') - g.custom_command('deploy', 'app_deploy', supports_no_wait=True) - g.custom_command('scale', 'app_scale', supports_no_wait=True) - g.custom_command('show-deploy-log', 'app_get_build_log') - g.custom_command('set-deployment', 'app_set_deployment', - supports_no_wait=True) - g.custom_command('delete', 'app_delete') - g.custom_command('list', 'app_list', - table_transformer=transform_app_table_output) - g.custom_show_command( - 'show', 'app_get', table_transformer=transform_app_table_output) - g.custom_command('start', 'app_start', supports_no_wait=True) - g.custom_command('stop', 'app_stop', supports_no_wait=True) - g.custom_command('restart', 'app_restart', supports_no_wait=True) - g.custom_command('logs', 'app_tail_log') - - with self.command_group('spring-cloud app identity', client_factory=cf_spring_cloud) as g: - g.custom_command('assign', 'app_identity_assign') - g.custom_command('remove', 'app_identity_remove') - g.custom_show_command('show', 'app_identity_show') - - with self.command_group('spring-cloud app log', client_factory=cf_spring_cloud, - 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: - g.custom_command('create', 'deployment_create', supports_no_wait=True) - g.custom_command('list', 'deployment_list', - table_transformer=transform_spring_cloud_deployment_output) - g.custom_show_command( - 'show', 'deployment_get', table_transformer=transform_spring_cloud_deployment_output) - g.custom_command('delete', 'deployment_delete') - - with self.command_group('spring-cloud app binding', client_factory=cf_bindings) as g: - g.custom_command('list', 'binding_list') - g.custom_show_command('show', 'binding_get') - g.custom_command('cosmos add', 'binding_cosmos_add') - g.custom_command('cosmos update', 'binding_cosmos_update') - g.custom_command('mysql add', 'binding_mysql_add') - g.custom_command('mysql update', 'binding_mysql_update') - g.custom_command('redis add', 'binding_redis_add') - g.custom_command('redis update', 'binding_redis_update') - g.custom_show_command('remove', 'binding_remove') - - with self.command_group('spring-cloud certificate', client_factory=cf_spring_cloud) as g: - g.custom_command('add', 'certificate_add') - g.custom_show_command('show', 'certificate_show', table_transformer=transform_spring_cloud_certificate_output) - g.custom_command('list', 'certificate_list', table_transformer=transform_spring_cloud_certificate_output) - g.custom_command('remove', 'certificate_remove') - - with self.command_group('spring-cloud app custom-domain', client_factory=cf_spring_cloud) as g: - g.custom_command('bind', 'domain_bind') - g.custom_show_command('show', 'domain_show', table_transformer=transform_spring_cloud_custom_domain_output) - g.custom_command('list', 'domain_list', table_transformer=transform_spring_cloud_custom_domain_output) - g.custom_command('update', 'domain_update') - g.custom_command('unbind', 'domain_unbind') - - with self.command_group('spring-cloud', is_preview=True): - pass +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings) +from ._transformers import (transform_spring_cloud_table_output, + transform_app_table_output, + transform_spring_cloud_deployment_output, + transform_spring_cloud_certificate_output, + transform_spring_cloud_custom_domain_output) + + +# pylint: disable=too-many-statements +def load_command_table(self, _): + with self.command_group('spring-cloud', client_factory=cf_app_services) as g: + g.custom_command('create', 'spring_cloud_create', supports_no_wait=True, client_factory=cf_spring_cloud) + g.custom_command('update', 'spring_cloud_update', supports_no_wait=True, client_factory=cf_spring_cloud) + g.custom_command('delete', 'spring_cloud_delete', supports_no_wait=True) + g.custom_command('list', 'spring_cloud_list', table_transformer=transform_spring_cloud_table_output) + g.custom_show_command('show', 'spring_cloud_get', table_transformer=transform_spring_cloud_table_output) + + with self.command_group('spring-cloud test-endpoint', client_factory=cf_spring_cloud) as g: + g.custom_command('enable ', 'enable_test_endpoint') + g.custom_show_command('disable ', 'disable_test_endpoint') + g.custom_command('renew-key', 'regenerate_keys') + g.custom_command('list', 'list_keys') + + with self.command_group('spring-cloud config-server', client_factory=cf_app_services) as g: + g.custom_command('set', 'config_set', supports_no_wait=True) + g.custom_command('clear', 'config_delete') + g.custom_show_command('show', 'config_get') + + with self.command_group('spring-cloud config-server git', client_factory=cf_app_services, + supports_local_cache=True) as g: + g.custom_command('set', 'config_git_set') + g.custom_command('repo add', 'config_repo_add') + g.custom_command('repo remove', 'config_repo_delete') + 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) as g: + g.custom_command('create', 'app_create') + g.custom_command('update', 'app_update') + g.custom_command('deploy', 'app_deploy', supports_no_wait=True) + g.custom_command('scale', 'app_scale', supports_no_wait=True) + g.custom_command('show-deploy-log', 'app_get_build_log') + g.custom_command('set-deployment', 'app_set_deployment', + supports_no_wait=True) + g.custom_command('delete', 'app_delete') + g.custom_command('list', 'app_list', + table_transformer=transform_app_table_output) + g.custom_show_command( + 'show', 'app_get', table_transformer=transform_app_table_output) + g.custom_command('start', 'app_start', supports_no_wait=True) + g.custom_command('stop', 'app_stop', supports_no_wait=True) + g.custom_command('restart', 'app_restart', supports_no_wait=True) + g.custom_command('logs', 'app_tail_log') + + with self.command_group('spring-cloud app identity', client_factory=cf_spring_cloud) as g: + g.custom_command('assign', 'app_identity_assign') + g.custom_command('remove', 'app_identity_remove') + g.custom_show_command('show', 'app_identity_show') + + with self.command_group('spring-cloud app log', client_factory=cf_spring_cloud, + 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: + g.custom_command('create', 'deployment_create', supports_no_wait=True) + g.custom_command('list', 'deployment_list', + table_transformer=transform_spring_cloud_deployment_output) + g.custom_show_command( + 'show', 'deployment_get', table_transformer=transform_spring_cloud_deployment_output) + g.custom_command('delete', 'deployment_delete') + + with self.command_group('spring-cloud app binding', client_factory=cf_bindings) as g: + g.custom_command('list', 'binding_list') + g.custom_show_command('show', 'binding_get') + g.custom_command('cosmos add', 'binding_cosmos_add') + g.custom_command('cosmos update', 'binding_cosmos_update') + g.custom_command('mysql add', 'binding_mysql_add') + g.custom_command('mysql update', 'binding_mysql_update') + g.custom_command('redis add', 'binding_redis_add') + g.custom_command('redis update', 'binding_redis_update') + g.custom_show_command('remove', 'binding_remove') + + with self.command_group('spring-cloud certificate', client_factory=cf_spring_cloud) as g: + g.custom_command('add', 'certificate_add') + g.custom_show_command('show', 'certificate_show', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('list', 'certificate_list', table_transformer=transform_spring_cloud_certificate_output) + g.custom_command('remove', 'certificate_remove') + + with self.command_group('spring-cloud app custom-domain', client_factory=cf_spring_cloud) as g: + g.custom_command('bind', 'domain_bind') + g.custom_show_command('show', 'domain_show', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('list', 'domain_list', table_transformer=transform_spring_cloud_custom_domain_output) + g.custom_command('update', 'domain_update') + g.custom_command('unbind', 'domain_unbind') + + with self.command_group('spring-cloud', is_preview=True): + pass diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 4fe431eeb06..a4313c9c521 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -47,7 +47,6 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in if location is None: location = rg_location properties = models.ClusterResourceProperties() - resource = models.ServiceResource(location=location, properties=properties) if service_runtime_subnet or app_subnet or reserved_cidr_range: properties.network_profile = models.NetworkProfile( @@ -60,12 +59,19 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in full_sku = models.Sku(name=_get_sku_name(sku), tier=sku) - update_tracing_config(cmd, resource_group, name, location, properties, - app_insights_key, app_insights, disable_distributed_tracing) - resource = models.ServiceResource(location=location, sku=full_sku, properties=properties, tags=tags) - return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group, service_name=name, resource=resource) + poller = client.services.create_or_update( + resource_group, name, resource) + while poller.done() is False: + sleep(5) + if disable_distributed_tracing is not True: + trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, + disable_distributed_tracing) + if trace_properties is not None: + poller = client.monitoring_settings.update_put(resource_group, name, trace_properties) + while poller.done() is False: + sleep(5) def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None, app_insights=None, disable_distributed_tracing=None, sku=None, tags=None, no_wait=False): @@ -80,34 +86,37 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None updated_resource.sku = full_sku update_service_sku = True - resource = client.get(resource_group, name) + resource = client.services.get(resource_group, name) location = resource.location resource_properties = resource.properties updated_resource_properties = models.ClusterResourceProperties() + trace_properties = client.monitoring_settings.get(resource_group, name) + trace_enabled = trace_properties.trace_enabled if trace_properties is not None else False app_insights_target_status = False if app_insights is not None or app_insights_key is not None or disable_distributed_tracing is False: app_insights_target_status = True - if resource_properties.trace.enabled is False: + if trace_enabled is False: update_app_insights = True - elif app_insights_key != resource_properties.trace.app_insight_instrumentation_key: + elif app_insights_key != trace_properties.app_insights_instrumentation_key: update_app_insights = True elif disable_distributed_tracing is True: app_insights_target_status = False - if resource_properties.trace.enabled is True: + if trace_enabled is True: update_app_insights = True # update application insights if update_app_insights is True: if app_insights_target_status is False: - resource_properties.trace.enabled = app_insights_target_status - elif resource_properties.trace.app_insight_instrumentation_key is not None \ + trace_properties.trace_enabled = app_insights_target_status + elif trace_properties.app_insights_instrumentation_key is not None \ and app_insights is None and app_insights_key is None: - resource_properties.trace.enabled = app_insights_target_status + trace_properties.trace_enabled = app_insights_target_status else: - update_tracing_config(cmd, resource_group, name, location, resource_properties, app_insights_key, - app_insights, disable_distributed_tracing) - updated_resource_properties.trace = resource_properties.trace + trace_properties = update_tracing_config(cmd, resource_group, name, location, resource_properties, + app_insights_key, app_insights, disable_distributed_tracing) + sdk_no_wait(no_wait, client.monitoring_settings.update_put, + resource_group_name=resource_group, service_name=name, resource=trace_properties) # update service tags if tags is not None: @@ -118,7 +127,7 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None return resource updated_resource.properties = updated_resource_properties - return sdk_no_wait(no_wait, client.update, + return sdk_no_wait(no_wait, client.services.update, resource_group_name=resource_group, service_name=name, resource=updated_resource) @@ -1291,24 +1300,24 @@ def get_app_insights_key(cli_ctx, resource_group, name): return appinsights.instrumentation_key -def update_tracing_config(cmd, resource_group, service_name, location, resource_properties, app_insights_key, +def update_tracing_config(cmd, resource_group, service_name, location, app_insights_key, app_insights, disable_distributed_tracing): create_app_insights = False - + trace_properties = None if app_insights_key is not None: - resource_properties.trace = models.TraceProperties( - enabled=True, app_insight_instrumentation_key=app_insights_key) + trace_properties = models.MonitoringSettingProperties( + trace_enabled=True, app_insights_instrumentation_key=app_insights_key) elif app_insights is not None: if is_valid_resource_id(app_insights): resource_id_dict = parse_resource_id(app_insights) instrumentation_key = get_app_insights_key(cmd.cli_ctx, resource_id_dict['resource_group'], resource_id_dict['resource_name']) - resource_properties.trace = models.TraceProperties( - enabled=True, app_insight_instrumentation_key=instrumentation_key) + trace_properties = models.MonitoringSettingProperties( + trace_enabled=True, app_insights_instrumentation_key=instrumentation_key) else: instrumentation_key = get_app_insights_key(cmd.cli_ctx, resource_group, app_insights) - resource_properties.trace = models.TraceProperties( - enabled=True, app_insight_instrumentation_key=instrumentation_key) + trace_properties = models.MonitoringSettingProperties( + trace_enabled=True, app_insights_instrumentation_key=instrumentation_key) elif disable_distributed_tracing is not True: create_app_insights = True @@ -1316,13 +1325,14 @@ def update_tracing_config(cmd, resource_group, service_name, location, resource_ try: instrumentation_key = try_create_application_insights(cmd, resource_group, service_name, location) if instrumentation_key is not None: - resource_properties.trace = models.TraceProperties( - enabled=True, app_insight_instrumentation_key=instrumentation_key) + trace_properties = models.MonitoringSettingProperties() + trace_properties.trace_enabled = True + trace_properties.app_insights_instrumentation_key = instrumentation_key except Exception: # pylint: disable=broad-except logger.warning( 'Error while trying to create and configure an Application Insights for the Azure Spring Cloud. ' 'Please use the Azure Portal to create and configure the Application Insights, if needed.') - + return trace_properties def try_create_application_insights(cmd, resource_group, name, location): creation_failed_warn = 'Unable to create the Application Insights for the Azure Spring Cloud. ' \ From a7fb3ccc5c51eeab683c26af25b29e75fd249d10 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Tue, 25 Aug 2020 15:29:22 +0800 Subject: [PATCH 06/37] az spring-cloud config-server show --- src/spring-cloud/azext_spring_cloud/_client_factory.py | 4 ++++ src/spring-cloud/azext_spring_cloud/commands.py | 4 ++-- src/spring-cloud/azext_spring_cloud/custom.py | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_client_factory.py b/src/spring-cloud/azext_spring_cloud/_client_factory.py index 77ce5e7669c..cf8d48518b1 100644 --- a/src/spring-cloud/azext_spring_cloud/_client_factory.py +++ b/src/spring-cloud/azext_spring_cloud/_client_factory.py @@ -32,6 +32,10 @@ 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 diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 1fd4dcc0c4b..655f507826a 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings) +from ._client_factory import (cf_app_services, cf_spring_cloud, cf_bindings, cf_config_servers) from ._transformers import (transform_spring_cloud_table_output, transform_app_table_output, transform_spring_cloud_deployment_output, @@ -27,7 +27,7 @@ def load_command_table(self, _): g.custom_command('renew-key', 'regenerate_keys') g.custom_command('list', 'list_keys') - with self.command_group('spring-cloud config-server', client_factory=cf_app_services) as g: + with self.command_group('spring-cloud config-server', client_factory=cf_config_servers) as g: g.custom_command('set', 'config_set', supports_no_wait=True) g.custom_command('clear', 'config_delete') g.custom_show_command('show', 'config_get') diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index a4313c9c521..21107e95e2f 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -724,11 +724,11 @@ def standardization(dic): def config_get(cmd, client, resource_group, name): - resource = client.get(resource_group, name) - config_server = resource.properties.config_server_properties.config_server - if not config_server: + config_server_resource = client.get(resource_group, name).properties.config_server + + if not config_server_resource: raise CLIError("Config server not set.") - return config_server.git_property + return config_server_resource.git_property def config_delete(cmd, client, resource_group, name): From a65ce789e43362ce606ccae98d150deca5dd2a05 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Tue, 25 Aug 2020 16:12:55 +0800 Subject: [PATCH 07/37] az spring-cloud config-server clear --- src/spring-cloud/azext_spring_cloud/custom.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 21107e95e2f..c4b1603e850 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -724,21 +724,16 @@ def standardization(dic): def config_get(cmd, client, resource_group, name): - config_server_resource = client.get(resource_group, name).properties.config_server + config_server_resource = client.get(resource_group, name) - if not config_server_resource: + if not config_server_resource.properties.config_server: raise CLIError("Config server not set.") - return config_server_resource.git_property + return config_server_resource def config_delete(cmd, client, resource_group, name): - config_server_properties = models.ConfigServerProperties( - config_server=models.ConfigServerSettings()) - properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - appResource = models.ServiceResource(properties=properties) - - return client.update(resource_group, name, appResource) + config_server_properties = models.ConfigServerProperties() + return client.update_put(resource_group, name, config_server_properties) def config_git_set(cmd, client, resource_group, name, uri, From 891117a6d134e0e82feb7d8f7f58b002f37fe576 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Tue, 25 Aug 2020 16:40:44 +0800 Subject: [PATCH 08/37] az spring-cloud config-server set --- src/spring-cloud/azext_spring_cloud/custom.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index c4b1603e850..10eb7225395 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -715,12 +715,8 @@ def standardization(dic): git_property=git_property) config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) - cluster_esource_properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - service_resource = models.ServiceResource( - properties=cluster_esource_properties) - return sdk_no_wait(no_wait, client.update, - resource_group, name, service_resource) + return sdk_no_wait(no_wait, client.update_put, + resource_group, name, config_server_properties) def config_get(cmd, client, resource_group, name): From 2334598733479fd46bbdf70b3ca34a357fc0b9b0 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 14:39:22 +0800 Subject: [PATCH 09/37] az spring-cloud config-server git set --- .../azext_spring_cloud/commands.py | 2 +- src/spring-cloud/azext_spring_cloud/custom.py | 47 +++++++------------ 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 655f507826a..ac5cfcf41df 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -32,7 +32,7 @@ def load_command_table(self, _): g.custom_command('clear', 'config_delete') g.custom_show_command('show', 'config_get') - with self.command_group('spring-cloud config-server git', client_factory=cf_app_services, + with self.command_group('spring-cloud config-server git', client_factory=cf_config_servers, supports_local_cache=True) as g: g.custom_command('set', 'config_git_set') g.custom_command('repo add', 'config_repo_add') diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 10eb7225395..ac361c6968a 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -709,14 +709,10 @@ def standardization(dic): del config_property['repos'] config_property['repositories'] = repositories - git_property = client._deserialize( - 'ConfigServerGitProperty', config_property) - config_server_settings = models.ConfigServerSettings( - git_property=git_property) - config_server_properties = models.ConfigServerProperties( - config_server=config_server_settings) - return sdk_no_wait(no_wait, client.update_put, - resource_group, name, config_server_properties) + git_property = client._deserialize('ConfigServerGitProperty', config_property) + config_server_settings = models.ConfigServerSettings(git_property=git_property) + config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + return sdk_no_wait(no_wait, client.update_put, resource_group, name, config_server_properties) def config_get(cmd, client, resource_group, name): @@ -741,33 +737,24 @@ def config_git_set(cmd, client, resource_group, name, uri, host_key_algorithm=None, private_key=None, strict_host_key_checking=None): - resource = client.get(resource_group, name) - config_server = resource.properties.config_server_properties.config_server - config = models.ConfigServerGitProperty( - uri=uri) if not config_server else config_server.git_property + git_property = models.ConfigServerGitProperty(uri=uri) if search_paths: search_paths = search_paths.split(",") - config.uri = uri - config.label = label - config.search_paths = search_paths - config.username = username - config.password = password - config.host_key = host_key - config.host_key_algorithm = host_key_algorithm - config.private_key = private_key - config.strict_host_key_checking = strict_host_key_checking - - config_server = models.ConfigServerSettings(git_property=config) - config_server_properties = models.ConfigServerProperties( - config_server=config_server) - cluster_esource_properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - service_resource = models.ServiceResource( - properties=cluster_esource_properties) + git_property.label = label + git_property.search_paths = search_paths + git_property.username = username + git_property.password = password + git_property.host_key = host_key + git_property.host_key_algorithm = host_key_algorithm + git_property.private_key = private_key + git_property.strict_host_key_checking = strict_host_key_checking - return cached_put(cmd, client.update, service_resource, resource_group, name).result() + config_server_settings = models.ConfigServerSettings(git_property=git_property) + config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + + return cached_put(cmd, client.update_put, config_server_properties, resource_group, name).result() def config_repo_add(cmd, client, resource_group, name, uri, repo_name, From b5ac28245954aa58f2efe00a1938b6dce0342a4f Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 16:52:30 +0800 Subject: [PATCH 10/37] az spring-cloud config-server git repo add --- src/spring-cloud/azext_spring_cloud/_help.py | 8 ++--- src/spring-cloud/azext_spring_cloud/custom.py | 31 ++++++++++--------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 18f28aa8586..f8c3efdfefc 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -284,22 +284,22 @@ helps['spring-cloud config-server git repo add'] = """ type: command - short-summary: Set add a new repositry of git property of Config Server. + short-summary: Add a new repository of git property of Config Server. """ helps['spring-cloud config-server git repo remove'] = """ type: command - short-summary: Remove an existing repositry of git property of Config Server. + short-summary: Remove an existing repository of git property of Config Server. """ helps['spring-cloud config-server git repo update'] = """ type: command - short-summary: Override an existing repositry of git property of Config Server, will totally override the old one. + short-summary: Override an existing repository of git property of Config Server, will totally override the old one. """ helps['spring-cloud config-server git repo list'] = """ type: command - short-summary: List all repositries of git property of Config Server. + short-summary: List all repositories of git property of Config Server. """ helps['spring-cloud app binding'] = """ diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index ac361c6968a..c023d34af8e 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -767,24 +767,28 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, host_key_algorithm=None, private_key=None, strict_host_key_checking=None): - resource = client.get(resource_group, name) - config_server = resource.properties.config_server_properties.config_server - config = models.ConfigServerGitProperty( - uri=uri) if not config_server else config_server.git_property + config_server_resource = client.get(resource_group, name) + + config_server = config_server_resource.properties.config_server + git_property = models.ConfigServerGitProperty(uri=uri) if not config_server else config_server.git_property if search_paths: search_paths = search_paths.split(",") - if config.repositories: - repos = [repo for repo in config.repositories if repo.name == repo_name] + if pattern: + pattern = pattern.split(",") + + if git_property.repositories: + repos = [repo for repo in git_property.repositories if repo.name == repo_name] if repos: - raise CLIError("Repo '{}' already exiests.".format(repo_name)) + raise CLIError("Repo '{}' already exists.".format(repo_name)) else: - config.repositories = [] + git_property.repositories = [] repository = models.GitPatternRepository( uri=uri, name=repo_name, + pattern=pattern, label=label, search_paths=search_paths, username=username, @@ -794,15 +798,12 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, private_key=private_key, strict_host_key_checking=strict_host_key_checking) - config.repositories.append(repository) - config_server_settings = models.ConfigServerSettings(git_property=config) + git_property.repositories.append(repository) + config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) - cluster_resource_properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - service_resource = models.ServiceResource( - properties=cluster_resource_properties) - return cached_put(cmd, client.update, service_resource, resource_group, name).result() + + return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() def config_repo_delete(cmd, client, resource_group, name, repo_name): From 6c4095be565c54a8c64d579a4d9fa3a784269c2b Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 17:08:08 +0800 Subject: [PATCH 11/37] az spring-cloud git repo remove --- .../azext_spring_cloud/_params.py | 2 +- src/spring-cloud/azext_spring_cloud/custom.py | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index fd9067897cc..8d572d57b48 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -204,7 +204,7 @@ def load_arguments(self, _): for scope in ['spring-cloud config-server git repo add', 'spring-cloud config-server git repo update', 'spring-cloud config-server git repo remove']: with self.argument_context(scope) as c: - c.argument('repo_name', help='Uri of the repo.') + c.argument('repo_name', help='Name of the repo.') for scope in ['spring-cloud config-server git repo add', 'spring-cloud config-server git repo update']: with self.argument_context(scope) as c: diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index c023d34af8e..ee8966e9e3f 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -768,7 +768,6 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, private_key=None, strict_host_key_checking=None): config_server_resource = client.get(resource_group, name) - config_server = config_server_resource.properties.config_server git_property = models.ConfigServerGitProperty(uri=uri) if not config_server else config_server.git_property @@ -807,28 +806,23 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, def config_repo_delete(cmd, client, resource_group, name, repo_name): - resource = client.get(resource_group, name) - config_server = resource.properties.config_server_properties.config_server - if not config_server or not config_server.config or not config_server.config.repositories: + config_server_resource = client.get(resource_group, name) + config_server = config_server_resource.properties.config_server + if not config_server or not config_server.git_property or not config_server.git_property.repositories: raise CLIError("Repo '{}' not found.".format(repo_name)) - config = config_server.git_property - repository = [ - repo for repo in config.repositories if repo.name == repo_name] + git_property = config_server.git_property + repository = [repo for repo in git_property.repositories if repo.name == repo_name] if not repository: raise CLIError("Repo '{}' not found.".format(repo_name)) - config.repositories.remove(repository[0]) + git_property.repositories.remove(repository[0]) - config_server_settings = models.ConfigServerSettings(git_property=config) + config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) - cluster_esource_properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - service_resource = models.ServiceResource( - properties=cluster_esource_properties) - return cached_put(cmd, client.update, service_resource, resource_group, name).result() + return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() def config_repo_update(cmd, client, resource_group, name, repo_name, From d4bb66655ca9096e679e08890f4fcd654999f1c2 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 17:25:41 +0800 Subject: [PATCH 12/37] az spring-cloud config-server git repo update --- src/spring-cloud/azext_spring_cloud/custom.py | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index ee8966e9e3f..416a1f57c1a 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -836,13 +836,12 @@ def config_repo_update(cmd, client, resource_group, name, repo_name, host_key_algorithm=None, private_key=None, strict_host_key_checking=None): - resource = client.get(resource_group, name) - config_server = resource.properties.config_server_properties.config_server + config_server_resource = client.get(resource_group, name) + config_server = config_server_resource.properties.config_server if not config_server or not config_server.git_property or not config_server.git_property.repositories: raise CLIError("Repo '{}' not found.".format(repo_name)) - config = config_server.git_property - repository = [ - repo for repo in config.repositories if repo.name == repo_name] + git_property = config_server.git_property + repository = [repo for repo in git_property.repositories if repo.name == repo_name] if not repository: raise CLIError("Repo '{}' not found.".format(repo_name)) @@ -852,27 +851,26 @@ def config_repo_update(cmd, client, resource_group, name, repo_name, if pattern: pattern = pattern.split(",") - repository = repository[0] - repository = models.GitPatternRepository() - repository.uri = uri or repository.uri - repository.label = label or repository.label - repository.search_paths = search_paths or repository.search_paths - repository.username = username or repository.username - repository.password = password or repository.password - repository.host_key = host_key or repository.host_key - repository.host_key_algorithm = host_key_algorithm or repository.host_key_algorithm - repository.private_key = private_key or repository.private_key - repository.strict_host_key_checking = strict_host_key_checking or repository.strict_host_key_checking - - config_server_settings = models.ConfigServerSettings(git_property=config) - config_server_properties = models.ConfigServerProperties( - config_server=config_server_settings) - cluster_esource_properties = models.ClusterResourceProperties( - config_server_properties=config_server_properties) - service_resource = models.ServiceResource( - properties=cluster_esource_properties) + old_repository = repository[0] + git_property.repositories.remove(old_repository) - return cached_put(cmd, client.update, service_resource, resource_group, name).result() + repository = models.GitPatternRepository(name=old_repository.name, uri=uri or old_repository.uri) + repository.pattern = pattern or old_repository.pattern + repository.label = label or old_repository.label + repository.search_paths = search_paths or old_repository.search_paths + repository.username = username or old_repository.username + repository.password = password or old_repository.password + repository.host_key = host_key or old_repository.host_key + repository.host_key_algorithm = host_key_algorithm or old_repository.host_key_algorithm + repository.private_key = private_key or old_repository.private_key + repository.strict_host_key_checking = strict_host_key_checking or old_repository.strict_host_key_checking + + git_property.repositories.append(repository) + + config_server_settings = models.ConfigServerSettings(git_property=git_property) + config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + + return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() def config_repo_list(cmd, client, resource_group, name): From 013a37f325ad16b46a23e21ab9af89313f89a264 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 17:37:20 +0800 Subject: [PATCH 13/37] az spring-cloud config-server git repo list --- src/spring-cloud/azext_spring_cloud/custom.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 416a1f57c1a..30acd0f05f6 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -874,9 +874,13 @@ def config_repo_update(cmd, client, resource_group, name, repo_name, def config_repo_list(cmd, client, resource_group, name): - resource = client.get(resource_group, name) - config = resource.properties.config_server_properties.config_server.git_property - return config.repositories + config_server_resource = client.get(resource_group, name) + config_server = config_server_resource.properties.config_server + + if not config_server or not config_server.git_property or not config_server.git_property.repositories: + raise CLIError("Repos not found.") + + return config_server.git_property.repositories def binding_list(cmd, client, resource_group, service, app): From 2d3bd115732a175d836700e6bf006d52822a628e Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 17:47:46 +0800 Subject: [PATCH 14/37] fix typo --- src/spring-cloud/azext_spring_cloud/_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index f8c3efdfefc..8156ab4446e 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -21,9 +21,9 @@ text: az spring-cloud create -n MyService -g MyResourceGroup -l westus --app-insights-key MyInstrumentationKey - name: Create a new Azure Spring Cloud with distributed tracing disabled. text: az spring-cloud create -n MyService -g MyResourceGroup --disable-distributed-tracing - - name: Create a new Azure Spring Cloud with VNet-inected via giving VNet name in current resource group + - name: Create a new Azure Spring Cloud with VNet-injected via giving VNet name in current resource group text: az spring-cloud create -n MyService -g MyResourceGroup --vnet MyVNet --app-subnet MyAppSubnet --service-runtime-subnet MyServiceRuntimeSubnet - - name: Create a new Azure Spring Cloud with VNet-inected via giving subnets resource ID + - name: Create a new Azure Spring Cloud with VNet-injected via giving subnets resource ID text: az spring-cloud create -n MyService -g MyResourceGroup --app-subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyVnetRg/providers/Microsoft.Network/VirtualNetworks/test-vnet/subnets/app --service-runtime-subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyVnetRg/providers/Microsoft.Network/VirtualNetworks/test-vnet/subnets/svc --reserved-cidr-range 10.0.0.0/16,10.1.0.0/16,10.2.0.1/16 """ From 0f730b67d233d8943719f51b7c5d14f8396a5fb7 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 27 Aug 2020 17:54:26 +0800 Subject: [PATCH 15/37] fix code style errors --- src/spring-cloud/azext_spring_cloud/custom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 30acd0f05f6..bbaa3507366 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -73,6 +73,7 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in while poller.done() is False: sleep(5) + def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None, app_insights=None, disable_distributed_tracing=None, sku=None, tags=None, no_wait=False): updated_resource = models.ServiceResource() @@ -116,7 +117,7 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None trace_properties = update_tracing_config(cmd, resource_group, name, location, resource_properties, app_insights_key, app_insights, disable_distributed_tracing) sdk_no_wait(no_wait, client.monitoring_settings.update_put, - resource_group_name=resource_group, service_name=name, resource=trace_properties) + resource_group_name=resource_group, service_name=name, resource=trace_properties) # update service tags if tags is not None: @@ -1309,6 +1310,7 @@ def update_tracing_config(cmd, resource_group, service_name, location, app_insig 'Please use the Azure Portal to create and configure the Application Insights, if needed.') return trace_properties + def try_create_application_insights(cmd, resource_group, name, location): creation_failed_warn = 'Unable to create the Application Insights for the Azure Spring Cloud. ' \ 'Please use the Azure Portal to manually create and configure the Application Insights, ' \ From d1c1a52cb9d828af61fd4c3698f284f24e5ee9f9 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Fri, 28 Aug 2020 10:42:48 +0800 Subject: [PATCH 16/37] fix instance count bug --- src/spring-cloud/azext_spring_cloud/custom.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index bbaa3507366..1d2af5f02d5 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -299,7 +299,6 @@ def app_update(cmd, client, resource_group, service, name, deployment_settings = models.DeploymentSettings( cpu=None, memory_in_gb=None, - instance_count=None, environment_variables=env, jvm_options=jvm_options, runtime_version=runtime_version,) From ec405c44ca10057c65679b1c30cffec68149dcc2 Mon Sep 17 00:00:00 2001 From: shipeng Date: Fri, 28 Aug 2020 10:46:54 +0800 Subject: [PATCH 17/37] fix bug --- src/spring-cloud/azext_spring_cloud/custom.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 1d2af5f02d5..a68e361941e 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -89,9 +89,8 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None resource = client.services.get(resource_group, name) location = resource.location - resource_properties = resource.properties updated_resource_properties = models.ClusterResourceProperties() - trace_properties = client.monitoring_settings.get(resource_group, name) + trace_properties = client.monitoring_settings.get(resource_group, name).properties trace_enabled = trace_properties.trace_enabled if trace_properties is not None else False app_insights_target_status = False @@ -99,7 +98,7 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None app_insights_target_status = True if trace_enabled is False: update_app_insights = True - elif app_insights_key != trace_properties.app_insights_instrumentation_key: + elif app_insights is not None or (app_insights_key is not None and app_insights_key != trace_properties.app_insights_instrumentation_key): update_app_insights = True elif disable_distributed_tracing is True: app_insights_target_status = False @@ -114,17 +113,17 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None and app_insights is None and app_insights_key is None: trace_properties.trace_enabled = app_insights_target_status else: - trace_properties = update_tracing_config(cmd, resource_group, name, location, resource_properties, + trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, disable_distributed_tracing) - sdk_no_wait(no_wait, client.monitoring_settings.update_put, - resource_group_name=resource_group, service_name=name, resource=trace_properties) + sdk_no_wait(no_wait, client.monitoring_settings.update_patch, + resource_group_name=resource_group, service_name=name, properties=trace_properties) # update service tags if tags is not None: updated_resource.tags = tags update_service_tags = True - if update_app_insights is False and update_service_tags is False and update_service_sku is False: + if update_service_tags is False and update_service_sku is False: return resource updated_resource.properties = updated_resource_properties From 7a8ae4455f998d89d6808988a256b3e260e959e6 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Fri, 28 Aug 2020 13:10:21 +0800 Subject: [PATCH 18/37] fix bug https://dev.azure.com/msazure/AzureDMSS/_workitems/edit/8034116 --- src/spring-cloud/azext_spring_cloud/custom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index a68e361941e..b7b6ddfdb0e 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -632,6 +632,9 @@ def deployment_create(cmd, client, resource_group, service, app, name, if not skip_clone_settings: active_deployment_name = client.apps.get( resource_group, service, app).properties.active_deployment_name + if not active_deployment_name: + raise CLIError("No production deployment found, use --skip-clone-settings to skip copying settings from " + "production deployment.") active_deployment = client.deployments.get( resource_group, service, app, active_deployment_name) if active_deployment: From 613769f4e83e6dcf24a4ca89fd74fffcaad0c6b4 Mon Sep 17 00:00:00 2001 From: shipeng Date: Fri, 28 Aug 2020 13:13:32 +0800 Subject: [PATCH 19/37] add log --- src/spring-cloud/azext_spring_cloud/custom.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index b7b6ddfdb0e..92a27e24a2e 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -64,14 +64,16 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in poller = client.services.create_or_update( resource_group, name, resource) while poller.done() is False: - sleep(5) + logger.warning(" - Creating Service ..") + sleep(15) if disable_distributed_tracing is not True: + logger.warning("Start configure distributed tracing") trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, disable_distributed_tracing) if trace_properties is not None: - poller = client.monitoring_settings.update_put(resource_group, name, trace_properties) - while poller.done() is False: - sleep(5) + sdk_no_wait(no_wait, client.monitoring_settings.update_put, + resource_group_name=resource_group, service_name=name, properties=trace_properties) + return poller def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None, app_insights=None, @@ -115,7 +117,7 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None else: trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, disable_distributed_tracing) - sdk_no_wait(no_wait, client.monitoring_settings.update_patch, + sdk_no_wait(no_wait, client.monitoring_settings.update_put, resource_group_name=resource_group, service_name=name, properties=trace_properties) # update service tags From 26bf454a98771f6fabf1a9c2247b1b96ced37737 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Fri, 28 Aug 2020 18:27:25 +0800 Subject: [PATCH 20/37] fix sku bug --- src/spring-cloud/azext_spring_cloud/custom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index b7b6ddfdb0e..2493311767d 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -219,7 +219,7 @@ def app_create(cmd, client, resource_group, service, name, properties = models.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) - sku = models.Sku(capacity=instance_count) + sku = models.Sku(name="S0", tier="STANDARD", capacity=instance_count) # create default deployment logger.warning( @@ -451,7 +451,7 @@ def app_scale(cmd, client, resource_group, service, name, memory_in_gb=memory) properties = models.DeploymentResourceProperties( deployment_settings=deployment_settings) - sku = models.Sku(capacity=instance_count) + sku = models.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) @@ -1137,7 +1137,7 @@ def _app_deploy(client, resource_group, service, app, name, version, path, runti environment_variables=env, jvm_options=jvm_options, runtime_version=runtime_version) - sku = models.Sku(capacity=instance_count) + sku = models.Sku(name="S0", tier="STANDARD", capacity=instance_count) user_source_info = models.UserSourceInfo( version=version, relative_path=relative_path, From 98987157bc494230b0b3cc50628acf2cddad8725 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Wed, 2 Sep 2020 10:23:55 +0800 Subject: [PATCH 21/37] upgrade version to 2.0.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 fcec8baed2c..d358b5dcd97 100644 --- a/src/spring-cloud/HISTORY.md +++ b/src/spring-cloud/HISTORY.md @@ -1,5 +1,9 @@ Release History =============== +2.0.0 +----- +* Switch api-version from 2019-05-01-preview to 2020-07-01 + 1.0.0 ----- * Bump version to 1.0.0 diff --git a/src/spring-cloud/setup.py b/src/spring-cloud/setup.py index 65796c70c67..bddb69af235 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 = '1.0.0' +VERSION = '2.0.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 14ee13b61f860d53cb34d92a8072c6793f960c48 Mon Sep 17 00:00:00 2001 From: shipeng Date: Thu, 3 Sep 2020 09:13:17 +0800 Subject: [PATCH 22/37] make log clearly --- src/spring-cloud/azext_spring_cloud/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 808ead1b198..7a8d1f93e34 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -63,9 +63,9 @@ def spring_cloud_create(cmd, client, resource_group, name, location=None, app_in poller = client.services.create_or_update( resource_group, name, resource) + logger.warning(" - Creating Service ..") while poller.done() is False: - logger.warning(" - Creating Service ..") - sleep(15) + sleep(5) if disable_distributed_tracing is not True: logger.warning("Start configure distributed tracing") trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, From 211c5613910aa42c581fa00447bf15c1bd6d4208 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Tue, 22 Sep 2020 15:26:03 +0800 Subject: [PATCH 23/37] add validate config server settings --- src/spring-cloud/azext_spring_cloud/custom.py | 17 +- .../_app_platform_management_client.py | 25 +- .../appplatform/models/__init__.py | 19 ++ .../_app_platform_management_client_enums.py | 15 + .../appplatform/models/_models.py | 268 +++++++++++++---- .../appplatform/models/_models_py3.py | 270 ++++++++++++++---- .../appplatform/models/_paged_models.py | 16 +- .../appplatform/operations/__init__.py | 2 + .../operations/_apps_operations.py | 26 +- .../operations/_bindings_operations.py | 16 +- .../operations/_certificates_operations.py | 13 +- .../operations/_config_servers_operations.py | 123 +++++++- .../operations/_custom_domains_operations.py | 17 +- .../operations/_deployments_operations.py | 28 +- .../_monitoring_settings_operations.py | 17 +- .../appplatform/operations/_operations.py | 2 +- .../_runtime_versions_operations.py | 93 ++++++ .../operations/_services_operations.py | 31 +- .../appplatform/operations/_sku_operations.py | 106 ------- .../operations/_skus_operations.py | 2 +- .../vendored_sdks/appplatform/version.py | 2 +- 21 files changed, 793 insertions(+), 315 deletions(-) create mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_runtime_versions_operations.py delete mode 100644 src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_sku_operations.py diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 7a8d1f93e34..7a3a8c17999 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -675,6 +675,16 @@ def deployment_delete(cmd, client, resource_group, service, app, name): client.deployments.get(resource_group, service, app, name) return client.deployments.delete(resource_group, service, app, name) +def validate_config_server_settings(client, resource_group, name, git_property): + result = sdk_no_wait(False, client.validate, resource_group, name, git_property).result() + if not result.is_valid: + for item in result.details: + if not item.name: + logger.error("Default Repository with uri \"%s\" meet error:", item.uri) + else: + logger.error("Pattern Repository with name \"%s\", uri \"%s\" meet error:", item.name, item.uri) + logger.error("\n".join(item.messages)) + raise CLIError("Config server settings validate with error.") def config_set(cmd, client, resource_group, name, config_file, no_wait=False): def standardization(dic): @@ -716,6 +726,8 @@ def standardization(dic): git_property = client._deserialize('ConfigServerGitProperty', config_property) config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + + validate_config_server_settings(client, resource_group, name, git_property) return sdk_no_wait(no_wait, client.update_put, resource_group, name, config_server_properties) @@ -758,9 +770,9 @@ def config_git_set(cmd, client, resource_group, name, uri, config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + validate_config_server_settings(client, resource_group, name, git_property) return cached_put(cmd, client.update_put, config_server_properties, resource_group, name).result() - def config_repo_add(cmd, client, resource_group, name, uri, repo_name, pattern=None, label=None, @@ -806,6 +818,7 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) + validate_config_server_settings(client, resource_group, name, git_property) return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() @@ -826,6 +839,7 @@ def config_repo_delete(cmd, client, resource_group, name, repo_name): config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) + validate_config_server_settings(client, resource_group, name, git_property) return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() @@ -874,6 +888,7 @@ def config_repo_update(cmd, client, resource_group, name, repo_name, config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + validate_config_server_settings(client, resource_group, name, git_property) return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() 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 0f2d45899f7..ca5a03e81bd 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 @@ -22,6 +22,7 @@ from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations +from .operations import RuntimeVersionsOperations from .operations import SkusOperations from . import models @@ -33,25 +34,27 @@ class AppPlatformManagementClient(SDKClient): :vartype config: AppPlatformManagementClientConfiguration :ivar services: Services operations - :vartype services: azure.mgmt.appplatform.operations.ServicesOperations + :vartype services: azure.mgmt.appplatform.v2020_07_01.operations.ServicesOperations :ivar config_servers: ConfigServers operations - :vartype config_servers: azure.mgmt.appplatform.operations.ConfigServersOperations + :vartype config_servers: azure.mgmt.appplatform.v2020_07_01.operations.ConfigServersOperations :ivar monitoring_settings: MonitoringSettings operations - :vartype monitoring_settings: azure.mgmt.appplatform.operations.MonitoringSettingsOperations + :vartype monitoring_settings: azure.mgmt.appplatform.v2020_07_01.operations.MonitoringSettingsOperations :ivar apps: Apps operations - :vartype apps: azure.mgmt.appplatform.operations.AppsOperations + :vartype apps: azure.mgmt.appplatform.v2020_07_01.operations.AppsOperations :ivar bindings: Bindings operations - :vartype bindings: azure.mgmt.appplatform.operations.BindingsOperations + :vartype bindings: azure.mgmt.appplatform.v2020_07_01.operations.BindingsOperations :ivar certificates: Certificates operations - :vartype certificates: azure.mgmt.appplatform.operations.CertificatesOperations + :vartype certificates: azure.mgmt.appplatform.v2020_07_01.operations.CertificatesOperations :ivar custom_domains: CustomDomains operations - :vartype custom_domains: azure.mgmt.appplatform.operations.CustomDomainsOperations + :vartype custom_domains: azure.mgmt.appplatform.v2020_07_01.operations.CustomDomainsOperations :ivar deployments: Deployments operations - :vartype deployments: azure.mgmt.appplatform.operations.DeploymentsOperations + :vartype deployments: azure.mgmt.appplatform.v2020_07_01.operations.DeploymentsOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.appplatform.operations.Operations + :vartype operations: azure.mgmt.appplatform.v2020_07_01.operations.Operations + :ivar runtime_versions: RuntimeVersions operations + :vartype runtime_versions: azure.mgmt.appplatform.v2020_07_01.operations.RuntimeVersionsOperations :ivar skus: Skus operations - :vartype skus: azure.mgmt.appplatform.operations.SkusOperations + :vartype skus: azure.mgmt.appplatform.v2020_07_01.operations.SkusOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -92,5 +95,7 @@ def __init__( 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/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py index f344f11ac6f..4ce60886aab 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/__init__.py @@ -12,6 +12,7 @@ try: 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 @@ -21,6 +22,8 @@ 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 @@ -41,6 +44,7 @@ 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 @@ -59,6 +63,7 @@ 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 @@ -66,6 +71,7 @@ except (SyntaxError, ImportError): from ._models import AppResource from ._models import AppResourceProperties + from ._models import AvailableRuntimeVersions from ._models import BindingResource from ._models import BindingResourceProperties from ._models import CertificateProperties @@ -75,6 +81,8 @@ 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 @@ -95,6 +103,7 @@ 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 @@ -113,6 +122,7 @@ 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 @@ -139,11 +149,14 @@ SkuScaleType, ResourceSkuRestrictionsType, ResourceSkuRestrictionsReasonCode, + SupportedRuntimeValue, + SupportedRuntimePlatform, ) __all__ = [ 'AppResource', 'AppResourceProperties', + 'AvailableRuntimeVersions', 'BindingResource', 'BindingResourceProperties', 'CertificateProperties', @@ -153,6 +166,8 @@ 'ConfigServerProperties', 'ConfigServerResource', 'ConfigServerSettings', + 'ConfigServerSettingsErrorRecord', + 'ConfigServerSettingsValidateResult', 'CustomDomainProperties', 'CustomDomainResource', 'CustomDomainValidatePayload', @@ -173,6 +188,7 @@ 'NameAvailability', 'NameAvailabilityParameters', 'NetworkProfile', + 'NetworkProfileOutboundIPs', 'OperationDetail', 'OperationDisplay', 'OperationProperties', @@ -191,6 +207,7 @@ 'ServiceSpecification', 'Sku', 'SkuCapacity', + 'SupportedRuntimeVersion', 'TemporaryDisk', 'TestKeys', 'TrackedResource', @@ -216,4 +233,6 @@ 'SkuScaleType', 'ResourceSkuRestrictionsType', 'ResourceSkuRestrictionsReasonCode', + 'SupportedRuntimeValue', + 'SupportedRuntimePlatform', ] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py index bff22e84211..b24c6101642 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_app_platform_management_client_enums.py @@ -67,6 +67,7 @@ class AppResourceProvisioningState(str, Enum): class UserSourceType(str, Enum): jar = "Jar" + net_core_zip = "NetCoreZip" source = "Source" @@ -74,6 +75,7 @@ class RuntimeVersion(str, Enum): java_8 = "Java_8" java_11 = "Java_11" + net_core_31 = "NetCore_31" class DeploymentResourceProvisioningState(str, Enum): @@ -112,3 +114,16 @@ 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/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py index 17feea62546..899625f1fad 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models.py @@ -90,9 +90,11 @@ class AppResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the App resource - :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.AppResourceProperties :param identity: The Managed Identity type of the app resource - :type identity: ~azure.mgmt.appplatform.models.ManagedIdentityProperties + :type identity: + ~azure.mgmt.appplatform.v2020_07_01.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -133,7 +135,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.models.AppResourceProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.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. @@ -143,9 +145,11 @@ class AppResourceProperties(Model): :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.models.TemporaryDisk + :type temporary_disk: + ~azure.mgmt.appplatform.v2020_07_01.models.TemporaryDisk :param persistent_disk: Persistent disk settings - :type persistent_disk: ~azure.mgmt.appplatform.models.PersistentDisk + :type persistent_disk: + ~azure.mgmt.appplatform.v2020_07_01.models.PersistentDisk """ _validation = { @@ -179,6 +183,30 @@ def __init__(self, **kwargs): self.persistent_disk = kwargs.get('persistent_disk', 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.v2020_07_01.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. @@ -192,7 +220,8 @@ class BindingResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the Binding resource - :type properties: ~azure.mgmt.appplatform.models.BindingResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.BindingResourceProperties """ _validation = { @@ -352,7 +381,8 @@ class CertificateResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the certificate resource payload. - :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.CertificateProperties """ _validation = { @@ -377,7 +407,7 @@ class CloudError(Model): """An error response from the service. :param error: An error response from the service. - :type error: ~azure.mgmt.appplatform.models.CloudErrorBody + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.CloudErrorBody """ _attribute_map = { @@ -414,7 +444,8 @@ class CloudErrorBody(Model): of the property in error. :type target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.appplatform.models.CloudErrorBody] + :type details: + list[~azure.mgmt.appplatform.v2020_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -442,16 +473,15 @@ class ClusterResourceProperties(Model): values include: 'Creating', 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.models.ProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.models.ProvisioningState :param network_profile: Network profile of the Service - :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile + :type network_profile: + ~azure.mgmt.appplatform.v2020_07_01.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 - :param network_profile: Network profile of the Service - :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile """ _validation = { @@ -465,7 +495,6 @@ class ClusterResourceProperties(Model): 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, 'version': {'key': 'version', 'type': 'int'}, 'service_id': {'key': 'serviceId', 'type': 'str'}, - 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, } def __init__(self, **kwargs): @@ -474,7 +503,6 @@ def __init__(self, **kwargs): self.network_profile = kwargs.get('network_profile', None) self.version = None self.service_id = None - self.network_profile = kwargs.get('network_profile', None) class ConfigServerGitProperty(Model): @@ -484,7 +512,7 @@ class ConfigServerGitProperty(Model): :param repositories: Repositories of git. :type repositories: - list[~azure.mgmt.appplatform.models.GitPatternRepository] + list[~azure.mgmt.appplatform.v2020_07_01.models.GitPatternRepository] :param uri: Required. URI of the repository :type uri: str :param label: Label of the repository @@ -545,11 +573,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.models.ConfigServerState + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerState :param error: Error when apply config server settings. - :type error: ~azure.mgmt.appplatform.models.Error + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.Error :param config_server: Settings of config server. - :type config_server: ~azure.mgmt.appplatform.models.ConfigServerSettings + :type config_server: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettings """ _validation = { @@ -582,7 +611,8 @@ class ConfigServerResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the Config Server resource - :type properties: ~azure.mgmt.appplatform.models.ConfigServerProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerProperties """ _validation = { @@ -607,7 +637,8 @@ class ConfigServerSettings(Model): """The settings of config server. :param git_property: Property of git environment. - :type git_property: ~azure.mgmt.appplatform.models.ConfigServerGitProperty + :type git_property: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerGitProperty """ _attribute_map = { @@ -619,6 +650,51 @@ def __init__(self, **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.v2020_07_01.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. @@ -663,7 +739,8 @@ class CustomDomainResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the custom domain resource. - :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainProperties """ _validation = { @@ -740,6 +817,8 @@ class DeploymentInstance(Model): :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 = { @@ -747,6 +826,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -754,6 +834,7 @@ class DeploymentInstance(Model): '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): @@ -762,6 +843,7 @@ def __init__(self, **kwargs): self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -778,9 +860,9 @@ class DeploymentResource(ProxyResource): :vartype type: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.models.Sku """ _validation = { @@ -810,28 +892,28 @@ class DeploymentResourceProperties(Model): sending a request. :param source: Uploaded source information of the deployment. - :type source: ~azure.mgmt.appplatform.models.UserSourceInfo + :type source: ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentSettings + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentResourceProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentResourceStatus + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentInstance] + list[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentInstance] """ _validation = { @@ -877,18 +959,22 @@ class DeploymentSettings(Model): :type memory_in_gb: int :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' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or - ~azure.mgmt.appplatform.models.RuntimeVersion + ~azure.mgmt.appplatform.v2020_07_01.models.RuntimeVersion """ _attribute_map = { 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, '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'}, } @@ -898,6 +984,7 @@ def __init__(self, **kwargs): self.cpu = kwargs.get('cpu', 1) self.memory_in_gb = kwargs.get('memory_in_gb', 1) 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) @@ -1036,7 +1123,8 @@ 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.models.ManagedIdentityType + :type type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.ManagedIdentityType :param principal_id: Principal Id :type principal_id: str :param tenant_id: Tenant Id @@ -1101,7 +1189,8 @@ class MetricSpecification(Model): 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.models.MetricDimension] + :type dimensions: + list[~azure.mgmt.appplatform.v2020_07_01.models.MetricDimension] """ _attribute_map = { @@ -1140,9 +1229,9 @@ 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.models.MonitoringSettingState + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingState :param error: Error when apply Monitoring Setting changes. - :type error: ~azure.mgmt.appplatform.models.Error + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.Error :param trace_enabled: Indicates whether enable the trace functionality :type trace_enabled: bool :param app_insights_instrumentation_key: Target application insight @@ -1183,7 +1272,7 @@ class MonitoringSettingResource(ProxyResource): :vartype type: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingProperties """ _validation = { @@ -1258,6 +1347,9 @@ def __init__(self, **kwargs): 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 @@ -1272,14 +1364,23 @@ class NetworkProfile(Model): :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.v2020_07_01.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'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'}, } def __init__(self, **kwargs): @@ -1289,6 +1390,30 @@ def __init__(self, **kwargs): 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 + + +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): @@ -1299,11 +1424,12 @@ class OperationDetail(Model): :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.models.OperationDisplay + :type display: ~azure.mgmt.appplatform.v2020_07_01.models.OperationDisplay :param origin: Origin of the operation :type origin: str :param properties: Properties of the operation - :type properties: ~azure.mgmt.appplatform.models.OperationProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.OperationProperties """ _attribute_map = { @@ -1356,7 +1482,7 @@ class OperationProperties(Model): :param service_specification: Service specifications of the operation :type service_specification: - ~azure.mgmt.appplatform.models.ServiceSpecification + ~azure.mgmt.appplatform.v2020_07_01.models.ServiceSpecification """ _attribute_map = { @@ -1407,7 +1533,8 @@ 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.models.TestKeyType + :type key_type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.TestKeyType """ _validation = { @@ -1433,18 +1560,18 @@ class ResourceSku(Model): :param tier: Gets the tier of SKU. :type tier: str :param capacity: Gets the capacity of SKU. - :type capacity: ~azure.mgmt.appplatform.models.SkuCapacity + :type capacity: ~azure.mgmt.appplatform.v2020_07_01.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.models.ResourceSkuLocationInfo] + list[~azure.mgmt.appplatform.v2020_07_01.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.models.ResourceSkuRestrictions] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictions] """ _attribute_map = { @@ -1498,7 +1625,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.models.ResourceSkuZoneDetails] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuZoneDetails] """ _attribute_map = { @@ -1540,7 +1667,7 @@ class ResourceSkuRestrictions(Model): :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' :type type: str or - ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsType + ~azure.mgmt.appplatform.v2020_07_01.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. @@ -1548,11 +1675,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.models.ResourceSkuRestrictionInfo + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictionInfo :param reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' :type reason_code: str or - ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsReasonCode + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictionsReasonCode """ _attribute_map = { @@ -1580,7 +1707,7 @@ class ResourceSkuZoneDetails(Model): the SKU in the specified list of zones. :type capabilities: - list[~azure.mgmt.appplatform.models.ResourceSkuCapabilities] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuCapabilities] """ _attribute_map = { @@ -1671,9 +1798,10 @@ class ServiceResource(TrackedResource): describe the resource. :type tags: dict[str, str] :param properties: Properties of the Service resource - :type properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.ClusterResourceProperties :param sku: Sku of the Service resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.models.Sku """ _validation = { @@ -1703,11 +1831,11 @@ class ServiceSpecification(Model): :param log_specifications: Specifications of the Log for Azure Monitoring :type log_specifications: - list[~azure.mgmt.appplatform.models.LogSpecification] + list[~azure.mgmt.appplatform.v2020_07_01.models.LogSpecification] :param metric_specifications: Specifications of the Metrics for Azure Monitoring :type metric_specifications: - list[~azure.mgmt.appplatform.models.MetricSpecification] + list[~azure.mgmt.appplatform.v2020_07_01.models.MetricSpecification] """ _attribute_map = { @@ -1758,7 +1886,8 @@ class SkuCapacity(Model): :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.models.SkuScaleType + :type scale_type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SkuScaleType """ _validation = { @@ -1780,6 +1909,34 @@ def __init__(self, **kwargs): 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.v2020_07_01.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.v2020_07_01.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. @@ -1840,8 +1997,9 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' - :type type: str or ~azure.mgmt.appplatform.models.UserSourceType + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2020_07_01.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/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py index 57b9f714d6a..261e7655946 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py @@ -90,9 +90,11 @@ class AppResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the App resource - :type properties: ~azure.mgmt.appplatform.models.AppResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.AppResourceProperties :param identity: The Managed Identity type of the app resource - :type identity: ~azure.mgmt.appplatform.models.ManagedIdentityProperties + :type identity: + ~azure.mgmt.appplatform.v2020_07_01.models.ManagedIdentityProperties :param location: The GEO location of the application, always the same with its parent resource :type location: str @@ -133,7 +135,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.models.AppResourceProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.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. @@ -143,9 +145,11 @@ class AppResourceProperties(Model): :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.models.TemporaryDisk + :type temporary_disk: + ~azure.mgmt.appplatform.v2020_07_01.models.TemporaryDisk :param persistent_disk: Persistent disk settings - :type persistent_disk: ~azure.mgmt.appplatform.models.PersistentDisk + :type persistent_disk: + ~azure.mgmt.appplatform.v2020_07_01.models.PersistentDisk """ _validation = { @@ -179,6 +183,30 @@ def __init__(self, *, public: bool=None, active_deployment_name: str=None, fqdn: self.persistent_disk = persistent_disk +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.v2020_07_01.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. @@ -192,7 +220,8 @@ class BindingResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the Binding resource - :type properties: ~azure.mgmt.appplatform.models.BindingResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.BindingResourceProperties """ _validation = { @@ -352,7 +381,8 @@ class CertificateResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the certificate resource payload. - :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.CertificateProperties """ _validation = { @@ -377,7 +407,7 @@ class CloudError(Model): """An error response from the service. :param error: An error response from the service. - :type error: ~azure.mgmt.appplatform.models.CloudErrorBody + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.CloudErrorBody """ _attribute_map = { @@ -414,7 +444,8 @@ class CloudErrorBody(Model): of the property in error. :type target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.appplatform.models.CloudErrorBody] + :type details: + list[~azure.mgmt.appplatform.v2020_07_01.models.CloudErrorBody] """ _attribute_map = { @@ -442,16 +473,15 @@ class ClusterResourceProperties(Model): values include: 'Creating', 'Updating', 'Deleting', 'Deleted', 'Succeeded', 'Failed', 'Moving', 'Moved', 'MoveFailed' :vartype provisioning_state: str or - ~azure.mgmt.appplatform.models.ProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.models.ProvisioningState :param network_profile: Network profile of the Service - :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile + :type network_profile: + ~azure.mgmt.appplatform.v2020_07_01.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 - :param network_profile: Network profile of the Service - :type network_profile: ~azure.mgmt.appplatform.models.NetworkProfile """ _validation = { @@ -465,7 +495,6 @@ class ClusterResourceProperties(Model): 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, 'version': {'key': 'version', 'type': 'int'}, 'service_id': {'key': 'serviceId', 'type': 'str'}, - 'network_profile': {'key': 'networkProfile', 'type': 'NetworkProfile'}, } def __init__(self, *, network_profile=None, **kwargs) -> None: @@ -474,7 +503,6 @@ def __init__(self, *, network_profile=None, **kwargs) -> None: self.network_profile = network_profile self.version = None self.service_id = None - self.network_profile = network_profile class ConfigServerGitProperty(Model): @@ -484,7 +512,7 @@ class ConfigServerGitProperty(Model): :param repositories: Repositories of git. :type repositories: - list[~azure.mgmt.appplatform.models.GitPatternRepository] + list[~azure.mgmt.appplatform.v2020_07_01.models.GitPatternRepository] :param uri: Required. URI of the repository :type uri: str :param label: Label of the repository @@ -545,11 +573,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.models.ConfigServerState + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerState :param error: Error when apply config server settings. - :type error: ~azure.mgmt.appplatform.models.Error + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.Error :param config_server: Settings of config server. - :type config_server: ~azure.mgmt.appplatform.models.ConfigServerSettings + :type config_server: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerSettings """ _validation = { @@ -582,7 +611,8 @@ class ConfigServerResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the Config Server resource - :type properties: ~azure.mgmt.appplatform.models.ConfigServerProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerProperties """ _validation = { @@ -607,7 +637,8 @@ class ConfigServerSettings(Model): """The settings of config server. :param git_property: Property of git environment. - :type git_property: ~azure.mgmt.appplatform.models.ConfigServerGitProperty + :type git_property: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerGitProperty """ _attribute_map = { @@ -619,6 +650,51 @@ def __init__(self, *, git_property=None, **kwargs) -> None: 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.v2020_07_01.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. @@ -663,7 +739,8 @@ class CustomDomainResource(ProxyResource): :ivar type: The type of the resource. :vartype type: str :param properties: Properties of the custom domain resource. - :type properties: ~azure.mgmt.appplatform.models.CustomDomainProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainProperties """ _validation = { @@ -740,6 +817,8 @@ class DeploymentInstance(Model): :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 = { @@ -747,6 +826,7 @@ class DeploymentInstance(Model): 'status': {'readonly': True}, 'reason': {'readonly': True}, 'discovery_status': {'readonly': True}, + 'start_time': {'readonly': True}, } _attribute_map = { @@ -754,6 +834,7 @@ class DeploymentInstance(Model): '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: @@ -762,6 +843,7 @@ def __init__(self, **kwargs) -> None: self.status = None self.reason = None self.discovery_status = None + self.start_time = None class DeploymentResource(ProxyResource): @@ -778,9 +860,9 @@ class DeploymentResource(ProxyResource): :vartype type: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.models.Sku """ _validation = { @@ -810,28 +892,28 @@ class DeploymentResourceProperties(Model): sending a request. :param source: Uploaded source information of the deployment. - :type source: ~azure.mgmt.appplatform.models.UserSourceInfo + :type source: ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentSettings + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentResourceProvisioningState + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentResourceStatus + ~azure.mgmt.appplatform.v2020_07_01.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.models.DeploymentInstance] + list[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentInstance] """ _validation = { @@ -877,27 +959,32 @@ class DeploymentSettings(Model): :type memory_in_gb: int :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' + 'Java_8', 'Java_11', 'NetCore_31' :type runtime_version: str or - ~azure.mgmt.appplatform.models.RuntimeVersion + ~azure.mgmt.appplatform.v2020_07_01.models.RuntimeVersion """ _attribute_map = { 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, '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, jvm_options: str=None, environment_variables=None, runtime_version=None, **kwargs) -> None: + def __init__(self, *, cpu: int=1, memory_in_gb: int=1, 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.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 @@ -1036,7 +1123,8 @@ 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.models.ManagedIdentityType + :type type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.ManagedIdentityType :param principal_id: Principal Id :type principal_id: str :param tenant_id: Tenant Id @@ -1101,7 +1189,8 @@ class MetricSpecification(Model): 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.models.MetricDimension] + :type dimensions: + list[~azure.mgmt.appplatform.v2020_07_01.models.MetricDimension] """ _attribute_map = { @@ -1140,9 +1229,9 @@ 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.models.MonitoringSettingState + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingState :param error: Error when apply Monitoring Setting changes. - :type error: ~azure.mgmt.appplatform.models.Error + :type error: ~azure.mgmt.appplatform.v2020_07_01.models.Error :param trace_enabled: Indicates whether enable the trace functionality :type trace_enabled: bool :param app_insights_instrumentation_key: Target application insight @@ -1183,7 +1272,7 @@ class MonitoringSettingResource(ProxyResource): :vartype type: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingProperties """ _validation = { @@ -1258,6 +1347,9 @@ def __init__(self, *, type: str, name: str, **kwargs) -> 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 @@ -1272,14 +1364,23 @@ class NetworkProfile(Model): :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.v2020_07_01.models.NetworkProfileOutboundIPs """ + _validation = { + 'outbound_ips': {'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'}, } 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: @@ -1289,6 +1390,30 @@ def __init__(self, *, service_runtime_subnet_id: str=None, app_subnet_id: str=No 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 + + +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): @@ -1299,11 +1424,12 @@ class OperationDetail(Model): :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.models.OperationDisplay + :type display: ~azure.mgmt.appplatform.v2020_07_01.models.OperationDisplay :param origin: Origin of the operation :type origin: str :param properties: Properties of the operation - :type properties: ~azure.mgmt.appplatform.models.OperationProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.OperationProperties """ _attribute_map = { @@ -1356,7 +1482,7 @@ class OperationProperties(Model): :param service_specification: Service specifications of the operation :type service_specification: - ~azure.mgmt.appplatform.models.ServiceSpecification + ~azure.mgmt.appplatform.v2020_07_01.models.ServiceSpecification """ _attribute_map = { @@ -1407,7 +1533,8 @@ 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.models.TestKeyType + :type key_type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.TestKeyType """ _validation = { @@ -1433,18 +1560,18 @@ class ResourceSku(Model): :param tier: Gets the tier of SKU. :type tier: str :param capacity: Gets the capacity of SKU. - :type capacity: ~azure.mgmt.appplatform.models.SkuCapacity + :type capacity: ~azure.mgmt.appplatform.v2020_07_01.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.models.ResourceSkuLocationInfo] + list[~azure.mgmt.appplatform.v2020_07_01.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.models.ResourceSkuRestrictions] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictions] """ _attribute_map = { @@ -1498,7 +1625,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.models.ResourceSkuZoneDetails] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuZoneDetails] """ _attribute_map = { @@ -1540,7 +1667,7 @@ class ResourceSkuRestrictions(Model): :param type: Gets the type of restrictions. Possible values include: 'Location', 'Zone' :type type: str or - ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsType + ~azure.mgmt.appplatform.v2020_07_01.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. @@ -1548,11 +1675,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.models.ResourceSkuRestrictionInfo + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictionInfo :param reason_code: Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' :type reason_code: str or - ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsReasonCode + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuRestrictionsReasonCode """ _attribute_map = { @@ -1580,7 +1707,7 @@ class ResourceSkuZoneDetails(Model): the SKU in the specified list of zones. :type capabilities: - list[~azure.mgmt.appplatform.models.ResourceSkuCapabilities] + list[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuCapabilities] """ _attribute_map = { @@ -1671,9 +1798,10 @@ class ServiceResource(TrackedResource): describe the resource. :type tags: dict[str, str] :param properties: Properties of the Service resource - :type properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.models.ClusterResourceProperties :param sku: Sku of the Service resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.models.Sku """ _validation = { @@ -1703,11 +1831,11 @@ class ServiceSpecification(Model): :param log_specifications: Specifications of the Log for Azure Monitoring :type log_specifications: - list[~azure.mgmt.appplatform.models.LogSpecification] + list[~azure.mgmt.appplatform.v2020_07_01.models.LogSpecification] :param metric_specifications: Specifications of the Metrics for Azure Monitoring :type metric_specifications: - list[~azure.mgmt.appplatform.models.MetricSpecification] + list[~azure.mgmt.appplatform.v2020_07_01.models.MetricSpecification] """ _attribute_map = { @@ -1758,7 +1886,8 @@ class SkuCapacity(Model): :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.models.SkuScaleType + :type scale_type: str or + ~azure.mgmt.appplatform.v2020_07_01.models.SkuScaleType """ _validation = { @@ -1780,6 +1909,34 @@ def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_ 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.v2020_07_01.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.v2020_07_01.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. @@ -1840,8 +1997,9 @@ class UserSourceInfo(Model): """Source information for a deployment. :param type: Type of the source uploaded. Possible values include: 'Jar', - 'Source' - :type type: str or ~azure.mgmt.appplatform.models.UserSourceType + 'NetCoreZip', 'Source' + :type type: str or + ~azure.mgmt.appplatform.v2020_07_01.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/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py index d04b54cc306..e7bdca927d0 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py @@ -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/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py index b886c1ca927..0a24a9df9f9 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py @@ -18,6 +18,7 @@ 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__ = [ @@ -30,5 +31,6 @@ 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', + 'RuntimeVersionsOperations', 'SkusOperations', ] diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py index 719f0b52279..16c38b6374b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_apps_operations.py @@ -61,7 +61,7 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: AppResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.AppResource or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.AppResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -179,7 +179,8 @@ def create_or_update( :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.models.AppResource + :type app_resource: + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -188,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.models.AppResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.AppResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.AppResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -372,7 +373,8 @@ def update( :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.models.AppResource + :type app_resource: + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -381,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.models.AppResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.AppResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.AppResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -431,7 +433,7 @@ def list( overrides`. :return: An iterator like instance of AppResource :rtype: - ~azure.mgmt.appplatform.models.AppResourcePaged[~azure.mgmt.appplatform.models.AppResource] + ~azure.mgmt.appplatform.v2020_07_01.models.AppResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.AppResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -507,7 +509,8 @@ def get_resource_upload_url( :param operation_config: :ref:`Operation configuration overrides`. :return: ResourceUploadDefinition or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.ResourceUploadDefinition or + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceUploadDefinition or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -575,8 +578,9 @@ def validate_domain( :param operation_config: :ref:`Operation configuration overrides`. :return: CustomDomainValidateResult or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CustomDomainValidateResult or - ~msrest.pipeline.ClientRawResponse + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainValidateResult + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ validate_payload = models.CustomDomainValidatePayload(name=name) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py index 5965148cd72..c421428f63b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_bindings_operations.py @@ -61,7 +61,7 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: BindingResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.BindingResource or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.BindingResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -184,7 +184,7 @@ def create_or_update( :type binding_name: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -193,9 +193,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.models.BindingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.BindingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -388,7 +388,7 @@ def update( :type binding_name: str :param properties: Properties of the Binding resource :type properties: - ~azure.mgmt.appplatform.models.BindingResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -397,9 +397,9 @@ def update( :return: An instance of LROPoller that returns BindingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.models.BindingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.BindingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -450,7 +450,7 @@ def list( overrides`. :return: An iterator like instance of BindingResource :rtype: - ~azure.mgmt.appplatform.models.BindingResourcePaged[~azure.mgmt.appplatform.models.BindingResource] + ~azure.mgmt.appplatform.v2020_07_01.models.BindingResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.BindingResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py index 51525c985e7..d1ae6a62566 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_certificates_operations.py @@ -59,8 +59,8 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: CertificateResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CertificateResource or - ~msrest.pipeline.ClientRawResponse + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -177,7 +177,8 @@ def create_or_update( :param certificate_name: The name of the certificate resource. :type certificate_name: str :param properties: Properties of the certificate resource payload. - :type properties: ~azure.mgmt.appplatform.models.CertificateProperties + :type properties: + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -186,9 +187,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.models.CertificateResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.CertificateResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -321,7 +322,7 @@ def list( overrides`. :return: An iterator like instance of CertificateResource :rtype: - ~azure.mgmt.appplatform.models.CertificateResourcePaged[~azure.mgmt.appplatform.models.CertificateResource] + ~azure.mgmt.appplatform.v2020_07_01.models.CertificateResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.CertificateResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py index 3536a2d8afd..c5c72fd3eaf 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_config_servers_operations.py @@ -57,7 +57,8 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: ConfigServerResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.ConfigServerResource or + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -170,7 +171,7 @@ def update_put( :type service_name: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -179,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.models.ConfigServerResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.ConfigServerResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource]] :raises: :class:`CloudError` """ raw_result = self._update_put_initial( @@ -277,7 +278,7 @@ def update_patch( :type service_name: str :param properties: Properties of the Config Server resource :type properties: - ~azure.mgmt.appplatform.models.ConfigServerProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -286,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.models.ConfigServerResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.ConfigServerResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.ConfigServerResource]] :raises: :class:`CloudError` """ raw_result = self._update_patch_initial( @@ -317,3 +318,111 @@ def get_long_running_output(response): 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') + + # 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.v2020_07_01.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.v2020_07_01.models.ConfigServerSettingsValidateResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.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/operations/_custom_domains_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py index 2b3c24bba50..232b3730ad7 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_custom_domains_operations.py @@ -61,7 +61,8 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: CustomDomainResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.CustomDomainResource or + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -184,7 +185,7 @@ def create_or_update( :type domain_name: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -193,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.models.CustomDomainResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.CustomDomainResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -388,7 +389,7 @@ def update( :type domain_name: str :param properties: Properties of the custom domain resource. :type properties: - ~azure.mgmt.appplatform.models.CustomDomainProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -397,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.models.CustomDomainResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.CustomDomainResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -450,7 +451,7 @@ def list( overrides`. :return: An iterator like instance of CustomDomainResource :rtype: - ~azure.mgmt.appplatform.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.models.CustomDomainResource] + ~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.CustomDomainResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py index 31d3f1f86aa..9dd25f8c12d 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_deployments_operations.py @@ -61,8 +61,8 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: DeploymentResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.DeploymentResource or - ~msrest.pipeline.ClientRawResponse + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -184,9 +184,9 @@ def create_or_update( :type deployment_name: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.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 @@ -195,9 +195,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.models.DeploymentResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.DeploymentResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -391,9 +391,9 @@ def update( :type deployment_name: str :param properties: Properties of the Deployment resource :type properties: - ~azure.mgmt.appplatform.models.DeploymentResourceProperties + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourceProperties :param sku: Sku of the Deployment resource - :type sku: ~azure.mgmt.appplatform.models.Sku + :type sku: ~azure.mgmt.appplatform.v2020_07_01.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 @@ -402,9 +402,9 @@ def update( :return: An instance of LROPoller that returns DeploymentResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.models.DeploymentResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.DeploymentResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -458,7 +458,7 @@ def list( overrides`. :return: An iterator like instance of DeploymentResource :rtype: - ~azure.mgmt.appplatform.models.DeploymentResourcePaged[~azure.mgmt.appplatform.models.DeploymentResource] + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -537,7 +537,7 @@ def list_for_cluster( overrides`. :return: An iterator like instance of DeploymentResource :rtype: - ~azure.mgmt.appplatform.models.DeploymentResourcePaged[~azure.mgmt.appplatform.models.DeploymentResource] + ~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.DeploymentResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -883,8 +883,8 @@ def get_log_file_url( :param operation_config: :ref:`Operation configuration overrides`. :return: LogFileUrlResponse or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.LogFileUrlResponse or - ~msrest.pipeline.ClientRawResponse + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.LogFileUrlResponse + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py index c10c7a87550..8758bc8463b 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_monitoring_settings_operations.py @@ -57,8 +57,9 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: MonitoringSettingResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.MonitoringSettingResource or - ~msrest.pipeline.ClientRawResponse + :rtype: + ~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource + or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -170,7 +171,7 @@ def update_put( :type service_name: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -180,9 +181,9 @@ def update_put( MonitoringSettingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.models.MonitoringSettingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.MonitoringSettingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource]] :raises: :class:`CloudError` """ raw_result = self._update_put_initial( @@ -278,7 +279,7 @@ def update_patch( :type service_name: str :param properties: Properties of the Monitoring Setting resource :type properties: - ~azure.mgmt.appplatform.models.MonitoringSettingProperties + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -288,9 +289,9 @@ def update_patch( MonitoringSettingResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.models.MonitoringSettingResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.MonitoringSettingResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.MonitoringSettingResource]] :raises: :class:`CloudError` """ raw_result = self._update_patch_initial( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py index ca9030a82e8..90798831cfa 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_operations.py @@ -51,7 +51,7 @@ def list( overrides`. :return: An iterator like instance of OperationDetail :rtype: - ~azure.mgmt.appplatform.models.OperationDetailPaged[~azure.mgmt.appplatform.models.OperationDetail] + ~azure.mgmt.appplatform.v2020_07_01.models.OperationDetailPaged[~azure.mgmt.appplatform.v2020_07_01.models.OperationDetail] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_runtime_versions_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_runtime_versions_operations.py new file mode 100644 index 00000000000..d7dfdef53fc --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/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: Client Api Version. Constant value: "2020-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-07-01" + + 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.v2020_07_01.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') + + # 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/operations/_services_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py index 21266c872d2..e9c2b47709a 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_services_operations.py @@ -57,7 +57,7 @@ def get( :param operation_config: :ref:`Operation configuration overrides`. :return: ServiceResource or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.ServiceResource or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -169,7 +169,8 @@ def create_or_update( :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.models.ServiceResource + :type resource: + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -178,9 +179,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.models.ServiceResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.ServiceResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -354,7 +355,8 @@ def update( :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.models.ServiceResource + :type resource: + ~azure.mgmt.appplatform.v2020_07_01.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 @@ -363,9 +365,9 @@ def update( :return: An instance of LROPoller that returns ServiceResource or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.models.ServiceResource] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.models.ServiceResource]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource]] :raises: :class:`CloudError` """ raw_result = self._update_initial( @@ -411,7 +413,7 @@ def list_test_keys( :param operation_config: :ref:`Operation configuration overrides`. :return: TestKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -470,14 +472,15 @@ def regenerate_test_key( :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.models.TestKeyType + :type key_type: str or + ~azure.mgmt.appplatform.v2020_07_01.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.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -601,7 +604,7 @@ def enable_test_endpoint( :param operation_config: :ref:`Operation configuration overrides`. :return: TestKeys or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.TestKeys or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.TestKeys or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -664,7 +667,7 @@ def check_name_availability( :param operation_config: :ref:`Operation configuration overrides`. :return: NameAvailability or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.appplatform.models.NameAvailability or + :rtype: ~azure.mgmt.appplatform.v2020_07_01.models.NameAvailability or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -727,7 +730,7 @@ def list_by_subscription( overrides`. :return: An iterator like instance of ServiceResource :rtype: - ~azure.mgmt.appplatform.models.ServiceResourcePaged[~azure.mgmt.appplatform.models.ServiceResource] + ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -797,7 +800,7 @@ def list( overrides`. :return: An iterator like instance of ServiceResource :rtype: - ~azure.mgmt.appplatform.models.ServiceResourcePaged[~azure.mgmt.appplatform.models.ServiceResource] + ~azure.mgmt.appplatform.v2020_07_01.models.ServiceResourcePaged[~azure.mgmt.appplatform.v2020_07_01.models.ServiceResource] :raises: :class:`CloudError` """ def prepare_request(next_link=None): diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_sku_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_sku_operations.py deleted file mode 100644 index 26330c9b065..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_sku_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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 SkuOperations(object): - """SkuOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Client Api Version. Constant value: "2019-05-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2019-05-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """ - - :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.models.ResourceSkuPaged[~azure.mgmt.appplatform.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') - - 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/operations/_skus_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.py index 4fb808cac89..5c967e6a1a2 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_skus_operations.py @@ -50,7 +50,7 @@ def list( overrides`. :return: An iterator like instance of ResourceSku :rtype: - ~azure.mgmt.appplatform.models.ResourceSkuPaged[~azure.mgmt.appplatform.models.ResourceSku] + ~azure.mgmt.appplatform.v2020_07_01.models.ResourceSkuPaged[~azure.mgmt.appplatform.v2020_07_01.models.ResourceSku] :raises: :class:`CloudError` """ def prepare_request(next_link=None): 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 e0ec669828c..e001913245a 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 = "0.1.0" +VERSION = "2020-07-01" From cf8411f33e29adf512da183dde354aed27772699 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Fri, 25 Sep 2020 13:23:17 +0800 Subject: [PATCH 24/37] add log for long wait operation --- src/spring-cloud/azext_spring_cloud/custom.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 7a3a8c17999..33a47570963 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -727,7 +727,9 @@ def standardization(dic): config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + logger.warning("[1/2] Validating config server settings") validate_config_server_settings(client, resource_group, name, git_property) + logger.warning("[2/2] Updating config server settings, (this operation can take a while to complete)") return sdk_no_wait(no_wait, client.update_put, resource_group, name, config_server_properties) @@ -770,7 +772,9 @@ def config_git_set(cmd, client, resource_group, name, uri, config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + logger.warning("[1/2] Validating config server settings") validate_config_server_settings(client, resource_group, name, git_property) + logger.warning("[2/2] Updating config server settings, (this operation can take a while to complete)") return cached_put(cmd, client.update_put, config_server_properties, resource_group, name).result() def config_repo_add(cmd, client, resource_group, name, uri, repo_name, @@ -818,7 +822,9 @@ def config_repo_add(cmd, client, resource_group, name, uri, repo_name, config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) + logger.warning("[1/2] Validating config server settings") validate_config_server_settings(client, resource_group, name, git_property) + logger.warning("[2/2] Adding config server settings repo, (this operation can take a while to complete)") return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() @@ -839,7 +845,9 @@ def config_repo_delete(cmd, client, resource_group, name, repo_name): config_server_properties = models.ConfigServerProperties( config_server=config_server_settings) + logger.warning("[1/2] Validating config server settings") validate_config_server_settings(client, resource_group, name, git_property) + logger.warning("[2/2] Deleting config server settings repo, (this operation can take a while to complete)") return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() @@ -888,7 +896,9 @@ def config_repo_update(cmd, client, resource_group, name, repo_name, config_server_settings = models.ConfigServerSettings(git_property=git_property) config_server_properties = models.ConfigServerProperties(config_server=config_server_settings) + logger.warning("[1/2] Validating config server settings") validate_config_server_settings(client, resource_group, name, git_property) + logger.warning("[2/2] Updating config server settings repo, (this operation can take a while to complete)") return cached_put(cmd, client.update_patch, config_server_properties, resource_group, name).result() From e1f1e463f028092f0d44ef16bd23a1c161977337 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Sun, 27 Sep 2020 14:11:58 +0800 Subject: [PATCH 25/37] refine wording --- src/spring-cloud/azext_spring_cloud/custom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 33a47570963..6a5faea2248 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -680,11 +680,11 @@ def validate_config_server_settings(client, resource_group, name, git_property): if not result.is_valid: for item in result.details: if not item.name: - logger.error("Default Repository with uri \"%s\" meet error:", item.uri) + logger.error("Default repository with URI \"%s\" meets error:", item.uri) else: - logger.error("Pattern Repository with name \"%s\", uri \"%s\" meet error:", item.name, item.uri) + logger.error("Repository named \"%s\" with URI \"%s\" meets error:", item.name, item.uri) logger.error("\n".join(item.messages)) - raise CLIError("Config server settings validate with error.") + raise CLIError("Config Server settings contain error.") def config_set(cmd, client, resource_group, name, config_file, no_wait=False): def standardization(dic): From d724a2dbc6845a18da4299e8e728077147bc5cd1 Mon Sep 17 00:00:00 2001 From: Ningting Pan Date: Fri, 9 Oct 2020 09:59:48 +0800 Subject: [PATCH 26/37] precheck uri & modify error messages --- src/spring-cloud/azext_spring_cloud/custom.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 6a5faea2248..dda7d05ed0b 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -675,8 +675,24 @@ def deployment_delete(cmd, client, resource_group, service, app, name): client.deployments.get(resource_group, service, app, name) return client.deployments.delete(resource_group, service, app, name) +def is_valid_Git_URI(uri): + return (uri.startswith("https://") or uri.startswith("git@")) + def validate_config_server_settings(client, resource_group, name, git_property): - result = sdk_no_wait(False, client.validate, resource_group, name, git_property).result() + error_msg = "Git URI should start with \"https://\" or \"git@\"" + if git_property: + if (not is_valid_Git_URI(git_property.uri)): + raise CLIError(error_msg) + if git_property.repositories: + for repository in git_property.repositories: + if (not is_valid_Git_URI(repository.uri)): + raise CLIError(error_msg) + + try: + result = sdk_no_wait(False, client.validate, resource_group, name, git_property).result() + except Exception as err: # pylint: disable=broad-except + raise CLIError("{0}. You may raise a support ticket if needed by the following link: https://docs.microsoft.com/azure/spring-cloud/spring-cloud-faq?pivots=programming-language-java#how-can-i-provide-feedback-and-report-issues".format(err)) + if not result.is_valid: for item in result.details: if not item.name: From 53fa1227df77fec72efbe3f8dcedfe64d7a2cfc5 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Thu, 15 Oct 2020 16:41:33 +0800 Subject: [PATCH 27/37] fix style error --- src/spring-cloud/azext_spring_cloud/custom.py | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index e563d9bc1bf..9c438821e04 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -198,11 +198,10 @@ def app_create(cmd, client, resource_group, service, name, size_in_gb=5, mount_path="/tmp") resource = client.services.get(resource_group, service) - location = resource.location app_resource = models.AppResource() app_resource.properties = properties - app_resource.location = location + app_resource.location = resource.location if assign_identity is True: app_resource.identity = models.ManagedIdentityProperties(type="systemassigned") @@ -226,13 +225,13 @@ def app_create(cmd, client, resource_group, service, name, properties = models.DeploymentResourceProperties( deployment_settings=deployment_settings, source=user_source_info) - sku = models.Sku(name="S0", tier="STANDARD", capacity=instance_count) # create default deployment logger.warning( "[2/4] Creating default deployment with name '{}'".format(DEFAULT_DEPLOYMENT_NAME)) - poller = client.deployments.create_or_update( - resource_group, service, name, DEFAULT_DEPLOYMENT_NAME, properties=properties, sku=sku) + 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)) logger.warning("[3/4] Setting default deployment to production") properties = models.AppResourceProperties( @@ -246,7 +245,7 @@ def app_create(cmd, client, resource_group, service, name, size_in_gb=0, mount_path="/persistent") app_resource.properties = properties - app_resource.location = location + app_resource.location = resource.location app_poller = client.apps.update(resource_group, service, name, app_resource) logger.warning( @@ -686,17 +685,19 @@ def deployment_delete(cmd, client, resource_group, service, app, name): client.deployments.get(resource_group, service, app, name) return client.deployments.delete(resource_group, service, app, name) -def is_valid_Git_URI(uri): - return (uri.startswith("https://") or uri.startswith("git@")) + +def is_valid_git_uri(uri): + return uri.startswith("https://") or uri.startswith("git@") + def validate_config_server_settings(client, resource_group, name, git_property): error_msg = "Git URI should start with \"https://\" or \"git@\"" if git_property: - if (not is_valid_Git_URI(git_property.uri)): + if not is_valid_git_uri(git_property.uri): raise CLIError(error_msg) if git_property.repositories: for repository in git_property.repositories: - if (not is_valid_Git_URI(repository.uri)): + if not is_valid_git_uri(repository.uri): raise CLIError(error_msg) try: @@ -713,6 +714,7 @@ def validate_config_server_settings(client, resource_group, name, git_property): logger.error("\n".join(item.messages)) raise CLIError("Config Server settings contain error.") + def config_set(cmd, client, resource_group, name, config_file, no_wait=False): def standardization(dic): new_dic = {} @@ -804,6 +806,7 @@ def config_git_set(cmd, client, resource_group, name, uri, logger.warning("[2/2] Updating config server settings, (this operation can take a while to complete)") return cached_put(cmd, client.update_put, config_server_properties, resource_group, name).result() + def config_repo_add(cmd, client, resource_group, name, uri, repo_name, pattern=None, label=None, From 68f55aeeb28d62b148415904288a1f2deea22b17 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Mon, 16 Nov 2020 13:05:43 +0800 Subject: [PATCH 28/37] update validation and parameter description for smaller subnet feature --- src/spring-cloud/azext_spring_cloud/_params.py | 7 ++++++- src/spring-cloud/azext_spring_cloud/_validators.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 7ce57826030..ac01296fbe9 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -36,7 +36,12 @@ def load_arguments(self, _): c.argument('sku', type=str, validator=validate_sku, help='Name of SKU, the value is "Basic" or "Standard"') c.argument('reserved_cidr_range', help='Comma-separated list of IP address ranges in CIDR format. The IP ranges are reserved to host underlying Azure Spring Cloud infrastructure, which should be 3 at least /16 unused IP ranges, must not overlap with any Subnet IP ranges.', validator=validate_vnet_required_parameters) c.argument('vnet', help='The name or ID of an existing Virtual Network into which to deploy the Spring Cloud instance.', validator=validate_vnet_required_parameters) - c.argument('app_subnet', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network.', validator=validate_vnet_required_parameters) + c.argument('app_subnet', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network. Smaller subnet sizes are supported. ' + 'A subnet of size /28 can hold 24 app instances of 4 vCPU, or 32 app instances of 3 vCPU, or 48 app instances of 2 vCPU, or 96 app instances of 1 vCPU. ' + 'A subnet of size /27 can hold 72 app instances of 4 vCPU, or 96 app instances of 3 vCPU, or 144 app instances of 2 vCPU, or 288 app instances of 1 vCPU. ' + 'A subnet of size /26 can hold 168 app instances of 4 vCPU, or 224 app instances of 3 vCPU, or 336 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ' + 'A subnet of size /25 can hold 360 app instances of 4 vCPU, or 480 app instances of 3 vCPU, or 500 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ' + 'A subnet of size /24 can hold 500 app instances of 4 vCPU, or 500 app instances of 3 vCPU, or 500 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ', validator=validate_vnet_required_parameters) c.argument('service_runtime_subnet', options_list=['--service-runtime-subnet', '--svc-subnet'], help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud service runtime. Required when deploying into a Virtual Network.', validator=validate_vnet) c.argument('service_runtime_network_resource_group', options_list=['--service-runtime-network-resource-group', '--svc-nrg'], help='The resource group where all network resources for Azure Spring Cloud service runtime will be created in.', validator=validate_node_resource_group) c.argument('app_network_resource_group', options_list=['--app-network-resource-group', '--app-nrg'], help='The resource group where all network resources for apps will be created in.', validator=validate_node_resource_group) diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index 98dfd8fef56..1bf1e4f6b0b 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -214,7 +214,7 @@ def _validate_subnet(namespace, subnet): limit = 32 if subnet.id.lower() == namespace.app_subnet.lower(): name = 'app-subnet' - limit = 24 + limit = 28 elif subnet.id.lower() == namespace.service_runtime_subnet.lower(): name = 'service-runtime-subnet' limit = 28 From 984f2bed6784cf88b34f02d4234ea2c16c693586 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Mon, 16 Nov 2020 13:32:16 +0800 Subject: [PATCH 29/37] update parameter description --- src/spring-cloud/azext_spring_cloud/_params.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index ac01296fbe9..ccc4164e8ac 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -36,12 +36,7 @@ def load_arguments(self, _): c.argument('sku', type=str, validator=validate_sku, help='Name of SKU, the value is "Basic" or "Standard"') c.argument('reserved_cidr_range', help='Comma-separated list of IP address ranges in CIDR format. The IP ranges are reserved to host underlying Azure Spring Cloud infrastructure, which should be 3 at least /16 unused IP ranges, must not overlap with any Subnet IP ranges.', validator=validate_vnet_required_parameters) c.argument('vnet', help='The name or ID of an existing Virtual Network into which to deploy the Spring Cloud instance.', validator=validate_vnet_required_parameters) - c.argument('app_subnet', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network. Smaller subnet sizes are supported. ' - 'A subnet of size /28 can hold 24 app instances of 4 vCPU, or 32 app instances of 3 vCPU, or 48 app instances of 2 vCPU, or 96 app instances of 1 vCPU. ' - 'A subnet of size /27 can hold 72 app instances of 4 vCPU, or 96 app instances of 3 vCPU, or 144 app instances of 2 vCPU, or 288 app instances of 1 vCPU. ' - 'A subnet of size /26 can hold 168 app instances of 4 vCPU, or 224 app instances of 3 vCPU, or 336 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ' - 'A subnet of size /25 can hold 360 app instances of 4 vCPU, or 480 app instances of 3 vCPU, or 500 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ' - 'A subnet of size /24 can hold 500 app instances of 4 vCPU, or 500 app instances of 3 vCPU, or 500 app instances of 2 vCPU, or 500 app instances of 1 vCPU. ', validator=validate_vnet_required_parameters) + c.argument('app_subnet', help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud app. Required when deploying into a Virtual Network. Smaller subnet sizes are supported, please refer: https://aka.ms/azure-spring-cloud-smaller-subnet-vnet-docs', validator=validate_vnet_required_parameters) c.argument('service_runtime_subnet', options_list=['--service-runtime-subnet', '--svc-subnet'], help='The name or ID of an existing subnet in "vnet" into which to deploy the Spring Cloud service runtime. Required when deploying into a Virtual Network.', validator=validate_vnet) c.argument('service_runtime_network_resource_group', options_list=['--service-runtime-network-resource-group', '--svc-nrg'], help='The resource group where all network resources for Azure Spring Cloud service runtime will be created in.', validator=validate_node_resource_group) c.argument('app_network_resource_group', options_list=['--app-network-resource-group', '--app-nrg'], help='The resource group where all network resources for apps will be created in.', validator=validate_node_resource_group) From 7f1618b556e91f9df69f9a4f457122f350c0f741 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Wed, 18 Nov 2020 16:19:07 +0800 Subject: [PATCH 30/37] refine the instance count parameter validation logic --- .../azext_spring_cloud/_params.py | 9 ++++---- .../azext_spring_cloud/_validators.py | 6 +++++ src/spring-cloud/azext_spring_cloud/custom.py | 22 +++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index ccc4164e8ac..8a21fd6f296 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -10,7 +10,8 @@ from ._validators import (validate_env, validate_cosmos_type, validate_resource_id, validate_location, validate_name, validate_app_name, validate_deployment_name, validate_log_lines, validate_log_limit, validate_log_since, validate_sku, validate_jvm_options, - validate_vnet, validate_vnet_required_parameters, validate_node_resource_group, validate_tracing_parameters) + validate_vnet, validate_vnet_required_parameters, validate_node_resource_group, + validate_tracing_parameters, validate_instance_count) from ._utils import ApiType from .vendored_sdks.appplatform.models import RuntimeVersion, TestKeyType @@ -76,7 +77,7 @@ def load_arguments(self, _): c.argument('memory', type=int, default=1, help='Number of GB of memory per instance.') c.argument('instance_count', type=int, - default=1, help='Number of instance.') + default=1, help='Number of instance.', validator=validate_instance_count) with self.argument_context('spring-cloud app update') as c: c.argument('is_public', arg_type=get_three_state_flag(), help='If true, assign endpoint') @@ -127,7 +128,7 @@ def load_arguments(self, _): 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('instance_count', type=int, help='Number of instance.') + 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']: with self.argument_context(scope) as c: @@ -147,7 +148,7 @@ def load_arguments(self, _): 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('instance_count', type=int, help='Number of instance.') + c.argument('instance_count', type=int, help='Number of instance.', validator=validate_instance_count) with self.argument_context('spring-cloud app deployment') as c: c.argument('app', app_name_type, help='Name of app.', diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index 1bf1e4f6b0b..a31858764c5 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -43,6 +43,12 @@ def validate_sku(namespace): raise CLIError("The pricing tier only accepts value [Basic, Standard]") +def validate_instance_count(namespace): + if namespace.instance_count is not None: + if namespace.instance_count < 1: + raise CLIError("--instance-count must be more than 0") + + def validate_name(namespace): namespace.name = namespace.name.lower() matchObj = match(r'^[a-z][a-z0-9-]{2,30}[a-z0-9]$', namespace.name) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 12868285c08..36f7d74e7b7 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -200,6 +200,8 @@ def app_create(cmd, client, resource_group, service, name, resource = client.services.get(resource_group, service) + _validate_instance_count(resource.sku.tier, instance_count) + app_resource = models.AppResource() app_resource.properties = properties app_resource.location = resource.location @@ -457,6 +459,10 @@ def app_scale(cmd, client, resource_group, service, name, resource_group, service, name).properties.active_deployment_name if deployment is None: raise CLIError(NO_PRODUCTION_DEPLOYMENT_ERROR) + + 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) @@ -638,6 +644,9 @@ def deployment_create(cmd, client, resource_group, service, app, name, if name in deployments: raise CLIError("Deployment " + name + " already exists") + resource = client.services.get(resource_group, service) + _validate_instance_count(resource.sku.tier, instance_count) + if not skip_clone_settings: active_deployment_name = client.apps.get( resource_group, service, app).properties.active_deployment_name @@ -671,6 +680,19 @@ def deployment_create(cmd, client, resource_group, service, app, name, file_type) +def _validate_instance_count(sku, instance_count=None): + if instance_count is not None: + sku = sku.upper() + if sku == "STANDARD": + if instance_count > 500: + raise CLIError( + "Standard SKU can have at most 500 app instances in total, but got '{}'".format(instance_count)) + if sku == "BASIC": + if instance_count > 25: + raise CLIError( + "Basic SKU can have at most 25 app instances in total, but got '{}'".format(instance_count)) + + def deployment_list(cmd, client, resource_group, service, app): return client.deployments.list(resource_group, service, app) From 7db3847615a43b7fecd38d100dc71d18af8e50fc Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Fri, 20 Nov 2020 17:39:16 +0800 Subject: [PATCH 31/37] edit error message when creating vnet instance with a route table existed subnet --- src/spring-cloud/azext_spring_cloud/_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index 1bf1e4f6b0b..35582fdb94c 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -221,7 +221,7 @@ def _validate_subnet(namespace, subnet): else: return if subnet.route_table: - raise CLIError('--{} should not associate with any route table.'.format(name)) + raise CLIError('--{} with existing route table is not supported. Please remove route table from the subnet, or select another subnet.'.format(name)) if subnet.ip_configurations: raise CLIError('--{} should not have connected device.'.format(name)) address = ip_network(subnet.address_prefix, strict=False) From 0c9f109f1461a58336c39e2152ff3c371474ed83 Mon Sep 17 00:00:00 2001 From: shiqiu Date: Mon, 23 Nov 2020 09:56:11 +0800 Subject: [PATCH 32/37] fix style error --- src/spring-cloud/azext_spring_cloud/_validators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index 5f38b2473ae..aecd6d7d6c4 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -227,7 +227,8 @@ def _validate_subnet(namespace, subnet): else: return if subnet.route_table: - raise CLIError('--{} with existing route table is not supported. Please remove route table from the subnet, or select another subnet.'.format(name)) + raise CLIError('--{} with existing route table is not supported. Please remove route table from the subnet,' + ' or select another subnet.'.format(name)) if subnet.ip_configurations: raise CLIError('--{} should not have connected device.'.format(name)) address = ip_network(subnet.address_prefix, strict=False) From 82145f18e808bb159055b261ebc87655dee83a62 Mon Sep 17 00:00:00 2001 From: Yuwei Zhou Date: Mon, 23 Nov 2020 19:04:19 +0800 Subject: [PATCH 33/37] Update custom.py --- src/spring-cloud/azext_spring_cloud/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 9c438821e04..b1c4d3aba64 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -706,7 +706,7 @@ def validate_config_server_settings(client, resource_group, name, git_property): raise CLIError("{0}. You may raise a support ticket if needed by the following link: https://docs.microsoft.com/azure/spring-cloud/spring-cloud-faq?pivots=programming-language-java#how-can-i-provide-feedback-and-report-issues".format(err)) if not result.is_valid: - for item in result.details: + for item in result.details or []: if not item.name: logger.error("Default repository with URI \"%s\" meets error:", item.uri) else: From b5f688de0ab1231a974e8362d3b704a3a2d2c238 Mon Sep 17 00:00:00 2001 From: Shichao Qiu Date: Wed, 2 Dec 2020 13:15:46 +0800 Subject: [PATCH 34/37] fix integration test error --- .../recordings/test_bind_cert_to_domain.yaml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml index 836cff0af32..c783b29681d 100644 --- a/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml +++ b/src/spring-cloud/azext_spring_cloud/tests/latest/recordings/test_bind_cert_to_domain.yaml @@ -23,7 +23,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' @@ -76,7 +76,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' @@ -125,7 +125,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates?api-version=2020-07-01 response: body: string: '{"value":[{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}]}' @@ -180,7 +180,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' @@ -233,7 +233,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' @@ -284,7 +284,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains?api-version=2020-07-01 response: body: string: '{"value":[{"properties":{"appName":"test-app"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}]}' @@ -335,7 +335,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' @@ -391,7 +391,7 @@ interactions: accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' @@ -444,7 +444,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","appName":"test-app","certName":"test-cert"},"type":"Microsoft.AppPlatform/Spring/apps/domains","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net","name":"cli.asc-test.net"}' @@ -497,7 +497,7 @@ interactions: accept-language: - en-US method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '' @@ -544,7 +544,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/apps/test-app/domains/cli.asc-test.net?api-version=2020-07-01 response: body: string: '{"error":{"code":"EntityNotFound","message":"CustomDomain with name @@ -594,7 +594,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '{"properties":{"thumbprint":"839dbe007ebc9aeb7150d58b1474dd955e684f18","vaultUri":"https://integration-test-prod.vault.azure.net/","keyVaultCertName":"cli-unittest","certVersion":"210525ac4b3d4a0d8431ab7e64cd11f8","issuer":"*.asc-test.net","expirationDate":"2021-05-08T04:54:02.000+0000","activateDate":"2020-05-08T04:44:02.000+0000","subjectName":"CN=*.asc-test.net","dnsNames":["cli.asc-test.net"]},"type":"Microsoft.AppPlatform/Spring/certificates","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert","name":"test-cert"}' @@ -647,7 +647,7 @@ interactions: accept-language: - en-US method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '' @@ -694,7 +694,7 @@ interactions: accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2019-05-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli/providers/Microsoft.AppPlatform/Spring/cli-unittest/certificates/test-cert?api-version=2020-07-01 response: body: string: '{"error":{"code":"EntityNotFound","message":"CertificateName ''test-cert'' From 10498c2c91600184453e14a91b0305f5529fbca5 Mon Sep 17 00:00:00 2001 From: Shichao Qiu Date: Fri, 4 Dec 2020 11:14:33 +0800 Subject: [PATCH 35/37] fix comments --- src/spring-cloud/azext_spring_cloud/_validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index aecd6d7d6c4..2131bf62543 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -46,7 +46,7 @@ def validate_sku(namespace): def validate_instance_count(namespace): if namespace.instance_count is not None: if namespace.instance_count < 1: - raise CLIError("--instance-count must be more than 0") + raise CLIError("--instance-count must be greater than 0") def validate_name(namespace): From e0ff35f9f5704256c98b7b84b9367230c2d882fa Mon Sep 17 00:00:00 2001 From: Shichao Qiu Date: Mon, 7 Dec 2020 15:07:01 +0800 Subject: [PATCH 36/37] refine tracing logic --- src/spring-cloud/azext_spring_cloud/custom.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 5889cbf0478..5f935e82d7b 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -98,11 +98,11 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None trace_enabled = trace_properties.trace_enabled if trace_properties is not None else False app_insights_target_status = False - if app_insights is not None or app_insights_key is not None or disable_distributed_tracing is False: + if app_insights or app_insights_key or disable_distributed_tracing is False: app_insights_target_status = True if trace_enabled is False: update_app_insights = True - elif app_insights is not None or (app_insights_key is not None and app_insights_key != trace_properties.app_insights_instrumentation_key): + elif app_insights or (app_insights_key and app_insights_key != trace_properties.app_insights_instrumentation_key): update_app_insights = True elif disable_distributed_tracing is True: app_insights_target_status = False @@ -113,8 +113,7 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None if update_app_insights is True: if app_insights_target_status is False: trace_properties.trace_enabled = app_insights_target_status - elif trace_properties.app_insights_instrumentation_key is not None \ - and app_insights is None and app_insights_key is None: + elif trace_properties.app_insights_instrumentation_key and not app_insights and not app_insights_key: trace_properties.trace_enabled = app_insights_target_status else: trace_properties = update_tracing_config(cmd, resource_group, name, location, @@ -1356,10 +1355,10 @@ def update_tracing_config(cmd, resource_group, service_name, location, app_insig app_insights, disable_distributed_tracing): create_app_insights = False trace_properties = None - if app_insights_key is not None: + if app_insights_key: trace_properties = models.MonitoringSettingProperties( trace_enabled=True, app_insights_instrumentation_key=app_insights_key) - elif app_insights is not None: + elif app_insights: if is_valid_resource_id(app_insights): resource_id_dict = parse_resource_id(app_insights) instrumentation_key = get_app_insights_key(cmd.cli_ctx, resource_id_dict['resource_group'], @@ -1376,7 +1375,7 @@ def update_tracing_config(cmd, resource_group, service_name, location, app_insig if create_app_insights is True: try: instrumentation_key = try_create_application_insights(cmd, resource_group, service_name, location) - if instrumentation_key is not None: + if instrumentation_key: trace_properties = models.MonitoringSettingProperties() trace_properties.trace_enabled = True trace_properties.app_insights_instrumentation_key = instrumentation_key From 1d10bcc2f652f2ded895100b2dd81f42e99aae38 Mon Sep 17 00:00:00 2001 From: Shichao Qiu Date: Mon, 7 Dec 2020 16:17:37 +0800 Subject: [PATCH 37/37] refine the tracing logic --- src/spring-cloud/azext_spring_cloud/custom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 5f935e82d7b..95800358ab9 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -118,8 +118,9 @@ def spring_cloud_update(cmd, client, resource_group, name, app_insights_key=None else: trace_properties = update_tracing_config(cmd, resource_group, name, location, app_insights_key, app_insights, disable_distributed_tracing) - sdk_no_wait(no_wait, client.monitoring_settings.update_put, - resource_group_name=resource_group, service_name=name, properties=trace_properties) + if trace_properties is not None: + sdk_no_wait(no_wait, client.monitoring_settings.update_put, + resource_group_name=resource_group, service_name=name, properties=trace_properties) # update service tags if tags is not None: @@ -1383,6 +1384,7 @@ def update_tracing_config(cmd, resource_group, service_name, location, app_insig logger.warning( 'Error while trying to create and configure an Application Insights for the Azure Spring Cloud. ' 'Please use the Azure Portal to create and configure the Application Insights, if needed.') + return None return trace_properties