diff --git a/src/spring-cloud/HISTORY.md b/src/spring-cloud/HISTORY.md index 109b0ec9172..5068d8f2865 100644 --- a/src/spring-cloud/HISTORY.md +++ b/src/spring-cloud/HISTORY.md @@ -1,6 +1,10 @@ Release History =============== +0.2.5 +----- +* enable to specified sku when create or update service instance + 0.2.4 ----- * Add command "az spring-cloud app identity" to support Managed Identity feature diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 3b721fbcae3..f262a062ed8 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -19,6 +19,14 @@ text: az spring-cloud create -n MyService -g MyResourceGroup -l westus """ +helps['spring-cloud update'] = """ + type: command + short-summary: Update pricing tier of an Azure Spring Cloud. + examples: + - name: Update pricing tier. + text: az spring-cloud update -n MyService --sku Standard -g MyResourceGroup +""" + helps['spring-cloud delete'] = """ type: command short-summary: Delete an Azure Spring Cloud. diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index c72e0edab85..e9af4bd9aa1 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -8,8 +8,8 @@ from azure.cli.core.commands.parameters import get_enum_type, get_three_state_flag 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_nodes_count, - validate_log_lines, validate_log_limit, validate_log_since) + validate_name, validate_app_name, validate_deployment_name, validate_log_lines, + validate_log_limit, validate_log_since, validate_sku) from ._utils import ApiType from .vendored_sdks.appplatform.models import RuntimeVersion, TestKeyType @@ -31,8 +31,11 @@ def load_arguments(self, _): '--name', '-n'], help='Name of Azure Spring Cloud.') with self.argument_context('spring-cloud create') as c: - c.argument('location', arg_type=get_location_type( - self.cli_ctx), validator=validate_location) + c.argument('location', arg_type=get_location_type(self.cli_ctx), validator=validate_location) + c.argument('sku', type=str, validator=validate_sku, help='Name of SKU, the value is "Basic" or "Standard"') + + with self.argument_context('spring-cloud update') as c: + c.argument('sku', type=str, validator=validate_sku, help='Name of SKU, the value is "Basic" or "Standard"') with self.argument_context('spring-cloud test-endpoint renew-key') as c: c.argument('type', type=str, arg_type=get_enum_type( @@ -103,12 +106,9 @@ def load_arguments(self, _): for scope in ['spring-cloud app deploy', 'spring-cloud app scale']: with self.argument_context(scope) as c: - c.argument('cpu', type=int, - help='Number of virtual cpu cores per instance.', validator=validate_nodes_count) - c.argument('memory', type=int, - help='Number of GB of memory per instance.', validator=validate_nodes_count) - c.argument('instance_count', type=int, - help='Number of instance.', validator=validate_nodes_count) + 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.') for scope in ['spring-cloud app deploy', 'spring-cloud app deployment create']: with self.argument_context(scope) as c: diff --git a/src/spring-cloud/azext_spring_cloud/_utils.py b/src/spring-cloud/azext_spring_cloud/_utils.py index 401bf775792..f59e09aefce 100644 --- a/src/spring-cloud/azext_spring_cloud/_utils.py +++ b/src/spring-cloud/azext_spring_cloud/_utils.py @@ -193,3 +193,12 @@ def _get_rg_location(ctx, resource_group_name, subscription_id=None): # Just do the get, we don't need the result, it will error out if the group doesn't exist. rg = groups.get(resource_group_name) return rg.location + + +def _get_sku_name(tier): # pylint: disable=too-many-return-statements + tier = tier.upper() + if tier == 'BASIC': + return 'B0' + if tier == 'STANDARD': + return 'S0' + raise CLIError("Invalid sku(pricing tier), please refer to command help for valid values") diff --git a/src/spring-cloud/azext_spring_cloud/_validators.py b/src/spring-cloud/azext_spring_cloud/_validators.py index e2650d5432a..28d660fa836 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators.py +++ b/src/spring-cloud/azext_spring_cloud/_validators.py @@ -31,6 +31,12 @@ def validate_location(namespace): for piece in location_slice]) +def validate_sku(namespace): + namespace.sku = namespace.sku.upper() + if namespace.sku not in ['BASIC', 'STANDARD']: + raise CLIError("The pricing tier only accept value [Basic, Standard]") + + def validate_name(namespace): namespace.name = namespace.name.lower() matchObj = match(r'^[a-z][a-z0-9-]{2,30}[a-z0-9]$', namespace.name) @@ -86,19 +92,6 @@ def validate_cosmos_type(namespace): "Cosmosdb with type {} should specify collection name".format(type)) -def validate_nodes_count(namespace): - """Validate that cpu, memory and instance-count is set in a range""" - if namespace.cpu is not None: - if namespace.cpu < 1 or namespace.cpu > 4: - raise CLIError('--cpu must be in the range [1,4]') - if namespace.memory is not None: - if namespace.memory < 1 or namespace.memory > 8: - raise CLIError('--memory must be in the range [1,8]') - if namespace.instance_count is not None: - if namespace.instance_count < 1 or namespace.instance_count > 20: - raise CLIError('--instance-count must be in the range [1,20]') - - def validate_log_limit(namespace): temp_limit = None try: diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index 4a8491c36a7..42f893de0de 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -15,14 +15,11 @@ # 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('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) + 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') diff --git a/src/spring-cloud/azext_spring_cloud/custom.py b/src/spring-cloud/azext_spring_cloud/custom.py index 1978e3b29ee..cc49aacf25d 100644 --- a/src/spring-cloud/azext_spring_cloud/custom.py +++ b/src/spring-cloud/azext_spring_cloud/custom.py @@ -20,6 +20,7 @@ from ast import literal_eval from azure.cli.core.commands import cached_put from ._utils import _get_rg_location +from ._utils import _get_sku_name from six.moves.urllib import parse from threading import Thread from threading import Timer @@ -38,19 +39,34 @@ LOG_RUNNING_PROMPT = "This command usually takes minutes to run. Add '--verbose' parameter if needed." -def spring_cloud_create(cmd, client, resource_group, name, location=None, no_wait=False): +def spring_cloud_create(cmd, client, resource_group, name, location=None, sku=None, no_wait=False): rg_location = _get_rg_location(cmd.cli_ctx, resource_group) if location is None: location = rg_location - resource = models.ServiceResource(location=location) - return sdk_no_wait(no_wait, client.create_or_update, - resource_group_name=resource_group, service_name=name, resource=resource) + if sku is None: + sku = "Standard" + full_sku = models.Sku( + name=_get_sku_name(sku), + tier=sku + ) + resource = models.ServiceResource(location=location, sku=full_sku) + + return sdk_no_wait(no_wait, client.create_or_update, resource_group_name=resource_group, service_name=name, resource=resource) + + +def spring_cloud_update(cmd, client, resource_group, name, sku=None, no_wait=False): + full_sku = models.Sku( + name=_get_sku_name(sku), + tier=sku + ) + resource = models.ServiceResource(sku=full_sku) + + return sdk_no_wait(no_wait, client.update, resource_group_name=resource_group, service_name=name, resource=resource) def spring_cloud_delete(cmd, client, resource_group, name, no_wait=False): - return sdk_no_wait(no_wait, client.delete, - resource_group_name=resource_group, service_name=name) + return sdk_no_wait(no_wait, client.delete, resource_group_name=resource_group, service_name=name) def spring_cloud_list(cmd, client, resource_group=None): 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 6081e8e91e6..4b2272208ce 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 @@ -20,6 +20,7 @@ from .operations import CustomDomainsOperations from .operations import DeploymentsOperations from .operations import Operations +from .operations import SkuOperations from . import models @@ -43,6 +44,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 :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -79,3 +82,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._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 f3745719d31..d48ec1b4c2b 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 @@ -44,9 +44,17 @@ from ._models_py3 import ProxyResource from ._models_py3 import RegenerateTestKeyRequestPayload from ._models_py3 import Resource + from ._models_py3 import ResourceSku + from ._models_py3 import ResourceSkuCapabilities + from ._models_py3 import ResourceSkuLocationInfo + from ._models_py3 import ResourceSkuRestrictionInfo + from ._models_py3 import ResourceSkuRestrictions + from ._models_py3 import ResourceSkuZoneDetails from ._models_py3 import ResourceUploadDefinition from ._models_py3 import ServiceResource from ._models_py3 import ServiceSpecification + from ._models_py3 import Sku + from ._models_py3 import SkuCapacity from ._models_py3 import TemporaryDisk from ._models_py3 import TestKeys from ._models_py3 import TraceProperties @@ -87,9 +95,17 @@ from ._models import ProxyResource from ._models import RegenerateTestKeyRequestPayload from ._models import Resource + from ._models import ResourceSku + from ._models import ResourceSkuCapabilities + from ._models import ResourceSkuLocationInfo + from ._models import ResourceSkuRestrictionInfo + from ._models import ResourceSkuRestrictions + from ._models import ResourceSkuZoneDetails from ._models import ResourceUploadDefinition from ._models import ServiceResource from ._models import ServiceSpecification + from ._models import Sku + from ._models import SkuCapacity from ._models import TemporaryDisk from ._models import TestKeys from ._models import TraceProperties @@ -101,6 +117,7 @@ from ._paged_models import CustomDomainResourcePaged from ._paged_models import DeploymentResourcePaged from ._paged_models import OperationDetailPaged +from ._paged_models import ResourceSkuPaged from ._paged_models import ServiceResourcePaged from ._app_platform_management_client_enums import ( ProvisioningState, @@ -113,6 +130,9 @@ RuntimeVersion, DeploymentResourceProvisioningState, DeploymentResourceStatus, + SkuScaleType, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionsReasonCode, ) __all__ = [ @@ -150,9 +170,17 @@ 'ProxyResource', 'RegenerateTestKeyRequestPayload', 'Resource', + 'ResourceSku', + 'ResourceSkuCapabilities', + 'ResourceSkuLocationInfo', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSkuZoneDetails', 'ResourceUploadDefinition', 'ServiceResource', 'ServiceSpecification', + 'Sku', + 'SkuCapacity', 'TemporaryDisk', 'TestKeys', 'TraceProperties', @@ -165,6 +193,7 @@ 'CustomDomainResourcePaged', 'DeploymentResourcePaged', 'OperationDetailPaged', + 'ResourceSkuPaged', 'ProvisioningState', 'ConfigServerState', 'TraceProxyState', @@ -175,4 +204,7 @@ 'RuntimeVersion', 'DeploymentResourceProvisioningState', 'DeploymentResourceStatus', + 'SkuScaleType', + 'ResourceSkuRestrictionsType', + 'ResourceSkuRestrictionsReasonCode', ] 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 c4b4fd4c440..43b052634d0 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 @@ -93,3 +93,22 @@ class DeploymentResourceStatus(str, Enum): allocating = "Allocating" upgrading = "Upgrading" compiling = "Compiling" + + +class SkuScaleType(str, Enum): + + none = "None" + manual = "Manual" + automatic = "Automatic" + + +class ResourceSkuRestrictionsType(str, Enum): + + location = "Location" + zone = "Zone" + + +class ResourceSkuRestrictionsReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" 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 b967013d0c6..b35beb03ae1 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 @@ -271,33 +271,43 @@ def __init__(self, **kwargs): class CertificateProperties(Model): """Certificate resource payload. + Variables are only populated by the server, and will be ignored when + sending a request. + All required parameters must be populated in order to send to Azure. - :param thumbprint: The thumbprint of certificate. - :type thumbprint: str + :ivar thumbprint: The thumbprint of certificate. + :vartype thumbprint: str :param vault_uri: Required. The vault uri of user key vault. :type vault_uri: str :param key_vault_cert_name: Required. The certificate name of key vault. :type key_vault_cert_name: str :param cert_version: The certificate version of key vault. :type cert_version: str - :param issuer: The issuer of certificate. - :type issuer: str - :param issued_date: The issue date of certificate. - :type issued_date: str - :param expiration_date: The expiration date of certificate. - :type expiration_date: str - :param activate_date: The activate date of certificate. - :type activate_date: str - :param subject_name: The subject name of certificate. - :type subject_name: str - :param dns_names: The domain list of certificate. - :type dns_names: list[str] + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] """ _validation = { + 'thumbprint': {'readonly': True}, 'vault_uri': {'required': True}, 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': True}, } _attribute_map = { @@ -315,16 +325,16 @@ class CertificateProperties(Model): def __init__(self, **kwargs): super(CertificateProperties, self).__init__(**kwargs) - self.thumbprint = kwargs.get('thumbprint', None) + self.thumbprint = None self.vault_uri = kwargs.get('vault_uri', None) self.key_vault_cert_name = kwargs.get('key_vault_cert_name', None) self.cert_version = kwargs.get('cert_version', None) - self.issuer = kwargs.get('issuer', None) - self.issued_date = kwargs.get('issued_date', None) - self.expiration_date = kwargs.get('expiration_date', None) - self.activate_date = kwargs.get('activate_date', None) - self.subject_name = kwargs.get('subject_name', None) - self.dns_names = kwargs.get('dns_names', None) + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.dns_names = None class CertificateResource(ProxyResource): @@ -813,13 +823,16 @@ def __init__(self, **kwargs): class DeploymentSettings(Model): """Deployment settings payload. - :param cpu: Required CPU. Default value: 1 . + :param cpu: Required CPU, basic tier should be 1, standard tier should be + in range (1, 4). Default value: 1 . :type cpu: int - :param memory_in_gb: Required Memory size in GB. Default value: 1 . + :param memory_in_gb: Required Memory size in GB, basic tier should be in + range (1, 2), standard tier should be in range (1, 8). Default value: 1 . :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str - :param instance_count: Instance count. Default value: 1 . + :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] @@ -829,12 +842,6 @@ class DeploymentSettings(Model): ~azure.mgmt.appplatform.models.RuntimeVersion """ - _validation = { - 'cpu': {'maximum': 4, 'minimum': 1}, - 'memory_in_gb': {'maximum': 8, 'minimum': 1}, - 'instance_count': {'maximum': 20, 'minimum': 1}, - } - _attribute_map = { 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, @@ -1139,8 +1146,8 @@ class OperationDetail(Model): :param name: Name of the operation :type name: str - :param data_action: Indicates whether the operation is a data action - :type data_action: bool + :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 :param origin: Origin of the operation @@ -1151,7 +1158,7 @@ class OperationDetail(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'data_action': {'key': 'dataAction', 'type': 'bool'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'OperationProperties'}, @@ -1160,7 +1167,7 @@ class OperationDetail(Model): def __init__(self, **kwargs): super(OperationDetail, self).__init__(**kwargs) self.name = kwargs.get('name', None) - self.data_action = kwargs.get('data_action', None) + self.is_data_action = kwargs.get('is_data_action', None) self.display = kwargs.get('display', None) self.origin = kwargs.get('origin', None) self.properties = kwargs.get('properties', None) @@ -1266,6 +1273,177 @@ def __init__(self, **kwargs): self.key_type = kwargs.get('key_type', None) +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: ~azure.mgmt.appplatform.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] + :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] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + self.locations = kwargs.get('locations', None) + self.location_info = kwargs.get('location_info', None) + self.restrictions = kwargs.get('restrictions', None) + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.value = kwargs.get('value', None) + + +class ResourceSkuLocationInfo(Model): + """ResourceSkuLocationInfo. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.zones = kwargs.get('zones', None) + self.zone_details = kwargs.get('zone_details', None) + + +class ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = kwargs.get('locations', None) + self.zones = kwargs.get('zones', None) + + +class ResourceSkuRestrictions(Model): + """ResourceSkuRestrictions. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.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 + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.values = kwargs.get('values', None) + self.restriction_info = kwargs.get('restriction_info', None) + self.reason_code = kwargs.get('reason_code', None) + + +class ResourceSkuZoneDetails(Model): + """ResourceSkuZoneDetails. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.capabilities = kwargs.get('capabilities', None) + + class ResourceUploadDefinition(Model): """Resource upload definition payload. @@ -1344,6 +1522,8 @@ class ServiceResource(TrackedResource): :type tags: dict[str, str] :param properties: Properties of the Service resource :type properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.models.Sku """ _validation = { @@ -1359,11 +1539,13 @@ class ServiceResource(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } def __init__(self, **kwargs): super(ServiceResource, self).__init__(**kwargs) self.properties = kwargs.get('properties', None) + self.sku = kwargs.get('sku', None) class ServiceSpecification(Model): @@ -1389,6 +1571,65 @@ def __init__(self, **kwargs): self.metric_specifications = kwargs.get('metric_specifications', None) +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku + :type name: str + :param tier: Tier of the Sku + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.capacity = kwargs.get('capacity', None) + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or ~azure.mgmt.appplatform.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = kwargs.get('minimum', None) + self.maximum = kwargs.get('maximum', None) + self.default = kwargs.get('default', None) + self.scale_type = kwargs.get('scale_type', None) + + class TemporaryDisk(Model): """Temporary disk payload. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_models_py3.py index 8a05ad5edda..02ca3876fb3 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 @@ -271,33 +271,43 @@ def __init__(self, *, resource_name: str=None, resource_type: str=None, resource class CertificateProperties(Model): """Certificate resource payload. + Variables are only populated by the server, and will be ignored when + sending a request. + All required parameters must be populated in order to send to Azure. - :param thumbprint: The thumbprint of certificate. - :type thumbprint: str + :ivar thumbprint: The thumbprint of certificate. + :vartype thumbprint: str :param vault_uri: Required. The vault uri of user key vault. :type vault_uri: str :param key_vault_cert_name: Required. The certificate name of key vault. :type key_vault_cert_name: str :param cert_version: The certificate version of key vault. :type cert_version: str - :param issuer: The issuer of certificate. - :type issuer: str - :param issued_date: The issue date of certificate. - :type issued_date: str - :param expiration_date: The expiration date of certificate. - :type expiration_date: str - :param activate_date: The activate date of certificate. - :type activate_date: str - :param subject_name: The subject name of certificate. - :type subject_name: str - :param dns_names: The domain list of certificate. - :type dns_names: list[str] + :ivar issuer: The issuer of certificate. + :vartype issuer: str + :ivar issued_date: The issue date of certificate. + :vartype issued_date: str + :ivar expiration_date: The expiration date of certificate. + :vartype expiration_date: str + :ivar activate_date: The activate date of certificate. + :vartype activate_date: str + :ivar subject_name: The subject name of certificate. + :vartype subject_name: str + :ivar dns_names: The domain list of certificate. + :vartype dns_names: list[str] """ _validation = { + 'thumbprint': {'readonly': True}, 'vault_uri': {'required': True}, 'key_vault_cert_name': {'required': True}, + 'issuer': {'readonly': True}, + 'issued_date': {'readonly': True}, + 'expiration_date': {'readonly': True}, + 'activate_date': {'readonly': True}, + 'subject_name': {'readonly': True}, + 'dns_names': {'readonly': True}, } _attribute_map = { @@ -313,18 +323,18 @@ class CertificateProperties(Model): 'dns_names': {'key': 'dnsNames', 'type': '[str]'}, } - def __init__(self, *, vault_uri: str, key_vault_cert_name: str, thumbprint: str=None, cert_version: str=None, issuer: str=None, issued_date: str=None, expiration_date: str=None, activate_date: str=None, subject_name: str=None, dns_names=None, **kwargs) -> None: + def __init__(self, *, vault_uri: str, key_vault_cert_name: str, cert_version: str=None, **kwargs) -> None: super(CertificateProperties, self).__init__(**kwargs) - self.thumbprint = thumbprint + self.thumbprint = None self.vault_uri = vault_uri self.key_vault_cert_name = key_vault_cert_name self.cert_version = cert_version - self.issuer = issuer - self.issued_date = issued_date - self.expiration_date = expiration_date - self.activate_date = activate_date - self.subject_name = subject_name - self.dns_names = dns_names + self.issuer = None + self.issued_date = None + self.expiration_date = None + self.activate_date = None + self.subject_name = None + self.dns_names = None class CertificateResource(ProxyResource): @@ -813,13 +823,16 @@ def __init__(self, *, source=None, deployment_settings=None, **kwargs) -> None: class DeploymentSettings(Model): """Deployment settings payload. - :param cpu: Required CPU. Default value: 1 . + :param cpu: Required CPU, basic tier should be 1, standard tier should be + in range (1, 4). Default value: 1 . :type cpu: int - :param memory_in_gb: Required Memory size in GB. Default value: 1 . + :param memory_in_gb: Required Memory size in GB, basic tier should be in + range (1, 2), standard tier should be in range (1, 8). Default value: 1 . :type memory_in_gb: int :param jvm_options: JVM parameter :type jvm_options: str - :param instance_count: Instance count. Default value: 1 . + :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] @@ -829,12 +842,6 @@ class DeploymentSettings(Model): ~azure.mgmt.appplatform.models.RuntimeVersion """ - _validation = { - 'cpu': {'maximum': 4, 'minimum': 1}, - 'memory_in_gb': {'maximum': 8, 'minimum': 1}, - 'instance_count': {'maximum': 20, 'minimum': 1}, - } - _attribute_map = { 'cpu': {'key': 'cpu', 'type': 'int'}, 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, @@ -1139,8 +1146,8 @@ class OperationDetail(Model): :param name: Name of the operation :type name: str - :param data_action: Indicates whether the operation is a data action - :type data_action: bool + :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 :param origin: Origin of the operation @@ -1151,16 +1158,16 @@ class OperationDetail(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'data_action': {'key': 'dataAction', 'type': 'bool'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'OperationProperties'}, } - def __init__(self, *, name: str=None, data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: super(OperationDetail, self).__init__(**kwargs) self.name = name - self.data_action = data_action + self.is_data_action = is_data_action self.display = display self.origin = origin self.properties = properties @@ -1266,6 +1273,177 @@ def __init__(self, *, key_type, **kwargs) -> None: self.key_type = key_type +class ResourceSku(Model): + """Describes an available Azure Spring Cloud SKU. + + :param resource_type: Gets the type of resource the SKU applies to. + :type resource_type: str + :param name: Gets the name of SKU. + :type name: str + :param tier: Gets the tier of SKU. + :type tier: str + :param capacity: Gets the capacity of SKU. + :type capacity: ~azure.mgmt.appplatform.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] + :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] + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'SkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ResourceSkuLocationInfo]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, *, resource_type: str=None, name: str=None, tier: str=None, capacity=None, locations=None, location_info=None, restrictions=None, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.name = name + self.tier = tier + self.capacity = capacity + self.locations = locations + self.location_info = location_info + self.restrictions = restrictions + + +class ResourceSkuCapabilities(Model): + """ResourceSkuCapabilities. + + :param name: Gets an invariant to describe the feature. + :type name: str + :param value: Gets an invariant if the feature is measured by quantity. + :type value: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None: + super(ResourceSkuCapabilities, self).__init__(**kwargs) + self.name = name + self.value = value + + +class ResourceSkuLocationInfo(Model): + """ResourceSkuLocationInfo. + + :param location: Gets location of the SKU + :type location: str + :param zones: Gets list of availability zones where the SKU is supported. + :type zones: list[str] + :param zone_details: Gets details of capabilities available to a SKU in + specific zones. + :type zone_details: + list[~azure.mgmt.appplatform.models.ResourceSkuZoneDetails] + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ResourceSkuZoneDetails]'}, + } + + def __init__(self, *, location: str=None, zones=None, zone_details=None, **kwargs) -> None: + super(ResourceSkuLocationInfo, self).__init__(**kwargs) + self.location = location + self.zones = zones + self.zone_details = zone_details + + +class ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + :param locations: Gets locations where the SKU is restricted + :type locations: list[str] + :param zones: Gets list of availability zones where the SKU is restricted. + :type zones: list[str] + """ + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, locations=None, zones=None, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = locations + self.zones = zones + + +class ResourceSkuRestrictions(Model): + """ResourceSkuRestrictions. + + :param type: Gets the type of restrictions. Possible values include: + 'Location', 'Zone' + :type type: str or + ~azure.mgmt.appplatform.models.ResourceSkuRestrictionsType + :param values: Gets the value of restrictions. If the restriction type is + set to + location. This would be different locations where the SKU is restricted. + :type values: list[str] + :param restriction_info: Gets the information about the restriction where + the SKU cannot be used. + :type restriction_info: + ~azure.mgmt.appplatform.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 + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, *, type=None, values=None, restriction_info=None, reason_code=None, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = type + self.values = values + self.restriction_info = restriction_info + self.reason_code = reason_code + + +class ResourceSkuZoneDetails(Model): + """ResourceSkuZoneDetails. + + :param name: Gets the set of zones that the SKU is available in with the + specified capabilities. + :type name: list[str] + :param capabilities: Gets a list of capabilities that are available for + the SKU in the + specified list of zones. + :type capabilities: + list[~azure.mgmt.appplatform.models.ResourceSkuCapabilities] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ResourceSkuCapabilities]'}, + } + + def __init__(self, *, name=None, capabilities=None, **kwargs) -> None: + super(ResourceSkuZoneDetails, self).__init__(**kwargs) + self.name = name + self.capabilities = capabilities + + class ResourceUploadDefinition(Model): """Resource upload definition payload. @@ -1344,6 +1522,8 @@ class ServiceResource(TrackedResource): :type tags: dict[str, str] :param properties: Properties of the Service resource :type properties: ~azure.mgmt.appplatform.models.ClusterResourceProperties + :param sku: Sku of the Service resource + :type sku: ~azure.mgmt.appplatform.models.Sku """ _validation = { @@ -1359,11 +1539,13 @@ class ServiceResource(TrackedResource): 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, properties=None, sku=None, **kwargs) -> None: super(ServiceResource, self).__init__(location=location, tags=tags, **kwargs) self.properties = properties + self.sku = sku class ServiceSpecification(Model): @@ -1389,6 +1571,65 @@ def __init__(self, *, log_specifications=None, metric_specifications=None, **kwa self.metric_specifications = metric_specifications +class Sku(Model): + """Sku of Azure Spring Cloud. + + :param name: Name of the Sku + :type name: str + :param tier: Tier of the Sku + :type tier: str + :param capacity: Current capacity of the target resource + :type capacity: int + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'int'}, + } + + def __init__(self, *, name: str=None, tier: str=None, capacity: int=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.capacity = capacity + + +class SkuCapacity(Model): + """The SKU capacity. + + All required parameters must be populated in order to send to Azure. + + :param minimum: Required. Gets or sets the minimum. + :type minimum: int + :param maximum: Gets or sets the maximum. + :type maximum: int + :param default: Gets or sets the default. + :type default: int + :param scale_type: Gets or sets the type of the scale. Possible values + include: 'None', 'Manual', 'Automatic' + :type scale_type: str or ~azure.mgmt.appplatform.models.SkuScaleType + """ + + _validation = { + 'minimum': {'required': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__(self, *, minimum: int, maximum: int=None, default: int=None, scale_type=None, **kwargs) -> None: + super(SkuCapacity, self).__init__(**kwargs) + self.minimum = minimum + self.maximum = maximum + self.default = default + self.scale_type = scale_type + + class TemporaryDisk(Model): """Temporary disk payload. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/models/_paged_models.py index 63c872c720b..d04b54cc306 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 @@ -103,3 +103,16 @@ class OperationDetailPaged(Paged): def __init__(self, *args, **kwargs): super(OperationDetailPaged, self).__init__(*args, **kwargs) +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/__init__.py index e6ebd5353e7..45301a531c0 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 @@ -16,6 +16,7 @@ from ._custom_domains_operations import CustomDomainsOperations from ._deployments_operations import DeploymentsOperations from ._operations import Operations +from ._sku_operations import SkuOperations __all__ = [ 'ServicesOperations', @@ -25,4 +26,5 @@ 'CustomDomainsOperations', 'DeploymentsOperations', 'Operations', + 'SkuOperations', ] 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 new file mode 100644 index 00000000000..26330c9b065 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/operations/_sku_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 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'}