diff --git a/src/spring-cloud/azext_spring_cloud/_enterprise.py b/src/spring-cloud/azext_spring_cloud/_enterprise.py index a2f9d9e6cb4..47459c56076 100644 --- a/src/spring-cloud/azext_spring_cloud/_enterprise.py +++ b/src/spring-cloud/azext_spring_cloud/_enterprise.py @@ -26,6 +26,8 @@ DELETE_PRODUCTION_DEPLOYMENT_WARNING = "You are going to delete production deployment, the app will be inaccessible after this operation." LOG_RUNNING_PROMPT = "This command usually takes minutes to run. Add '--verbose' parameter if needed." +DEFAULT_BUILD_SERVICE_NAME = "default" + def app_get_enterprise(cmd, client, resource_group, service, name): app = client.apps.get(resource_group, service, name) diff --git a/src/spring-cloud/azext_spring_cloud/_help.py b/src/spring-cloud/azext_spring_cloud/_help.py index 03711b986ae..21c3b5a7d24 100644 --- a/src/spring-cloud/azext_spring_cloud/_help.py +++ b/src/spring-cloud/azext_spring_cloud/_help.py @@ -542,3 +542,46 @@ - name: Unbind an app to Application Configuration Service. text: az spring-cloud application-configuration-service unbind --app MyApp -s MyService -g MyResourceGroup """ + +helps['spring-cloud build-service buildpacks-binding'] = """ + type: group + short-summary: (Enterprise Tier Only) Commands to manage Buildpacks Binding +""" + +helps['spring-cloud build-service buildpacks-binding create'] = """ + type: command + short-summary: Create a buildpacks binding. + examples: + - name: Create a buildpacks binding without properties or secrets. + text: az spring-cloud build-service buildpacks-binding create --name first-binding --type ApplicationInsights + - name: Create a buildpacks binding with only secrets. + text: az spring-cloud build-service buildpacks-binding create --name first-binding --type ApplicationInsights --secrets k1=v1 k2=v2 + - name: Create a buildpacks binding with only properties. + text: az spring-cloud build-service buildpacks-binding create --name first-binding --type ApplicationInsights --properties a=b c=d + - name: Create a buildpacks binding with properties and secrets. + text: az spring-cloud build-service buildpacks-binding create --name first-binding --type ApplicationInsights --properties a=b c=d --secrets k1=v1 k2=v2 +""" + +helps['spring-cloud build-service buildpacks-binding set'] = """ + type: command + short-summary: Set a buildpacks binding. + examples: + - name: Set a buildpacks binding with properties and secrets. + text: az spring-cloud build-service buildpacks-binding set --name first-binding --type ApplicationInsights --properties a=b c=d --secrets k1=v1 k2=v2 +""" + +helps['spring-cloud build-service buildpacks-binding show'] = """ + type: command + short-summary: Show a buildpacks binding, the secrets will be masked. + examples: + - name: Show a buildpacks binding. + text: az spring-cloud build-service buildpacks-binding show --name first-binding +""" + +helps['spring-cloud build-service buildpacks-binding delete'] = """ + type: command + short-summary: Delete a buildpacks binding. + examples: + - name: Delete a buildpacks binding. + text: az spring-cloud build-service buildpacks-binding delete --name first-binding +""" diff --git a/src/spring-cloud/azext_spring_cloud/_params.py b/src/spring-cloud/azext_spring_cloud/_params.py index 85e614b2e49..5fb668a82a7 100644 --- a/src/spring-cloud/azext_spring_cloud/_params.py +++ b/src/spring-cloud/azext_spring_cloud/_params.py @@ -13,11 +13,17 @@ validate_vnet, validate_vnet_required_parameters, validate_node_resource_group, validate_tracing_parameters, validate_app_insights_parameters, validate_java_agent_parameters, validate_instance_count) -from ._validators_enterprise import (only_support_enterprise, validate_config_file_patterns, validate_cpu, validate_memory, +from ._validators_enterprise import (validate_config_file_patterns, validate_cpu, validate_memory, + validate_buildpacks_binding_properties, + validate_buildpacks_binding_secrets, only_support_enterprise, + validate_buildpacks_binding_not_exist, validate_buildpacks_binding_exist, validate_git_uri, validate_acs_patterns) from ._utils import ApiType from .vendored_sdks.appplatform.v2020_07_01.models import RuntimeVersion, TestKeyType +from .vendored_sdks.appplatform.v2022_05_01_preview.models \ + import _app_platform_management_client_enums as v20220501_preview_AppPlatformEnums + name_type = CLIArgumentType(options_list=[ '--name', '-n'], help='The primary resource name', validator=validate_name) @@ -321,3 +327,35 @@ def prepare_logs_argument(c): 'spring-cloud application-configuration-service git repo remove']: with self.argument_context(scope) as c: c.argument('name', help="Required unique name to label each item of git configs.") + + for scope in ['spring-cloud build-service buildpacks-binding create', + 'spring-cloud build-service buildpacks-binding set']: + with self.argument_context(scope) as c: + c.argument('type', + arg_type=get_enum_type(v20220501_preview_AppPlatformEnums.BindingType), + help='Required type for buildpacks binding.') + c.argument('properties', + help='Non-sensitive properties for launchProperties. Format "key[=value]".', + nargs='*', + validator=validate_buildpacks_binding_properties) + c.argument('secrets', + help='Sensitive properties for launchProperties. ' + 'Once put, it will be encrypted and never return to user. ' + 'Format "key[=value]".', + nargs='*', + validator=validate_buildpacks_binding_secrets) + + for scope in ['spring-cloud build-service buildpacks-binding create']: + with self.argument_context(scope) as c: + c.argument('name', help='Name for buildpacks binding.', validator=validate_buildpacks_binding_not_exist) + + for scope in ['spring-cloud build-service buildpacks-binding set']: + with self.argument_context(scope) as c: + c.argument('name', help='Name for buildpacks binding.', validator=validate_buildpacks_binding_exist) + + for scope in ['spring-cloud build-service buildpacks-binding create', + 'spring-cloud build-service buildpacks-binding set', + 'spring-cloud build-service buildpacks-binding show', + 'spring-cloud build-service buildpacks-binding delete']: + with self.argument_context(scope) as c: + c.argument('service', service_name_type, validator=only_support_enterprise) diff --git a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py index f147d452dd0..f7789f7f40e 100644 --- a/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py +++ b/src/spring-cloud/azext_spring_cloud/_validators_enterprise.py @@ -7,12 +7,15 @@ from re import match from azure.cli.core.util import CLIError +from azure.cli.core.commands.validators import validate_tag +from azure.core.exceptions import ResourceNotFoundError from knack.log import get_logger +from ._enterprise import DEFAULT_BUILD_SERVICE_NAME from ._resource_quantity import ( validate_cpu as validate_and_normalize_cpu, validate_memory as validate_and_normalize_memory) from ._util_enterprise import ( - is_enterprise_tier + is_enterprise_tier, get_client ) @@ -75,3 +78,46 @@ def _is_valid_profile_name(profile): def _is_valid_app_and_profile_name(pattern): parts = pattern.split('/') return len(parts) == 2 and _is_valid_app_name(parts[0]) and _is_valid_profile_name(parts[1]) + + +def validate_buildpacks_binding_properties(namespace): + """ Extracts multiple space-separated properties in key[=value] format """ + if isinstance(namespace.properties, list): + properties_dict = {} + for item in namespace.properties: + properties_dict.update(validate_tag(item)) + namespace.properties = properties_dict + + +def validate_buildpacks_binding_secrets(namespace): + """ Extracts multiple space-separated secrets in key[=value] format """ + if isinstance(namespace.secrets, list): + secrets_dict = {} + for item in namespace.secrets: + secrets_dict.update(validate_tag(item)) + namespace.secrets = secrets_dict + + +def validate_buildpacks_binding_not_exist(cmd, namespace): + client = get_client(cmd) + try: + binding_resource = client.buildpacks_binding.get(namespace.resource_group, + namespace.service, + DEFAULT_BUILD_SERVICE_NAME, + namespace.name) + if binding_resource is not None: + raise CLIError('Buildpacks Binding {} already exists ' + 'in resource group {}, service {}. You can edit it by set command.' + .format(binding_name, resource_group, service)) + except ResourceNotFoundError: + # Excepted case + pass + + +def validate_buildpacks_binding_exist(cmd, namespace): + client = get_client(cmd) + # If not exists exception will be raised + client.buildpacks_binding.get(namespace.resource_group, + namespace.service, + DEFAULT_BUILD_SERVICE_NAME, + namespace.name) diff --git a/src/spring-cloud/azext_spring_cloud/buildpacks_binding.py b/src/spring-cloud/azext_spring_cloud/buildpacks_binding.py new file mode 100644 index 00000000000..3d4987ae849 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/buildpacks_binding.py @@ -0,0 +1,34 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=wrong-import-order +from ._enterprise import DEFAULT_BUILD_SERVICE_NAME +from .vendored_sdks.appplatform.v2022_05_01_preview import models + + +def create_or_update_buildpacks_binding(cmd, client, resource_group, service, + name, type, properties=None, secrets=None): + binding_resource = _build_buildpacks_binding_resource(type, properties, secrets) + return client.buildpacks_binding.create_or_update(resource_group, + service, + DEFAULT_BUILD_SERVICE_NAME, + name, + binding_resource) + + +def buildpacks_binding_show(cmd, client, resource_group, service, name): + return client.buildpacks_binding.get(resource_group, service, DEFAULT_BUILD_SERVICE_NAME, name) + + +def buildpacks_binding_delete(cmd, client, resource_group, service, name): + return client.buildpacks_binding.delete(resource_group, service, DEFAULT_BUILD_SERVICE_NAME, name) + + +def _build_buildpacks_binding_resource(binding_type, properties_dict, secrets_dict): + launch_properties = models.BuildpacksBindingLaunchProperties(properties=properties_dict, + secrets=secrets_dict) + binding_properties = models.BuildpacksBindingProperties(binding_type=binding_type, + launch_properties=launch_properties) + return models.BuildpacksBindingResource(properties=binding_properties) diff --git a/src/spring-cloud/azext_spring_cloud/commands.py b/src/spring-cloud/azext_spring_cloud/commands.py index db5bc5bdb78..3c758928f1b 100644 --- a/src/spring-cloud/azext_spring_cloud/commands.py +++ b/src/spring-cloud/azext_spring_cloud/commands.py @@ -42,6 +42,11 @@ def load_command_table(self, _): client_factory=cf_spring_cloud_enterprise ) + buildpacks_binding_cmd_group = CliCommandType( + operations_tmpl="azext_spring_cloud.buildpacks_binding#{}", + client_factory=cf_spring_cloud_enterprise + ) + with self.command_group('spring-cloud', client_factory=cf_app_services, exception_handler=handle_asc_exception) as g: g.custom_command('create', 'spring_cloud_create', supports_no_wait=True, client_factory=cf_spring_cloud) @@ -171,5 +176,14 @@ def load_command_table(self, _): g.custom_command('remove', 'application_configuration_service_git_remove') g.custom_command('list', 'application_configuration_service_git_list') + with self.command_group('spring-cloud build-service buildpacks-binding', + custom_command_type=buildpacks_binding_cmd_group, + exception_handler=handle_asc_exception) as g: + # create and set commands are differentiate by their parameter validators + g.custom_command('create', 'create_or_update_buildpacks_binding') + g.custom_command('set', 'create_or_update_buildpacks_binding') + g.custom_command('show', 'buildpacks_binding_show') + g.custom_command('delete', 'buildpacks_binding_delete') + with self.command_group('spring-cloud', exception_handler=handle_asc_exception): pass 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 27a89fd2b94..6300c4bb258 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 @@ -178,6 +178,19 @@ def build_service(self): raise ValueError("API version {} does not have operation group 'build_service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def buildpacks_binding(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`BuildpacksBindingOperations` + """ + api_version = self._get_api_version('buildpacks_binding') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import BuildpacksBindingOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'buildpacks_binding'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def certificates(self): """Instance depends on the API version: @@ -360,6 +373,32 @@ def runtime_versions(self): raise ValueError("API version {} does not have operation group 'runtime_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def service(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ServiceOperations` + """ + api_version = self._get_api_version('service') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import ServiceOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'service'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def service_registries(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ServiceRegistriesOperations` + """ + api_version = self._get_api_version('service_registries') + if api_version == '2022-05-01-preview': + from .v2022_05_01_preview.operations import ServiceRegistriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'service_registries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def services(self): """Instance depends on the API version: diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/aio/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/aio/_app_platform_management_client.py index a3e9a834549..58cdc2fd941 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/aio/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/aio/_app_platform_management_client.py @@ -176,6 +176,19 @@ def build_service(self): raise ValueError("API version {} does not have operation group 'build_service'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def buildpacks_binding(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`BuildpacksBindingOperations` + """ + api_version = self._get_api_version('buildpacks_binding') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import BuildpacksBindingOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'buildpacks_binding'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def certificates(self): """Instance depends on the API version: @@ -358,6 +371,32 @@ def runtime_versions(self): raise ValueError("API version {} does not have operation group 'runtime_versions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def service(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ServiceOperations` + """ + api_version = self._get_api_version('service') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import ServiceOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'service'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def service_registries(self): + """Instance depends on the API version: + + * 2022-05-01-preview: :class:`ServiceRegistriesOperations` + """ + api_version = self._get_api_version('service_registries') + if api_version == '2022-05-01-preview': + from ..v2022_05_01_preview.aio.operations import ServiceRegistriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'service_registries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def services(self): """Instance depends on the API version: diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/py.typed b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/_metadata.json b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/_metadata.json deleted file mode 100644 index ed50cf259b5..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/_metadata.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "chosen_version": "2019-05-01-preview", - "total_api_version_list": ["2019-05-01-preview"], - "client": { - "name": "AppPlatformManagementClient", - "filename": "_app_platform_management_client", - "description": "REST API for Azure Spring Cloud.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=None, # type: Optional[str]", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: Optional[str] = None,", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "services": "ServicesOperations", - "apps": "AppsOperations", - "bindings": "BindingsOperations", - "certificates": "CertificatesOperations", - "custom_domains": "CustomDomainsOperations", - "deployments": "DeploymentsOperations", - "operations": "Operations", - "runtime_versions": "RuntimeVersionsOperations", - "sku": "SkuOperations" - } -} \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/py.typed b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2019_05_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/_metadata.json b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/_metadata.json deleted file mode 100644 index 1f417c7fc3f..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/_metadata.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chosen_version": "2020-07-01", - "total_api_version_list": ["2020-07-01"], - "client": { - "name": "AppPlatformManagementClient", - "filename": "_app_platform_management_client", - "description": "REST API for Azure Spring Cloud.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=None, # type: Optional[str]", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: Optional[str] = None,", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "services": "ServicesOperations", - "config_servers": "ConfigServersOperations", - "monitoring_settings": "MonitoringSettingsOperations", - "apps": "AppsOperations", - "bindings": "BindingsOperations", - "certificates": "CertificatesOperations", - "custom_domains": "CustomDomainsOperations", - "deployments": "DeploymentsOperations", - "operations": "Operations", - "runtime_versions": "RuntimeVersionsOperations", - "skus": "SkusOperations" - } -} \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/py.typed b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_07_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/_metadata.json b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/_metadata.json deleted file mode 100644 index 22c085a41a3..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/_metadata.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chosen_version": "2020-11-01-preview", - "total_api_version_list": ["2020-11-01-preview"], - "client": { - "name": "AppPlatformManagementClient", - "filename": "_app_platform_management_client", - "description": "REST API for Azure Spring Cloud.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=None, # type: Optional[str]", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: Optional[str] = None,", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "services": "ServicesOperations", - "config_servers": "ConfigServersOperations", - "monitoring_settings": "MonitoringSettingsOperations", - "apps": "AppsOperations", - "bindings": "BindingsOperations", - "certificates": "CertificatesOperations", - "custom_domains": "CustomDomainsOperations", - "deployments": "DeploymentsOperations", - "operations": "Operations", - "runtime_versions": "RuntimeVersionsOperations", - "skus": "SkusOperations" - } -} \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/py.typed b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2020_11_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_metadata.json b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_metadata.json deleted file mode 100644 index c8bb068cd9a..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/_metadata.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "chosen_version": "2021-06-01-preview", - "total_api_version_list": ["2021-06-01-preview"], - "client": { - "name": "AppPlatformManagementClient", - "filename": "_app_platform_management_client", - "description": "REST API for Azure Spring Cloud.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AppPlatformManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=None, # type: Optional[str]", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: Optional[str] = None,", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "services": "ServicesOperations", - "config_servers": "ConfigServersOperations", - "monitoring_settings": "MonitoringSettingsOperations", - "apps": "AppsOperations", - "bindings": "BindingsOperations", - "certificates": "CertificatesOperations", - "custom_domains": "CustomDomainsOperations", - "deployments": "DeploymentsOperations", - "operations": "Operations", - "runtime_versions": "RuntimeVersionsOperations", - "skus": "SkusOperations" - } -} \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/py.typed b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2021_06_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py index 731fd96b9ca..56650ef8a36 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/_app_platform_management_client.py @@ -22,7 +22,10 @@ from .operations import ServicesOperations from .operations import ConfigServersOperations from .operations import ConfigurationServicesOperations +from .operations import ServiceRegistriesOperations +from .operations import ServiceOperations from .operations import BuildServiceOperations +from .operations import BuildpacksBindingOperations from .operations import MonitoringSettingsOperations from .operations import AppsOperations from .operations import BindingsOperations @@ -44,8 +47,14 @@ class AppPlatformManagementClient(object): :vartype config_servers: azure.mgmt.appplatform.v2022_05_01_preview.operations.ConfigServersOperations :ivar configuration_services: ConfigurationServicesOperations operations :vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.operations.ConfigurationServicesOperations + :ivar service_registries: ServiceRegistriesOperations operations + :vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceRegistriesOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.appplatform.v2022_05_01_preview.operations.ServiceOperations :ivar build_service: BuildServiceOperations operations :vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.operations.BuildServiceOperations + :ivar buildpacks_binding: BuildpacksBindingOperations operations + :vartype buildpacks_binding: azure.mgmt.appplatform.v2022_05_01_preview.operations.BuildpacksBindingOperations :ivar monitoring_settings: MonitoringSettingsOperations operations :vartype monitoring_settings: azure.mgmt.appplatform.v2022_05_01_preview.operations.MonitoringSettingsOperations :ivar apps: AppsOperations operations @@ -96,8 +105,14 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.configuration_services = ConfigurationServicesOperations( self._client, self._config, self._serialize, self._deserialize) + self.service_registries = ServiceRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) self.build_service = BuildServiceOperations( self._client, self._config, self._serialize, self._deserialize) + self.buildpacks_binding = BuildpacksBindingOperations( + self._client, self._config, self._serialize, self._deserialize) self.monitoring_settings = MonitoringSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.apps = AppsOperations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py index 4987a719467..3e1e3034473 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/_app_platform_management_client.py @@ -20,7 +20,10 @@ from .operations import ServicesOperations from .operations import ConfigServersOperations from .operations import ConfigurationServicesOperations +from .operations import ServiceRegistriesOperations +from .operations import ServiceOperations from .operations import BuildServiceOperations +from .operations import BuildpacksBindingOperations from .operations import MonitoringSettingsOperations from .operations import AppsOperations from .operations import BindingsOperations @@ -42,8 +45,14 @@ class AppPlatformManagementClient(object): :vartype config_servers: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ConfigServersOperations :ivar configuration_services: ConfigurationServicesOperations operations :vartype configuration_services: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ConfigurationServicesOperations + :ivar service_registries: ServiceRegistriesOperations operations + :vartype service_registries: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceRegistriesOperations + :ivar service: ServiceOperations operations + :vartype service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.ServiceOperations :ivar build_service: BuildServiceOperations operations :vartype build_service: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.BuildServiceOperations + :ivar buildpacks_binding: BuildpacksBindingOperations operations + :vartype buildpacks_binding: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.BuildpacksBindingOperations :ivar monitoring_settings: MonitoringSettingsOperations operations :vartype monitoring_settings: azure.mgmt.appplatform.v2022_05_01_preview.aio.operations.MonitoringSettingsOperations :ivar apps: AppsOperations operations @@ -93,8 +102,14 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.configuration_services = ConfigurationServicesOperations( self._client, self._config, self._serialize, self._deserialize) + self.service_registries = ServiceRegistriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) self.build_service = BuildServiceOperations( self._client, self._config, self._serialize, self._deserialize) + self.buildpacks_binding = BuildpacksBindingOperations( + self._client, self._config, self._serialize, self._deserialize) self.monitoring_settings = MonitoringSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.apps = AppsOperations( diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py index 0089c0e11aa..8858c1d09e8 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/__init__.py @@ -9,7 +9,10 @@ from ._services_operations import ServicesOperations from ._config_servers_operations import ConfigServersOperations from ._configuration_services_operations import ConfigurationServicesOperations +from ._service_registries_operations import ServiceRegistriesOperations +from ._service_operations import ServiceOperations from ._build_service_operations import BuildServiceOperations +from ._buildpacks_binding_operations import BuildpacksBindingOperations from ._monitoring_settings_operations import MonitoringSettingsOperations from ._apps_operations import AppsOperations from ._bindings_operations import BindingsOperations @@ -24,7 +27,10 @@ 'ServicesOperations', 'ConfigServersOperations', 'ConfigurationServicesOperations', + 'ServiceRegistriesOperations', + 'ServiceOperations', 'BuildServiceOperations', + 'BuildpacksBindingOperations', 'MonitoringSettingsOperations', 'AppsOperations', 'BindingsOperations', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpacks_binding_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpacks_binding_operations.py new file mode 100644 index 00000000000..ad31f079f64 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_buildpacks_binding_operations.py @@ -0,0 +1,254 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BuildpacksBindingOperations: + """BuildpacksBindingOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + buildpacks_binding_name: str, + **kwargs: Any + ) -> "_models.BuildpacksBindingResource": + """Get a buildpacks binding by name. + + :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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BuildpacksBindingResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BuildpacksBindingResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + buildpacks_binding_name: str, + buildpacks_binding: "_models.BuildpacksBindingResource", + **kwargs: Any + ) -> "_models.BuildpacksBindingResource": + """Create or update a buildpacks 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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :param buildpacks_binding: The target buildpacks binding for the create or update operation. + :type buildpacks_binding: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BuildpacksBindingResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BuildpacksBindingResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(buildpacks_binding, 'BuildpacksBindingResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + service_name: str, + build_service_name: str, + buildpacks_binding_name: str, + **kwargs: Any + ) -> None: + """Operation to delete a Buildpacks 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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py new file mode 100644 index 00000000000..f70922c4384 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_operations.py @@ -0,0 +1,152 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceOperations: + """ServiceOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _registries_delete_initial( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._registries_delete_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _registries_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + async def begin_registries_delete( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Disable the default Service Registry. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._registries_delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_registries_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py new file mode 100644 index 00000000000..72013ca2b60 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/aio/operations/_service_registries_operations.py @@ -0,0 +1,224 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ServiceRegistriesOperations: + """ServiceRegistriesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> "_models.ServiceRegistryResource": + """Get the Service Registry 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceRegistryResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> "_models.ServiceRegistryResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + service_name: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.ServiceRegistryResource"]: + """Create the default Service Registry or update the existing Service Registry. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ServiceRegistryResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/__init__.py index cc326e4723c..7aca37be7fb 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/__init__.py @@ -29,6 +29,9 @@ from ._models_py3 import BuildServiceProperties from ._models_py3 import BuildServicePropertiesRuntimeState from ._models_py3 import BuildStageProperties + from ._models_py3 import BuildpacksBindingLaunchProperties + from ._models_py3 import BuildpacksBindingProperties + from ._models_py3 import BuildpacksBindingResource from ._models_py3 import CertificateProperties from ._models_py3 import CertificateResource from ._models_py3 import CertificateResourceCollection @@ -93,6 +96,10 @@ from ._models_py3 import ResourceSkuRestrictions from ._models_py3 import ResourceSkuZoneDetails from ._models_py3 import ResourceUploadDefinition + from ._models_py3 import ServiceRegistryInstance + from ._models_py3 import ServiceRegistryProperties + from ._models_py3 import ServiceRegistryResource + from ._models_py3 import ServiceRegistryRuntimeState from ._models_py3 import ServiceResource from ._models_py3 import ServiceResourceList from ._models_py3 import ServiceSpecification @@ -131,6 +138,9 @@ from ._models import BuildServiceProperties # type: ignore from ._models import BuildServicePropertiesRuntimeState # type: ignore from ._models import BuildStageProperties # type: ignore + from ._models import BuildpacksBindingLaunchProperties # type: ignore + from ._models import BuildpacksBindingProperties # type: ignore + from ._models import BuildpacksBindingResource # type: ignore from ._models import CertificateProperties # type: ignore from ._models import CertificateResource # type: ignore from ._models import CertificateResourceCollection # type: ignore @@ -195,6 +205,10 @@ from ._models import ResourceSkuRestrictions # type: ignore from ._models import ResourceSkuZoneDetails # type: ignore from ._models import ResourceUploadDefinition # type: ignore + from ._models import ServiceRegistryInstance # type: ignore + from ._models import ServiceRegistryProperties # type: ignore + from ._models import ServiceRegistryResource # type: ignore + from ._models import ServiceRegistryRuntimeState # type: ignore from ._models import ServiceResource # type: ignore from ._models import ServiceResourceList # type: ignore from ._models import ServiceSpecification # type: ignore @@ -213,6 +227,7 @@ from ._app_platform_management_client_enums import ( AppResourceProvisioningState, + BindingType, BuildResultProvisioningState, ConfigServerState, ConfigurationServiceProvisioningState, @@ -225,6 +240,7 @@ ProvisioningState, ResourceSkuRestrictionsReasonCode, ResourceSkuRestrictionsType, + ServiceRegistryProvisioningState, SkuScaleType, SupportedRuntimePlatform, SupportedRuntimeValue, @@ -255,6 +271,9 @@ 'BuildServiceProperties', 'BuildServicePropertiesRuntimeState', 'BuildStageProperties', + 'BuildpacksBindingLaunchProperties', + 'BuildpacksBindingProperties', + 'BuildpacksBindingResource', 'CertificateProperties', 'CertificateResource', 'CertificateResourceCollection', @@ -319,6 +338,10 @@ 'ResourceSkuRestrictions', 'ResourceSkuZoneDetails', 'ResourceUploadDefinition', + 'ServiceRegistryInstance', + 'ServiceRegistryProperties', + 'ServiceRegistryResource', + 'ServiceRegistryRuntimeState', 'ServiceResource', 'ServiceResourceList', 'ServiceSpecification', @@ -335,6 +358,7 @@ 'UserSourceInfo', 'ValidationMessages', 'AppResourceProvisioningState', + 'BindingType', 'BuildResultProvisioningState', 'ConfigServerState', 'ConfigurationServiceProvisioningState', @@ -347,6 +371,7 @@ 'ProvisioningState', 'ResourceSkuRestrictionsReasonCode', 'ResourceSkuRestrictionsType', + 'ServiceRegistryProvisioningState', 'SkuScaleType', 'SupportedRuntimePlatform', 'SupportedRuntimeValue', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_app_platform_management_client_enums.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_app_platform_management_client_enums.py index c0ec9c216b5..c965e2789a1 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_app_platform_management_client_enums.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_app_platform_management_client_enums.py @@ -36,6 +36,12 @@ class AppResourceProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, UPDATING = "Updating" DELETING = "Deleting" +class BindingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Buildpacks Binding Type + """ + + APPLICATION_INSIGHTS = "ApplicationInsights" + class BuildResultProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the KPack build result """ @@ -147,6 +153,16 @@ class ResourceSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, LOCATION = "Location" ZONE = "Zone" +class ServiceRegistryProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """State of the Service Registry. + """ + + CREATING = "Creating" + UPDATING = "Updating" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + DELETING = "Deleting" + class SkuScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Gets or sets the type of the scale. """ diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py index 0a928ee7331..f4423f72677 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models.py @@ -502,6 +502,95 @@ def __init__( self.tag = kwargs.get('tag', None) +class BuildpacksBindingLaunchProperties(msrest.serialization.Model): + """Buildpacks Binding Launch Properties. + + :param properties: Non-sensitive properties for launchProperties. + :type properties: dict[str, str] + :param secrets: Sensitive properties for launchProperties. + :type secrets: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': '{str}'}, + 'secrets': {'key': 'secrets', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(BuildpacksBindingLaunchProperties, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.secrets = kwargs.get('secrets', None) + + +class BuildpacksBindingProperties(msrest.serialization.Model): + """Properties of a buildpacks binding. + + :param binding_type: Buildpacks Binding Type. Possible values include: "ApplicationInsights". + :type binding_type: str or ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingType + :param launch_properties: The object describes the buildpacks binding launch properties. + :type launch_properties: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingLaunchProperties + """ + + _attribute_map = { + 'binding_type': {'key': 'bindingType', 'type': 'str'}, + 'launch_properties': {'key': 'launchProperties', 'type': 'BuildpacksBindingLaunchProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(BuildpacksBindingProperties, self).__init__(**kwargs) + self.binding_type = kwargs.get('binding_type', None) + self.launch_properties = kwargs.get('launch_properties', None) + + +class BuildpacksBindingResource(ProxyResource): + """Buildpacks Binding Resource object. + + 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 a buildpacks binding. + :type properties: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BuildpacksBindingProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + super(BuildpacksBindingResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + self.system_data = None + + class BuildProperties(msrest.serialization.Model): """Build resource properties payload. @@ -1436,9 +1525,8 @@ class ConfigurationServiceProperties(msrest.serialization.Model): :ivar runtime_state: Runtime state of the Application Configuration Service. :vartype runtime_state: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceRuntimeState - :param configuration_service_settings: The settings of Application Configuration Service. - :type configuration_service_settings: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings + :param settings: The settings of Application Configuration Service. + :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings """ _validation = { @@ -1449,7 +1537,7 @@ class ConfigurationServiceProperties(msrest.serialization.Model): _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'runtime_state': {'key': 'runtimeState', 'type': 'ConfigurationServiceRuntimeState'}, - 'configuration_service_settings': {'key': 'configurationServiceSettings', 'type': 'ConfigurationServiceSettings'}, + 'settings': {'key': 'settings', 'type': 'ConfigurationServiceSettings'}, } def __init__( @@ -1459,7 +1547,7 @@ def __init__( super(ConfigurationServiceProperties, self).__init__(**kwargs) self.provisioning_state = None self.runtime_state = None - self.configuration_service_settings = kwargs.get('configuration_service_settings', None) + self.settings = kwargs.get('settings', None) class ConfigurationServiceResource(ProxyResource): @@ -1543,13 +1631,13 @@ def __init__( class ConfigurationServiceSettings(msrest.serialization.Model): """The settings of Application Configuration Service. - :param git_properties: Property of git environment. - :type git_properties: + :param git_property: Property of git environment. + :type git_property: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitProperty """ _attribute_map = { - 'git_properties': {'key': 'gitProperties', 'type': 'ConfigurationServiceGitProperty'}, + 'git_property': {'key': 'gitProperty', 'type': 'ConfigurationServiceGitProperty'}, } def __init__( @@ -1557,7 +1645,7 @@ def __init__( **kwargs ): super(ConfigurationServiceSettings, self).__init__(**kwargs) - self.git_properties = kwargs.get('git_properties', None) + self.git_property = kwargs.get('git_property', None) class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model): @@ -1941,14 +2029,6 @@ def __init__( class DeploymentSettings(msrest.serialization.Model): """Deployment settings payload. - :param cpu: Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard - tier. This is deprecated starting from API version 2022-05-01-preview. Please use the - resourceRequests field to set the CPU size. - :type cpu: int - :param memory_in_gb: Required Memory size in GB. This should be in range [1, 2] for Basic tier, - and in range [1, 8] for Standard tier. This is deprecated starting from API version - 2022-05-01-preview. Please use the resourceRequests field to set the the memory size. - :type memory_in_gb: int :param resource_requests: The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later. @@ -1960,8 +2040,6 @@ class DeploymentSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'resource_requests': {'key': 'resourceRequests', 'type': 'ResourceRequests'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'addon_configs': {'key': 'addonConfigs', 'type': '{AddonProfile}'}, @@ -1972,8 +2050,6 @@ def __init__( **kwargs ): super(DeploymentSettings, self).__init__(**kwargs) - self.cpu = kwargs.get('cpu', 1) - self.memory_in_gb = kwargs.get('memory_in_gb', 1) self.resource_requests = kwargs.get('resource_requests', None) self.environment_variables = kwargs.get('environment_variables', None) self.addon_configs = kwargs.get('addon_configs', None) @@ -3044,6 +3120,146 @@ def __init__( self.upload_url = kwargs.get('upload_url', None) +class ServiceRegistryInstance(msrest.serialization.Model): + """Collection of instances belong to the Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Service Registry instance. + :vartype name: str + :ivar status: Status of the Service Registry instance. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryInstance, self).__init__(**kwargs) + self.name = None + self.status = None + + +class ServiceRegistryProperties(msrest.serialization.Model): + """Service Registry properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Service Registry. Possible values include: "Creating", + "Updating", "Succeeded", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryProvisioningState + :ivar runtime_state: Runtime state of the Service Registry. + :vartype runtime_state: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryRuntimeState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'runtime_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'runtime_state': {'key': 'runtimeState', 'type': 'ServiceRegistryRuntimeState'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.runtime_state = None + + +class ServiceRegistryResource(ProxyResource): + """Service Registry 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: Service Registry properties payload. + :type properties: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryProperties + """ + + _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': 'ServiceRegistryProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ServiceRegistryRuntimeState(msrest.serialization.Model): + """Runtime state of the Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: Cpu allocated to each Service Registry instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Service Registry instance. + :vartype memory: str + :ivar instance_count: Instance count of the Service Registry. + :vartype instance_count: int + :ivar instances: Collection of instances belong to the Service Registry. + :vartype instances: + list[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryInstance] + """ + + _validation = { + 'cpu': {'readonly': True}, + 'memory': {'readonly': True}, + 'instance_count': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'str'}, + 'memory': {'key': 'memory', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + 'instances': {'key': 'instances', 'type': '[ServiceRegistryInstance]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryRuntimeState, self).__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + self.instances = None + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py index 72da6dd6a41..0724046f270 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/models/_models_py3.py @@ -545,6 +545,103 @@ def __init__( self.tag = tag +class BuildpacksBindingLaunchProperties(msrest.serialization.Model): + """Buildpacks Binding Launch Properties. + + :param properties: Non-sensitive properties for launchProperties. + :type properties: dict[str, str] + :param secrets: Sensitive properties for launchProperties. + :type secrets: dict[str, str] + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': '{str}'}, + 'secrets': {'key': 'secrets', 'type': '{str}'}, + } + + def __init__( + self, + *, + properties: Optional[Dict[str, str]] = None, + secrets: Optional[Dict[str, str]] = None, + **kwargs + ): + super(BuildpacksBindingLaunchProperties, self).__init__(**kwargs) + self.properties = properties + self.secrets = secrets + + +class BuildpacksBindingProperties(msrest.serialization.Model): + """Properties of a buildpacks binding. + + :param binding_type: Buildpacks Binding Type. Possible values include: "ApplicationInsights". + :type binding_type: str or ~azure.mgmt.appplatform.v2022_05_01_preview.models.BindingType + :param launch_properties: The object describes the buildpacks binding launch properties. + :type launch_properties: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingLaunchProperties + """ + + _attribute_map = { + 'binding_type': {'key': 'bindingType', 'type': 'str'}, + 'launch_properties': {'key': 'launchProperties', 'type': 'BuildpacksBindingLaunchProperties'}, + } + + def __init__( + self, + *, + binding_type: Optional[Union[str, "BindingType"]] = None, + launch_properties: Optional["BuildpacksBindingLaunchProperties"] = None, + **kwargs + ): + super(BuildpacksBindingProperties, self).__init__(**kwargs) + self.binding_type = binding_type + self.launch_properties = launch_properties + + +class BuildpacksBindingResource(ProxyResource): + """Buildpacks Binding Resource object. + + 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 a buildpacks binding. + :type properties: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingProperties + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.appplatform.v2022_05_01_preview.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'BuildpacksBindingProperties'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + *, + properties: Optional["BuildpacksBindingProperties"] = None, + **kwargs + ): + super(BuildpacksBindingResource, self).__init__(**kwargs) + self.properties = properties + self.system_data = None + + class BuildProperties(msrest.serialization.Model): """Build resource properties payload. @@ -1562,9 +1659,8 @@ class ConfigurationServiceProperties(msrest.serialization.Model): :ivar runtime_state: Runtime state of the Application Configuration Service. :vartype runtime_state: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceRuntimeState - :param configuration_service_settings: The settings of Application Configuration Service. - :type configuration_service_settings: - ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings + :param settings: The settings of Application Configuration Service. + :type settings: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceSettings """ _validation = { @@ -1575,19 +1671,19 @@ class ConfigurationServiceProperties(msrest.serialization.Model): _attribute_map = { 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'runtime_state': {'key': 'runtimeState', 'type': 'ConfigurationServiceRuntimeState'}, - 'configuration_service_settings': {'key': 'configurationServiceSettings', 'type': 'ConfigurationServiceSettings'}, + 'settings': {'key': 'settings', 'type': 'ConfigurationServiceSettings'}, } def __init__( self, *, - configuration_service_settings: Optional["ConfigurationServiceSettings"] = None, + settings: Optional["ConfigurationServiceSettings"] = None, **kwargs ): super(ConfigurationServiceProperties, self).__init__(**kwargs) self.provisioning_state = None self.runtime_state = None - self.configuration_service_settings = configuration_service_settings + self.settings = settings class ConfigurationServiceResource(ProxyResource): @@ -1673,23 +1769,23 @@ def __init__( class ConfigurationServiceSettings(msrest.serialization.Model): """The settings of Application Configuration Service. - :param git_properties: Property of git environment. - :type git_properties: + :param git_property: Property of git environment. + :type git_property: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ConfigurationServiceGitProperty """ _attribute_map = { - 'git_properties': {'key': 'gitProperties', 'type': 'ConfigurationServiceGitProperty'}, + 'git_property': {'key': 'gitProperty', 'type': 'ConfigurationServiceGitProperty'}, } def __init__( self, *, - git_properties: Optional["ConfigurationServiceGitProperty"] = None, + git_property: Optional["ConfigurationServiceGitProperty"] = None, **kwargs ): super(ConfigurationServiceSettings, self).__init__(**kwargs) - self.git_properties = git_properties + self.git_property = git_property class ConfigurationServiceSettingsValidateResult(msrest.serialization.Model): @@ -2105,14 +2201,6 @@ def __init__( class DeploymentSettings(msrest.serialization.Model): """Deployment settings payload. - :param cpu: Required CPU. This should be 1 for Basic tier, and in range [1, 4] for Standard - tier. This is deprecated starting from API version 2022-05-01-preview. Please use the - resourceRequests field to set the CPU size. - :type cpu: int - :param memory_in_gb: Required Memory size in GB. This should be in range [1, 2] for Basic tier, - and in range [1, 8] for Standard tier. This is deprecated starting from API version - 2022-05-01-preview. Please use the resourceRequests field to set the the memory size. - :type memory_in_gb: int :param resource_requests: The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required CPU and Memory, the old field cpu and memoryInGB will be deprecated later. @@ -2124,8 +2212,6 @@ class DeploymentSettings(msrest.serialization.Model): """ _attribute_map = { - 'cpu': {'key': 'cpu', 'type': 'int'}, - 'memory_in_gb': {'key': 'memoryInGB', 'type': 'int'}, 'resource_requests': {'key': 'resourceRequests', 'type': 'ResourceRequests'}, 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, 'addon_configs': {'key': 'addonConfigs', 'type': '{AddonProfile}'}, @@ -2134,16 +2220,12 @@ class DeploymentSettings(msrest.serialization.Model): def __init__( self, *, - cpu: Optional[int] = 1, - memory_in_gb: Optional[int] = 1, resource_requests: Optional["ResourceRequests"] = None, environment_variables: Optional[Dict[str, str]] = None, addon_configs: Optional[Dict[str, "AddonProfile"]] = None, **kwargs ): super(DeploymentSettings, self).__init__(**kwargs) - self.cpu = cpu - self.memory_in_gb = memory_in_gb self.resource_requests = resource_requests self.environment_variables = environment_variables self.addon_configs = addon_configs @@ -3342,6 +3424,148 @@ def __init__( self.upload_url = upload_url +class ServiceRegistryInstance(msrest.serialization.Model): + """Collection of instances belong to the Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Name of the Service Registry instance. + :vartype name: str + :ivar status: Status of the Service Registry instance. + :vartype status: str + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryInstance, self).__init__(**kwargs) + self.name = None + self.status = None + + +class ServiceRegistryProperties(msrest.serialization.Model): + """Service Registry properties payload. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: State of the Service Registry. Possible values include: "Creating", + "Updating", "Succeeded", "Failed", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryProvisioningState + :ivar runtime_state: Runtime state of the Service Registry. + :vartype runtime_state: + ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryRuntimeState + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'runtime_state': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'runtime_state': {'key': 'runtimeState', 'type': 'ServiceRegistryRuntimeState'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryProperties, self).__init__(**kwargs) + self.provisioning_state = None + self.runtime_state = None + + +class ServiceRegistryResource(ProxyResource): + """Service Registry 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: Service Registry properties payload. + :type properties: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryProperties + """ + + _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': 'ServiceRegistryProperties'}, + } + + def __init__( + self, + *, + properties: Optional["ServiceRegistryProperties"] = None, + **kwargs + ): + super(ServiceRegistryResource, self).__init__(**kwargs) + self.properties = properties + + +class ServiceRegistryRuntimeState(msrest.serialization.Model): + """Runtime state of the Service Registry. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar cpu: Cpu allocated to each Service Registry instance. + :vartype cpu: str + :ivar memory: Memory allocated to each Service Registry instance. + :vartype memory: str + :ivar instance_count: Instance count of the Service Registry. + :vartype instance_count: int + :ivar instances: Collection of instances belong to the Service Registry. + :vartype instances: + list[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryInstance] + """ + + _validation = { + 'cpu': {'readonly': True}, + 'memory': {'readonly': True}, + 'instance_count': {'readonly': True}, + 'instances': {'readonly': True}, + } + + _attribute_map = { + 'cpu': {'key': 'cpu', 'type': 'str'}, + 'memory': {'key': 'memory', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + 'instances': {'key': 'instances', 'type': '[ServiceRegistryInstance]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceRegistryRuntimeState, self).__init__(**kwargs) + self.cpu = None + self.memory = None + self.instance_count = None + self.instances = None + + class TrackedResource(Resource): """The resource model definition for a ARM tracked top level resource. diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py index 0089c0e11aa..8858c1d09e8 100644 --- a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/__init__.py @@ -9,7 +9,10 @@ from ._services_operations import ServicesOperations from ._config_servers_operations import ConfigServersOperations from ._configuration_services_operations import ConfigurationServicesOperations +from ._service_registries_operations import ServiceRegistriesOperations +from ._service_operations import ServiceOperations from ._build_service_operations import BuildServiceOperations +from ._buildpacks_binding_operations import BuildpacksBindingOperations from ._monitoring_settings_operations import MonitoringSettingsOperations from ._apps_operations import AppsOperations from ._bindings_operations import BindingsOperations @@ -24,7 +27,10 @@ 'ServicesOperations', 'ConfigServersOperations', 'ConfigurationServicesOperations', + 'ServiceRegistriesOperations', + 'ServiceOperations', 'BuildServiceOperations', + 'BuildpacksBindingOperations', 'MonitoringSettingsOperations', 'AppsOperations', 'BindingsOperations', diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpacks_binding_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpacks_binding_operations.py new file mode 100644 index 00000000000..c8f01128e8f --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_buildpacks_binding_operations.py @@ -0,0 +1,261 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BuildpacksBindingOperations(object): + """BuildpacksBindingOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + build_service_name, # type: str + buildpacks_binding_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.BuildpacksBindingResource" + """Get a buildpacks binding by name. + + :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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BuildpacksBindingResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BuildpacksBindingResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + service_name, # type: str + build_service_name, # type: str + buildpacks_binding_name, # type: str + buildpacks_binding, # type: "_models.BuildpacksBindingResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.BuildpacksBindingResource" + """Create or update a buildpacks 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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :param buildpacks_binding: The target buildpacks binding for the create or update operation. + :type buildpacks_binding: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BuildpacksBindingResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.BuildpacksBindingResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.BuildpacksBindingResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(buildpacks_binding, 'BuildpacksBindingResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('BuildpacksBindingResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + service_name, # type: str + build_service_name, # type: str + buildpacks_binding_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Operation to delete a Buildpacks 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 build_service_name: The name of the build service resource. + :type build_service_name: str + :param buildpacks_binding_name: The name of the Buildpacks Binding Name. + :type buildpacks_binding_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + 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'), + 'buildServiceName': self._serialize.url("build_service_name", build_service_name, 'str'), + 'buildpacksBindingName': self._serialize.url("buildpacks_binding_name", buildpacks_binding_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildservices/{buildServiceName}/buildpacksBindings/{buildpacksBindingName}'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_operations.py new file mode 100644 index 00000000000..181f5bd64fd --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_operations.py @@ -0,0 +1,158 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceOperations(object): + """ServiceOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _registries_delete_initial( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._registries_delete_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _registries_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + def begin_registries_delete( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Disable the default Service Registry. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._registries_delete_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_registries_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore diff --git a/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py new file mode 100644 index 00000000000..91878c6cbe2 --- /dev/null +++ b/src/spring-cloud/azext_spring_cloud/vendored_sdks/appplatform/v2022_05_01_preview/operations/_service_registries_operations.py @@ -0,0 +1,231 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ServiceRegistriesOperations(object): + """ServiceRegistriesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.appplatform.v2022_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceRegistryResource" + """Get the Service Registry 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ServiceRegistryResource, or the result of cls(response) + :rtype: ~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ServiceRegistryResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2022-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._create_or_update_initial.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if response.status_code == 202: + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ServiceRegistryResource"] + """Create the default Service Registry or update the existing Service Registry. + + :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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServiceRegistryResource or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appplatform.v2022_05_01_preview.models.ServiceRegistryResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServiceRegistryResource"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServiceRegistryResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/serviceRegistries/default'} # type: ignore