From c9986d864994f0f1de724d60bf939faedd6d0b1f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 11 Aug 2023 06:11:02 +0000 Subject: [PATCH] CodeGen from PR 25051 in Azure/azure-rest-api-specs Release microsoft.app 2023 05 02 preview (#25051) * Adds base for updating Microsoft.App from version preview/2023-04-01-preview to version 2023-05-02-preview * Updates readme * Updates API version in new specs and examples * fix description for endTime in JobExecution (#24359) * fix description for endTime in JobExecution * fix for breaking change error * Introduce Microsoft.App/builders tracked resource and Microsoft.App/builds proxy resource (#24240) * cherry picked commit to introduce builders and builds, and updated api version * added linting suppressions to readme * pre feedback: v3 -> v5, common build/er params, rename identity to identityresourceid, inprogress -> creating * fix typo * fix model validation * added updating provisioning status, and fixed a missed provisioning status ref * Create identity to registry mapping in builder object (#24275) * create identity to registry mapping in builder object * update mapping to be a dictionary of container registries, to enforce single container registry * run prettier * run prettier on examples fil * pr feedback: v5 -> v3 and added x ms param location * fix plural naming to singular * Add GetVerificationId API (#24286) * add api * fix typo * fix spacing * fix spacing * change version --------- Co-authored-by: Chenghui Yu * Support multiple port for container app (#24332) (#24459) * Support multiple port for container app * lint * comment * Add blob storage token store support (#24455) * add blob storage token store support * update * update trigger type enum - schedule for jobs (#24399) * update trigger type enum - schedule for jobs * update trigger type enum - schedule for jobs * add previous changes merged to main * add encryption settings (#24822) * rename verification id to custom domain verification id (#24874) Co-authored-by: Chenghui Yu * Removed SourceToCloud feature from 2023-05-02-preview (#24860) * Anfranci/fixstartexectemplateabv0423 (#24863) * fix start job exec template required property * fix start job exec template required property * fix start job exec template required property * fix start job exec template required property * Add list usages api for Microsoft.App (#24833) * add api * update * update * update * update * empty line --------- Co-authored-by: Paul Dorsch <107068277+pauld-msft@users.noreply.github.com> Co-authored-by: anandanthony Co-authored-by: Seris370 <38371667+Seris370@users.noreply.github.com> Co-authored-by: Chenghui Yu Co-authored-by: zhenqxuMSFT Co-authored-by: njucz <740360112@qq.com> Co-authored-by: Xingjian Wang <79332479+xwang971@users.noreply.github.com> --- .../azure-mgmt-appcontainers/_meta.json | 10 +- .../mgmt/appcontainers/_configuration.py | 6 +- .../_container_apps_api_client.py | 21 +- .../mgmt/appcontainers/_serialization.py | 26 +- .../azure/mgmt/appcontainers/_vendor.py | 28 +- .../azure/mgmt/appcontainers/_version.py | 2 +- .../mgmt/appcontainers/aio/_configuration.py | 6 +- .../aio/_container_apps_api_client.py | 21 +- .../azure/mgmt/appcontainers/aio/_vendor.py | 28 ++ .../appcontainers/aio/operations/__init__.py | 10 +- ..._available_workload_profiles_operations.py | 1 + .../operations/_billing_meters_operations.py | 1 + .../operations/_certificates_operations.py | 6 +- ...ed_environments_certificates_operations.py | 6 +- ...environments_dapr_components_operations.py | 4 +- .../_connected_environments_operations.py | 6 +- ...nected_environments_storages_operations.py | 4 +- .../_container_apps_api_client_operations.py | 104 +++++ ..._container_apps_auth_configs_operations.py | 4 +- .../_container_apps_diagnostics_operations.py | 1 + .../operations/_container_apps_operations.py | 270 +++++++++++- ...ainer_apps_revision_replicas_operations.py | 1 + .../_container_apps_revisions_operations.py | 1 + ...ntainer_apps_source_controls_operations.py | 4 +- .../operations/_dapr_components_operations.py | 4 +- .../operations/_jobs_executions_operations.py | 3 +- .../aio/operations/_jobs_operations.py | 180 ++------ .../_managed_certificates_operations.py | 6 +- ...aged_environment_diagnostics_operations.py | 1 + ...ged_environments_diagnostics_operations.py | 1 + .../_managed_environments_operations.py | 6 +- ...anaged_environments_storages_operations.py | 4 +- .../aio/operations/_namespaces_operations.py | 4 +- .../aio/operations/_operations.py | 1 + .../mgmt/appcontainers/models/__init__.py | 20 + .../_container_apps_api_client_enums.py | 29 +- .../mgmt/appcontainers/models/_models_py3.py | 393 +++++++++++++++++- .../mgmt/appcontainers/operations/__init__.py | 10 +- ..._available_workload_profiles_operations.py | 6 +- .../operations/_billing_meters_operations.py | 6 +- .../operations/_certificates_operations.py | 27 +- ...ed_environments_certificates_operations.py | 27 +- ...environments_dapr_components_operations.py | 25 +- .../_connected_environments_operations.py | 35 +- ...nected_environments_storages_operations.py | 21 +- .../_container_apps_api_client_operations.py | 142 +++++++ ..._container_apps_auth_configs_operations.py | 21 +- .../_container_apps_diagnostics_operations.py | 22 +- .../operations/_container_apps_operations.py | 377 ++++++++++++++++- ...ainer_apps_revision_replicas_operations.py | 10 +- .../_container_apps_revisions_operations.py | 22 +- ...ntainer_apps_source_controls_operations.py | 21 +- .../operations/_dapr_components_operations.py | 25 +- .../operations/_jobs_executions_operations.py | 8 +- .../operations/_jobs_operations.py | 230 +++------- .../_managed_certificates_operations.py | 27 +- ...aged_environment_diagnostics_operations.py | 10 +- ...ged_environments_diagnostics_operations.py | 6 +- .../_managed_environments_operations.py | 41 +- ...anaged_environments_storages_operations.py | 21 +- .../operations/_namespaces_operations.py | 9 +- .../appcontainers/operations/_operations.py | 4 +- .../auth_configs_create_or_update.py | 2 +- .../generated_samples/auth_configs_delete.py | 5 +- .../generated_samples/auth_configs_get.py | 2 +- .../auth_configs_list_by_container.py | 2 +- .../available_workload_profiles_get.py | 2 +- .../generated_samples/billing_meters_get.py | 2 +- .../certificate_create_or_update.py | 2 +- .../generated_samples/certificate_delete.py | 5 +- .../generated_samples/certificate_get.py | 2 +- .../certificates_check_name_availability.py | 2 +- ...ertificates_list_by_managed_environment.py | 2 +- .../generated_samples/certificates_patch.py | 2 +- ...vironments_certificate_create_or_update.py | 2 +- ...nnected_environments_certificate_delete.py | 5 +- .../connected_environments_certificate_get.py | 2 +- ...ts_certificates_check_name_availability.py | 2 +- ...tificates_list_by_connected_environment.py | 2 +- ...nnected_environments_certificates_patch.py | 2 +- ...connected_environments_create_or_update.py | 2 +- ...nments_dapr_components_create_or_update.py | 2 +- ...ted_environments_dapr_components_delete.py | 5 +- ...nected_environments_dapr_components_get.py | 2 +- ...ected_environments_dapr_components_list.py | 2 +- ...vironments_dapr_components_list_secrets.py | 2 +- .../connected_environments_delete.py | 5 +- .../connected_environments_get.py | 2 +- ...ted_environments_list_by_resource_group.py | 2 +- ...ected_environments_list_by_subscription.py | 2 +- .../connected_environments_patch.py | 2 +- ..._environments_storages_create_or_update.py | 2 +- .../connected_environments_storages_delete.py | 5 +- .../connected_environments_storages_get.py | 2 +- .../connected_environments_storages_list.py | 2 +- .../container_apps_check_name_availability.py | 2 +- .../container_apps_create_or_update.py | 9 +- .../container_apps_delete.py | 5 +- .../container_apps_diagnostics_get.py | 2 +- .../container_apps_diagnostics_list.py | 2 +- .../generated_samples/container_apps_get.py | 2 +- .../container_apps_get_auth_token.py | 2 +- .../container_apps_list_by_resource_group.py | 2 +- .../container_apps_list_by_subscription.py | 2 +- ...ner_apps_list_custom_host_name_analysis.py | 2 +- .../container_apps_list_secrets.py | 2 +- ...tainer_apps_managed_by_create_or_update.py | 2 +- .../generated_samples/container_apps_patch.py | 9 +- .../generated_samples/container_apps_start.py | 41 ++ .../generated_samples/container_apps_stop.py | 41 ++ ...container_apps_tcp_app_create_or_update.py | 2 +- ...create_or_update_secret_store_component.py | 2 +- ...apr_components_create_or_update_secrets.py | 2 +- .../dapr_components_delete.py | 5 +- ...r_components_get_secret_store_component.py | 2 +- .../dapr_components_get_secrets.py | 2 +- .../generated_samples/dapr_components_list.py | 2 +- .../dapr_components_list_secrets.py | 2 +- .../generated_samples/job_createor_update.py | 82 ++++ .../job_createor_update_event_trigger.py | 80 ++++ .../generated_samples/job_delete.py | 5 +- .../generated_samples/job_execution_get.py | 42 ++ .../generated_samples/job_executions_get.py | 2 +- .../generated_samples/job_get.py | 2 +- .../generated_samples/job_list_secrets.py | 2 +- .../generated_samples/job_patch.py | 80 ++++ .../generated_samples/job_start.py | 20 +- .../generated_samples/job_stop_execution.py | 5 +- .../generated_samples/job_stop_multiple.py | 9 +- .../jobs_list_by_resource_group.py | 2 +- .../jobs_list_by_subscription.py | 2 +- .../managed_certificate_create_or_update.py | 2 +- .../managed_certificate_delete.py | 5 +- .../managed_certificate_get.py | 2 +- ...ertificates_list_by_managed_environment.py | 2 +- .../managed_certificates_patch.py | 2 +- .../managed_environment_diagnostics_get.py | 2 +- .../managed_environment_diagnostics_list.py | 2 +- .../managed_environments_create_or_update.py | 3 +- ...om_infrastructure_resource_group_create.py | 2 +- .../managed_environments_delete.py | 5 +- .../managed_environments_get.py | 2 +- .../managed_environments_get_auth_token.py | 2 +- ...ged_environments_list_by_resource_group.py | 2 +- ...naged_environments_list_by_subscription.py | 2 +- ...vironments_list_workload_profile_states.py | 2 +- .../managed_environments_patch.py | 2 +- ..._environments_storages_create_or_update.py | 2 +- .../managed_environments_storages_delete.py | 5 +- .../managed_environments_storages_get.py | 2 +- .../managed_environments_storages_list.py | 2 +- .../generated_samples/operations_list.py | 2 +- .../generated_samples/replicas_get.py | 2 +- .../generated_samples/replicas_list.py | 2 +- .../generated_samples/revisions_activate.py | 5 +- .../generated_samples/revisions_deactivate.py | 5 +- .../generated_samples/revisions_get.py | 2 +- .../generated_samples/revisions_list.py | 2 +- .../generated_samples/revisions_restart.py | 5 +- .../source_controls_create_or_update.py | 8 +- .../source_controls_delete.py | 5 +- .../generated_samples/source_controls_get.py | 2 +- .../source_controls_list_by_container.py | 2 +- 163 files changed, 2266 insertions(+), 763 deletions(-) create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index 4059fd27c549..1e105a442aec 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3c639105c011765893db51cbb0dda056e34dc994", + "commit": "5b51ccefb0ba7799bbeac5e5460d9eec84ce55fa", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.4.8", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/app/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py index 75609b27bee5..8c597d56b1c9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-11-01-preview") + api_version: str = kwargs.pop("api_version", "2023-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py index d80a4905ab57..a40beedb16fa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py @@ -23,6 +23,7 @@ ConnectedEnvironmentsDaprComponentsOperations, ConnectedEnvironmentsOperations, ConnectedEnvironmentsStoragesOperations, + ContainerAppsAPIClientOperationsMixin, ContainerAppsAuthConfigsOperations, ContainerAppsDiagnosticsOperations, ContainerAppsOperations, @@ -46,7 +47,9 @@ from azure.core.credentials import TokenCredential -class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ContainerAppsAPIClient( + ContainerAppsAPIClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """ContainerAppsAPIClient. :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations - :ivar jobs_executions: JobsExecutionsOperations operations - :vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations :vartype container_apps_revisions: azure.mgmt.appcontainers.operations.ContainerAppsRevisionsOperations @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.operations.ManagedEnvironmentsDiagnosticsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appcontainers.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations + :ivar jobs_executions: JobsExecutionsOperations operations + :vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: azure.mgmt.appcontainers.operations.ManagedEnvironmentsOperations @@ -118,8 +121,8 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -161,8 +164,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -179,6 +180,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py index 842ae727fbbc..4bae2292227b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # Treat the list aside, since we don't want to encode the div separator if data_type.startswith("["): internal_data_type = data_type[1:-1] - data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] - if not kwargs.get("skip_quote", False): - data = [quote(str(d), safe="") for d in data] - return str(self.serialize_iter(data, internal_data_type, **kwargs)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py index bd0df84f5319..7f8fe378e76c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py @@ -5,10 +5,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast +from abc import ABC +from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest +from ._configuration import ContainerAppsAPIClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from ._serialization import Deserializer, Serializer + def _convert_request(request, files=None): data = request.content if not files else None @@ -18,13 +27,10 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - # Need the cast, as for some reasons "split" is typed as list[str | Any] - formatted_components = cast(List[str], template.split("/")) - components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] - template = "/".join(components) +class ContainerAppsAPIClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: ContainerAppsAPIClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py index 5819b888fe6e..e5754a47ce68 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py index ae13a88ed4be..9047e10b128d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2022-11-01-preview") + api_version: str = kwargs.pop("api_version", "2023-05-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py index 1e1e15ce58eb..fc093b7cef63 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py @@ -23,6 +23,7 @@ ConnectedEnvironmentsDaprComponentsOperations, ConnectedEnvironmentsOperations, ConnectedEnvironmentsStoragesOperations, + ContainerAppsAPIClientOperationsMixin, ContainerAppsAuthConfigsOperations, ContainerAppsDiagnosticsOperations, ContainerAppsOperations, @@ -46,7 +47,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class ContainerAppsAPIClient( + ContainerAppsAPIClientOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """ContainerAppsAPIClient. :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.aio.operations.ContainerAppsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations - :ivar jobs_executions: JobsExecutionsOperations operations - :vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations :vartype container_apps_revisions: azure.mgmt.appcontainers.aio.operations.ContainerAppsRevisionsOperations @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsDiagnosticsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appcontainers.aio.operations.Operations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations + :ivar jobs_executions: JobsExecutionsOperations operations + :vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsOperations @@ -118,8 +121,8 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -161,8 +164,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -179,6 +180,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py new file mode 100644 index 000000000000..e2d7a96f702c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# 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 abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import ContainerAppsAPIClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class ContainerAppsAPIClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: ContainerAppsAPIClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py index 5fc2fc5c9aa4..839be84fdb2f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py @@ -14,14 +14,15 @@ from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations from ._container_apps_operations import ContainerAppsOperations -from ._jobs_operations import JobsOperations -from ._jobs_executions_operations import JobsExecutionsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._jobs_executions_operations import JobsExecutionsOperations +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations from ._managed_certificates_operations import ManagedCertificatesOperations @@ -43,14 +44,15 @@ "ConnectedEnvironmentsDaprComponentsOperations", "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", - "JobsOperations", - "JobsExecutionsOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", "Operations", + "JobsOperations", + "JobsExecutionsOperations", + "ContainerAppsAPIClientOperationsMixin", "ManagedEnvironmentsOperations", "CertificatesOperations", "ManagedCertificatesOperations", diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py index f3ff0c482d92..785fcd1d359b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py @@ -28,6 +28,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._available_workload_profiles_operations import build_get_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py index c45d389b528a..63da0d32f836 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py @@ -26,6 +26,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._billing_meters_operations import build_get_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py index 7e3b0ca468b6..b83461a40b75 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -35,6 +36,7 @@ build_list_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -338,7 +340,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: if certificate_envelope is not None: @@ -566,7 +568,7 @@ async def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: _json = self._serialize.body(certificate_envelope, "CertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py index 796ecd07b385..6b74364ff107 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -35,6 +36,7 @@ build_list_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -338,7 +340,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: if certificate_envelope is not None: @@ -566,7 +568,7 @@ async def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: _json = self._serialize.body(certificate_envelope, "CertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py index 6679b2d33557..6382d6dd4053 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -35,6 +36,7 @@ build_list_request, build_list_secrets_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -338,7 +340,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(dapr_component_envelope, (IO, bytes)): + if isinstance(dapr_component_envelope, (IOBase, bytes)): _content = dapr_component_envelope else: _json = self._serialize.body(dapr_component_envelope, "DaprComponent") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py index 76d13e823e39..2195628f2b39 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,6 +40,7 @@ build_list_by_subscription_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -331,7 +333,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ConnectedEnvironment") @@ -837,7 +839,7 @@ async def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py index dfc4de3e32c1..c13a226de5a2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -31,6 +32,7 @@ build_get_request, build_list_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -307,7 +309,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(storage_envelope, (IO, bytes)): + if isinstance(storage_envelope, (IOBase, bytes)): _content = storage_envelope else: _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py new file mode 100644 index 000000000000..e7644744068f --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py @@ -0,0 +1,104 @@ +# pylint: disable=too-many-lines +# 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, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._container_apps_api_client_operations import build_job_execution_request +from .._vendor import ContainerAppsAPIClientMixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ContainerAppsAPIClientOperationsMixin(ContainerAppsAPIClientMixinABC): + @distributed_trace_async + async def job_execution( + self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of a single job execution. + + Get details of a single job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + request = build_job_execution_request( + resource_group_name=resource_group_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.job_execution.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=_stream, **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) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}" + } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py index 4e45cf48bbdf..6a5c2a251391 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -34,6 +35,7 @@ build_get_request, build_list_by_container_app_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -337,7 +339,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(auth_config_envelope, (IO, bytes)): + if isinstance(auth_config_envelope, (IOBase, bytes)): _content = auth_config_envelope else: _json = self._serialize.body(auth_config_envelope, "AuthConfig") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py index d7e9897275f7..4e7510f48d1b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py @@ -35,6 +35,7 @@ build_list_detectors_request, build_list_revisions_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py index 2efeac6f6113..01e585fbba9d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -39,8 +40,11 @@ build_list_by_subscription_request, build_list_custom_host_name_analysis_request, build_list_secrets_request, + build_start_request, + build_stop_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -327,7 +331,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(container_app_envelope, (IO, bytes)): + if isinstance(container_app_envelope, (IOBase, bytes)): _content = container_app_envelope else: _json = self._serialize.body(container_app_envelope, "ContainerApp") @@ -684,7 +688,7 @@ async def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(container_app_envelope, (IO, bytes)): + if isinstance(container_app_envelope, (IOBase, bytes)): _content = container_app_envelope else: _json = self._serialize.body(container_app_envelope, "ContainerApp") @@ -1096,3 +1100,265 @@ async def get_auth_token( get_auth_token.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken" } + + async def _start_initial( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> Optional[_models.ContainerApp]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.ContainerApp]] = kwargs.pop("cls", None) + + request = build_start_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerApp", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start" + } + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerApp]: + """Start a container app. + + Start a container app. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_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 ContainerApp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerApp] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ContainerApp] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerApp", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start" + } + + async def _stop_initial( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> Optional[_models.ContainerApp]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.ContainerApp]] = kwargs.pop("cls", None) + + request = build_stop_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._stop_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerApp", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _stop_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop" + } + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ContainerApp]: + """Stop a container app. + + Stop a container app. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_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 ContainerApp or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerApp] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ContainerApp] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerApp", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop" + } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py index 9f914ddbfb36..c3a87d5b9019 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py @@ -29,6 +29,7 @@ build_get_replica_request, build_list_replicas_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py index ac0a56fdbad4..1dbcc9bba533 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py @@ -35,6 +35,7 @@ build_list_revisions_request, build_restart_revision_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py index e49dd63bbf3b..f2d3a0e60e1d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -36,6 +37,7 @@ build_get_request, build_list_by_container_app_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -250,7 +252,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(source_control_envelope, (IO, bytes)): + if isinstance(source_control_envelope, (IOBase, bytes)): _content = source_control_envelope else: _json = self._serialize.body(source_control_envelope, "SourceControl") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py index abfc0d275c5e..7949d0ab55bd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse @@ -35,6 +36,7 @@ build_list_request, build_list_secrets_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -338,7 +340,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(dapr_component_envelope, (IO, bytes)): + if isinstance(dapr_component_envelope, (IOBase, bytes)): _content = dapr_component_envelope else: _json = self._serialize.body(dapr_component_envelope, "DaprComponent") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py index 2225d5c506df..ec6e8e3a64ad 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py @@ -28,6 +28,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._jobs_executions_operations import build_list_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,7 +64,7 @@ def list( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param filter: The filter to apply on the operation. Default value is None. :type filter: str diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py index 52d368091b9a..7a01f30b7159 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -42,6 +43,7 @@ build_stop_multiple_executions_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -247,7 +249,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Job or the result of cls(response) @@ -324,7 +326,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_envelope, (IO, bytes)): + if isinstance(job_envelope, (IOBase, bytes)): _content = job_envelope else: _json = self._serialize.body(job_envelope, "Job") @@ -388,7 +390,7 @@ async def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.Job @@ -425,7 +427,7 @@ async def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO @@ -456,7 +458,7 @@ async def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Is either a Job type or a IO type. Required. @@ -588,7 +590,7 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_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. @@ -672,7 +674,7 @@ async def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_envelope, (IO, bytes)): + if isinstance(job_envelope, (IOBase, bytes)): _content = job_envelope else: _json = self._serialize.body(job_envelope, "JobPatchProperties") @@ -738,7 +740,7 @@ async def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties @@ -775,7 +777,7 @@ async def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO @@ -810,7 +812,7 @@ async def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Is either a JobPatchProperties type or a IO type. Required. @@ -879,7 +881,11 @@ def get_long_running_output(pipeline_response): } async def _start_initial( - self, resource_group_name: str, job_name: str, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any + self, + resource_group_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO]] = None, + **kwargs: Any ) -> Optional[_models.JobExecutionBase]: error_map = { 401: ClientAuthenticationError, @@ -899,10 +905,13 @@ async def _start_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(template, (IO, bytes)): + if isinstance(template, (IOBase, bytes)): _content = template else: - _json = self._serialize.body(template, "JobExecutionTemplate") + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None request = build_start_request( resource_group_name=resource_group_name, @@ -953,7 +962,7 @@ async def begin_start( self, resource_group_name: str, job_name: str, - template: _models.JobExecutionTemplate, + template: Optional[_models.JobExecutionTemplate] = None, *, content_type: str = "application/json", **kwargs: Any @@ -965,9 +974,9 @@ async def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Required. + :param template: Properties used to start a job execution. Default value is None. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -991,7 +1000,7 @@ async def begin_start( self, resource_group_name: str, job_name: str, - template: IO, + template: Optional[IO] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1003,9 +1012,9 @@ async def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Required. + :param template: Properties used to start a job execution. Default value is None. :type template: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -1026,7 +1035,11 @@ async def begin_start( @distributed_trace_async async def begin_start( - self, resource_group_name: str, job_name: str, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any + self, + resource_group_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO]] = None, + **kwargs: Any ) -> AsyncLROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1035,10 +1048,10 @@ async def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Is either a JobExecutionTemplate type - or a IO type. Required. + :param template: Properties used to start a job execution. Is either a JobExecutionTemplate + type or a IO type. Default value is None. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1170,7 +1183,7 @@ async def begin_stop_execution( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_execution_name: Job execution name. Required. :type job_execution_name: str @@ -1233,11 +1246,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- } async def _stop_multiple_executions_initial( - self, - resource_group_name: str, - job_name: str, - job_execution_name: Union[_models.JobExecutionNamesCollection, IO], - **kwargs: Any + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> Optional[_models.ContainerAppJobExecutions]: error_map = { 401: ClientAuthenticationError, @@ -1247,29 +1256,17 @@ async def _stop_multiple_executions_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ContainerAppJobExecutions]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_execution_name, (IO, bytes)): - _content = job_execution_name - else: - _json = self._serialize.body(job_execution_name, "JobExecutionNamesCollection") - request = build_stop_multiple_executions_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, template_url=self._stop_multiple_executions_initial.metadata["url"], headers=_headers, params=_params, @@ -1306,91 +1303,9 @@ async def _stop_multiple_executions_initial( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop" } - @overload - async def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: _models.JobExecutionNamesCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ContainerAppJobExecutions]: - """Terminates execution of a running container apps job. - - Terminates execution of a running container apps job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. - :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Required. - :type job_execution_name: ~azure.mgmt.appcontainers.models.JobExecutionNamesCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: 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 ContainerAppJobExecutions or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ContainerAppJobExecutions]: - """Terminates execution of a running container apps job. - - Terminates execution of a running container apps job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. - :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Required. - :type job_execution_name: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: 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 ContainerAppJobExecutions or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async async def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: Union[_models.JobExecutionNamesCollection, IO], - **kwargs: Any + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.ContainerAppJobExecutions]: """Terminates execution of a running container apps job. @@ -1399,14 +1314,8 @@ async def begin_stop_multiple_executions( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Is either a - JobExecutionNamesCollection type or a IO type. Required. - :type job_execution_name: ~azure.mgmt.appcontainers.models.JobExecutionNamesCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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 @@ -1421,11 +1330,10 @@ async def begin_stop_multiple_executions( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1434,9 +1342,7 @@ async def begin_stop_multiple_executions( raw_result = await self._stop_multiple_executions_initial( resource_group_name=resource_group_name, job_name=job_name, - job_execution_name=job_execution_name, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1482,7 +1388,7 @@ async def list_secrets( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobSecretsCollection or the result of cls(response) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py index c12f35c9f6bb..34dade0546d1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,6 +38,7 @@ build_list_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -158,7 +160,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(managed_certificate_envelope, (IO, bytes)): + if isinstance(managed_certificate_envelope, (IOBase, bytes)): _content = managed_certificate_envelope else: if managed_certificate_envelope is not None: @@ -568,7 +570,7 @@ async def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(managed_certificate_envelope, (IO, bytes)): + if isinstance(managed_certificate_envelope, (IOBase, bytes)): _content = managed_certificate_envelope else: _json = self._serialize.body(managed_certificate_envelope, "ManagedCertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py index e94b8e36bc30..0c728b1b93c4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py @@ -29,6 +29,7 @@ build_get_detector_request, build_list_detectors_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py index 2a96cef37577..f7e58e053d8b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py @@ -26,6 +26,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._managed_environments_diagnostics_operations import build_get_root_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py index f2c755446b55..1989e65081df 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -40,6 +41,7 @@ build_list_workload_profile_states_request, build_update_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -332,7 +334,7 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ManagedEnvironment") @@ -680,7 +682,7 @@ async def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ManagedEnvironment") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py index a175a7e4ef2b..dd51d8ccbccb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -31,6 +32,7 @@ build_get_request, build_list_request, ) +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -307,7 +309,7 @@ async def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(storage_envelope, (IO, bytes)): + if isinstance(storage_envelope, (IOBase, bytes)): _content = storage_envelope else: _json = self._serialize.body(storage_envelope, "ManagedEnvironmentStorage") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py index c8fe99420e73..1a0b6ed2c2d0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,6 +27,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._namespaces_operations import build_check_name_availability_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -158,7 +160,7 @@ async def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py index 99d2f1dfba6e..8b1098269102 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py @@ -28,6 +28,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request +from .._vendor import ContainerAppsAPIClientMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py index 8e6c5b0a8da7..0c785f1782aa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py @@ -109,6 +109,7 @@ from ._models_py3 import IpSecurityRestrictionRule from ._models_py3 import Job from ._models_py3 import JobConfiguration +from ._models_py3 import JobConfigurationEventTriggerConfig from ._models_py3 import JobConfigurationManualTriggerConfig from ._models_py3 import JobConfigurationScheduleTriggerConfig from ._models_py3 import JobExecution @@ -118,6 +119,8 @@ from ._models_py3 import JobExecutionTemplate from ._models_py3 import JobPatchProperties from ._models_py3 import JobPatchPropertiesProperties +from ._models_py3 import JobScale +from ._models_py3 import JobScaleRule from ._models_py3 import JobSecretsCollection from ._models_py3 import JobTemplate from ._models_py3 import JobsCollection @@ -132,11 +135,13 @@ from ._models_py3 import ManagedCertificatePatch from ._models_py3 import ManagedCertificateProperties from ._models_py3 import ManagedEnvironment +from ._models_py3 import ManagedEnvironmentPropertiesPeerAuthentication from ._models_py3 import ManagedEnvironmentStorage from ._models_py3 import ManagedEnvironmentStorageProperties from ._models_py3 import ManagedEnvironmentStoragesCollection from ._models_py3 import ManagedEnvironmentsCollection from ._models_py3 import ManagedServiceIdentity +from ._models_py3 import Mtls from ._models_py3 import Nonce from ._models_py3 import OpenIdConnectClientCredential from ._models_py3 import OpenIdConnectConfig @@ -160,6 +165,8 @@ from ._models_py3 import Secret from ._models_py3 import SecretVolumeItem from ._models_py3 import SecretsCollection +from ._models_py3 import Service +from ._models_py3 import ServiceBind from ._models_py3 import SourceControl from ._models_py3 import SourceControlCollection from ._models_py3 import SystemData @@ -188,7 +195,9 @@ from ._container_apps_api_client_enums import CertificateProvisioningState from ._container_apps_api_client_enums import CheckNameAvailabilityReason from ._container_apps_api_client_enums import ConnectedEnvironmentProvisioningState +from ._container_apps_api_client_enums import ContainerAppContainerRunningState from ._container_apps_api_client_enums import ContainerAppProvisioningState +from ._container_apps_api_client_enums import ContainerAppReplicaRunningState from ._container_apps_api_client_enums import CookieExpirationConvention from ._container_apps_api_client_enums import CreatedByType from ._container_apps_api_client_enums import DnsVerificationTestResult @@ -204,6 +213,7 @@ from ._container_apps_api_client_enums import ManagedServiceIdentityType from ._container_apps_api_client_enums import RevisionHealthState from ._container_apps_api_client_enums import RevisionProvisioningState +from ._container_apps_api_client_enums import RevisionRunningState from ._container_apps_api_client_enums import Scheme from ._container_apps_api_client_enums import SourceControlOperationState from ._container_apps_api_client_enums import StorageType @@ -318,6 +328,7 @@ "IpSecurityRestrictionRule", "Job", "JobConfiguration", + "JobConfigurationEventTriggerConfig", "JobConfigurationManualTriggerConfig", "JobConfigurationScheduleTriggerConfig", "JobExecution", @@ -327,6 +338,8 @@ "JobExecutionTemplate", "JobPatchProperties", "JobPatchPropertiesProperties", + "JobScale", + "JobScaleRule", "JobSecretsCollection", "JobTemplate", "JobsCollection", @@ -341,11 +354,13 @@ "ManagedCertificatePatch", "ManagedCertificateProperties", "ManagedEnvironment", + "ManagedEnvironmentPropertiesPeerAuthentication", "ManagedEnvironmentStorage", "ManagedEnvironmentStorageProperties", "ManagedEnvironmentStoragesCollection", "ManagedEnvironmentsCollection", "ManagedServiceIdentity", + "Mtls", "Nonce", "OpenIdConnectClientCredential", "OpenIdConnectConfig", @@ -369,6 +384,8 @@ "Secret", "SecretVolumeItem", "SecretsCollection", + "Service", + "ServiceBind", "SourceControl", "SourceControlCollection", "SystemData", @@ -396,7 +413,9 @@ "CertificateProvisioningState", "CheckNameAvailabilityReason", "ConnectedEnvironmentProvisioningState", + "ContainerAppContainerRunningState", "ContainerAppProvisioningState", + "ContainerAppReplicaRunningState", "CookieExpirationConvention", "CreatedByType", "DnsVerificationTestResult", @@ -412,6 +431,7 @@ "ManagedServiceIdentityType", "RevisionHealthState", "RevisionProvisioningState", + "RevisionRunningState", "Scheme", "SourceControlOperationState", "StorageType", diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py index 2edbcb242617..694a6932ba5d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py @@ -101,6 +101,14 @@ class ConnectedEnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitive SCHEDULED_FOR_DELETE = "ScheduledForDelete" +class ContainerAppContainerRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current running state of the container.""" + + RUNNING = "Running" + TERMINATED = "Terminated" + WAITING = "Waiting" + + class ContainerAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the Container App.""" @@ -111,6 +119,14 @@ class ContainerAppProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta DELETING = "Deleting" +class ContainerAppReplicaRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current running state of the replica.""" + + RUNNING = "Running" + NOT_RUNNING = "NotRunning" + UNKNOWN = "Unknown" + + class CookieExpirationConvention(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The convention used when determining the session cookie's expiration.""" @@ -254,6 +270,17 @@ class RevisionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEPROVISIONED = "Deprovisioned" +class RevisionRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Current running state of the revision.""" + + RUNNING = "Running" + PROCESSING = "Processing" + STOPPED = "Stopped" + DEGRADED = "Degraded" + FAILED = "Failed" + UNKNOWN = "Unknown" + + class Scheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Scheme to use for connecting to the host. Defaults to HTTP.""" @@ -281,7 +308,7 @@ class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Trigger type of the job.""" - SCHEDULED = "Scheduled" + SCHEDULE = "Schedule" EVENT = "Event" MANUAL = "Manual" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py index a9be26f8ccf1..4451f6940f93 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py @@ -150,9 +150,10 @@ def __init__( class AppLogsConfiguration(_serialization.Model): """Configuration of application logs. - :ivar destination: Logs destination. + :ivar destination: Logs destination, can be 'log-analytics', 'azure-monitor' or 'none'. :vartype destination: str - :ivar log_analytics_configuration: Log Analytics configuration. + :ivar log_analytics_configuration: Log Analytics configuration, must only be provided when + destination is configured as 'log-analytics'. :vartype log_analytics_configuration: ~azure.mgmt.appcontainers.models.LogAnalyticsConfiguration """ @@ -170,9 +171,10 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword destination: Logs destination. + :keyword destination: Logs destination, can be 'log-analytics', 'azure-monitor' or 'none'. :paramtype destination: str - :keyword log_analytics_configuration: Log Analytics configuration. + :keyword log_analytics_configuration: Log Analytics configuration, must only be provided when + destination is configured as 'log-analytics'. :paramtype log_analytics_configuration: ~azure.mgmt.appcontainers.models.LogAnalyticsConfiguration """ @@ -878,6 +880,8 @@ class AzureCredentials(_serialization.Model): :vartype client_secret: str :ivar tenant_id: Tenant Id. :vartype tenant_id: str + :ivar kind: Kind of auth github does for deploying the template. + :vartype kind: str :ivar subscription_id: Subscription Id. :vartype subscription_id: str """ @@ -886,6 +890,7 @@ class AzureCredentials(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, "client_secret": {"key": "clientSecret", "type": "str"}, "tenant_id": {"key": "tenantId", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, "subscription_id": {"key": "subscriptionId", "type": "str"}, } @@ -895,6 +900,7 @@ def __init__( client_id: Optional[str] = None, client_secret: Optional[str] = None, tenant_id: Optional[str] = None, + kind: Optional[str] = None, subscription_id: Optional[str] = None, **kwargs: Any ) -> None: @@ -905,6 +911,8 @@ def __init__( :paramtype client_secret: str :keyword tenant_id: Tenant Id. :paramtype tenant_id: str + :keyword kind: Kind of auth github does for deploying the template. + :paramtype kind: str :keyword subscription_id: Subscription Id. :paramtype subscription_id: str """ @@ -912,6 +920,7 @@ def __init__( self.client_id = client_id self.client_secret = client_secret self.tenant_id = tenant_id + self.kind = kind self.subscription_id = subscription_id @@ -1573,6 +1582,8 @@ class Configuration(_serialization.Model): :vartype dapr: ~azure.mgmt.appcontainers.models.Dapr :ivar max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :vartype max_inactive_revisions: int + :ivar service: Container App to be a dev Container App Service. + :vartype service: ~azure.mgmt.appcontainers.models.Service """ _attribute_map = { @@ -1582,6 +1593,7 @@ class Configuration(_serialization.Model): "registries": {"key": "registries", "type": "[RegistryCredentials]"}, "dapr": {"key": "dapr", "type": "Dapr"}, "max_inactive_revisions": {"key": "maxInactiveRevisions", "type": "int"}, + "service": {"key": "service", "type": "Service"}, } def __init__( @@ -1593,6 +1605,7 @@ def __init__( registries: Optional[List["_models.RegistryCredentials"]] = None, dapr: Optional["_models.Dapr"] = None, max_inactive_revisions: Optional[int] = None, + service: Optional["_models.Service"] = None, **kwargs: Any ) -> None: """ @@ -1617,6 +1630,8 @@ def __init__( :paramtype dapr: ~azure.mgmt.appcontainers.models.Dapr :keyword max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :paramtype max_inactive_revisions: int + :keyword service: Container App to be a dev Container App Service. + :paramtype service: ~azure.mgmt.appcontainers.models.Service """ super().__init__(**kwargs) self.secrets = secrets @@ -1625,6 +1640,7 @@ def __init__( self.registries = registries self.dapr = dapr self.max_inactive_revisions = max_inactive_revisions + self.service = service class ConnectedEnvironment(TrackedResource): # pylint: disable=too-many-instance-attributes @@ -4340,6 +4356,8 @@ class GithubActionConfiguration(_serialization.Model): :vartype azure_credentials: ~azure.mgmt.appcontainers.models.AzureCredentials :ivar context_path: Context path. :vartype context_path: str + :ivar github_personal_access_token: One time Github PAT to configure github environment. + :vartype github_personal_access_token: str :ivar image: Image name. :vartype image: str :ivar publish_type: Code or Image. @@ -4356,6 +4374,7 @@ class GithubActionConfiguration(_serialization.Model): "registry_info": {"key": "registryInfo", "type": "RegistryInfo"}, "azure_credentials": {"key": "azureCredentials", "type": "AzureCredentials"}, "context_path": {"key": "contextPath", "type": "str"}, + "github_personal_access_token": {"key": "githubPersonalAccessToken", "type": "str"}, "image": {"key": "image", "type": "str"}, "publish_type": {"key": "publishType", "type": "str"}, "os": {"key": "os", "type": "str"}, @@ -4369,6 +4388,7 @@ def __init__( registry_info: Optional["_models.RegistryInfo"] = None, azure_credentials: Optional["_models.AzureCredentials"] = None, context_path: Optional[str] = None, + github_personal_access_token: Optional[str] = None, image: Optional[str] = None, publish_type: Optional[str] = None, os: Optional[str] = None, @@ -4383,6 +4403,8 @@ def __init__( :paramtype azure_credentials: ~azure.mgmt.appcontainers.models.AzureCredentials :keyword context_path: Context path. :paramtype context_path: str + :keyword github_personal_access_token: One time Github PAT to configure github environment. + :paramtype github_personal_access_token: str :keyword image: Image name. :paramtype image: str :keyword publish_type: Code or Image. @@ -4398,6 +4420,7 @@ def __init__( self.registry_info = registry_info self.azure_credentials = azure_credentials self.context_path = context_path + self.github_personal_access_token = github_personal_access_token self.image = image self.publish_type = publish_type self.os = os @@ -5077,7 +5100,7 @@ class JobConfiguration(_serialization.Model): :ivar secrets: Collection of secrets used by a Container Apps Job. :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] - :ivar trigger_type: Trigger type of the job. Known values are: "Scheduled", "Event", and + :ivar trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and "Manual". :vartype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType :ivar replica_timeout: Maximum number of seconds a replica is allowed to run. Required. @@ -5092,6 +5115,9 @@ class JobConfiguration(_serialization.Model): cronjobs. Properties completions and parallelism would be set to 1 by default. :vartype schedule_trigger_config: ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig + :ivar event_trigger_config: Trigger configuration of an event driven job. + :vartype event_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig :ivar registries: Collection of private container registry credentials used by a Container apps job. :vartype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] @@ -5109,6 +5135,7 @@ class JobConfiguration(_serialization.Model): "replica_retry_limit": {"key": "replicaRetryLimit", "type": "int"}, "manual_trigger_config": {"key": "manualTriggerConfig", "type": "JobConfigurationManualTriggerConfig"}, "schedule_trigger_config": {"key": "scheduleTriggerConfig", "type": "JobConfigurationScheduleTriggerConfig"}, + "event_trigger_config": {"key": "eventTriggerConfig", "type": "JobConfigurationEventTriggerConfig"}, "registries": {"key": "registries", "type": "[RegistryCredentials]"}, } @@ -5121,13 +5148,14 @@ def __init__( replica_retry_limit: Optional[int] = None, manual_trigger_config: Optional["_models.JobConfigurationManualTriggerConfig"] = None, schedule_trigger_config: Optional["_models.JobConfigurationScheduleTriggerConfig"] = None, + event_trigger_config: Optional["_models.JobConfigurationEventTriggerConfig"] = None, registries: Optional[List["_models.RegistryCredentials"]] = None, **kwargs: Any ) -> None: """ :keyword secrets: Collection of secrets used by a Container Apps Job. :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] - :keyword trigger_type: Trigger type of the job. Known values are: "Scheduled", "Event", and + :keyword trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and "Manual". :paramtype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType :keyword replica_timeout: Maximum number of seconds a replica is allowed to run. Required. @@ -5142,6 +5170,9 @@ def __init__( cronjobs. Properties completions and parallelism would be set to 1 by default. :paramtype schedule_trigger_config: ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig + :keyword event_trigger_config: Trigger configuration of an event driven job. + :paramtype event_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig :keyword registries: Collection of private container registry credentials used by a Container apps job. :paramtype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] @@ -5153,9 +5184,51 @@ def __init__( self.replica_retry_limit = replica_retry_limit self.manual_trigger_config = manual_trigger_config self.schedule_trigger_config = schedule_trigger_config + self.event_trigger_config = event_trigger_config self.registries = registries +class JobConfigurationEventTriggerConfig(_serialization.Model): + """Trigger configuration of an event driven job. + + :ivar replica_completion_count: Minimum number of successful replica completions before overall + job completion. + :vartype replica_completion_count: int + :ivar parallelism: Number of parallel replicas of a job that can run at a given time. + :vartype parallelism: int + :ivar scale: Scaling configurations for event driven jobs. + :vartype scale: ~azure.mgmt.appcontainers.models.JobScale + """ + + _attribute_map = { + "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, + "parallelism": {"key": "parallelism", "type": "int"}, + "scale": {"key": "scale", "type": "JobScale"}, + } + + def __init__( + self, + *, + replica_completion_count: Optional[int] = None, + parallelism: Optional[int] = None, + scale: Optional["_models.JobScale"] = None, + **kwargs: Any + ) -> None: + """ + :keyword replica_completion_count: Minimum number of successful replica completions before + overall job completion. + :paramtype replica_completion_count: int + :keyword parallelism: Number of parallel replicas of a job that can run at a given time. + :paramtype parallelism: int + :keyword scale: Scaling configurations for event driven jobs. + :paramtype scale: ~azure.mgmt.appcontainers.models.JobScale + """ + super().__init__(**kwargs) + self.replica_completion_count = replica_completion_count + self.parallelism = parallelism + self.scale = scale + + class JobConfigurationManualTriggerConfig(_serialization.Model): """Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be set to 1 by default. @@ -5238,7 +5311,7 @@ def __init__( class JobExecution(_serialization.Model): - """Container Apps Jobs execution. + """Container Apps Job execution. Variables are only populated by the server, and will be ignored when sending a request. @@ -5253,7 +5326,7 @@ class JobExecution(_serialization.Model): :vartype status: str or ~azure.mgmt.appcontainers.models.JobExecutionRunningState :ivar start_time: Job execution start time. :vartype start_time: ~datetime.datetime - :ivar end_time: Job execution start time. + :ivar end_time: Job execution end time. :vartype end_time: ~datetime.datetime :ivar template: Job's execution container. :vartype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate @@ -5293,7 +5366,7 @@ def __init__( :paramtype type: str :keyword start_time: Job execution start time. :paramtype start_time: ~datetime.datetime - :keyword end_time: Job execution start time. + :keyword end_time: Job execution end time. :paramtype end_time: ~datetime.datetime :keyword template: Job's execution container. :paramtype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate @@ -5552,6 +5625,104 @@ def __init__( self.event_stream_endpoint = event_stream_endpoint +class JobScale(_serialization.Model): + """Scaling configurations for event driven jobs. + + :ivar polling_interval: Interval to check each event source in seconds. Defaults to 30s. + :vartype polling_interval: int + :ivar min_executions: Minimum number of job executions that are created for a trigger, default + 0. + :vartype min_executions: int + :ivar max_executions: Maximum number of job executions that are created for a trigger, default + 100. + :vartype max_executions: int + :ivar rules: Scaling rules. + :vartype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] + """ + + _attribute_map = { + "polling_interval": {"key": "pollingInterval", "type": "int"}, + "min_executions": {"key": "minExecutions", "type": "int"}, + "max_executions": {"key": "maxExecutions", "type": "int"}, + "rules": {"key": "rules", "type": "[JobScaleRule]"}, + } + + def __init__( + self, + *, + polling_interval: Optional[int] = None, + min_executions: int = 0, + max_executions: int = 100, + rules: Optional[List["_models.JobScaleRule"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword polling_interval: Interval to check each event source in seconds. Defaults to 30s. + :paramtype polling_interval: int + :keyword min_executions: Minimum number of job executions that are created for a trigger, + default 0. + :paramtype min_executions: int + :keyword max_executions: Maximum number of job executions that are created for a trigger, + default 100. + :paramtype max_executions: int + :keyword rules: Scaling rules. + :paramtype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] + """ + super().__init__(**kwargs) + self.polling_interval = polling_interval + self.min_executions = min_executions + self.max_executions = max_executions + self.rules = rules + + +class JobScaleRule(_serialization.Model): + """Scaling rule. + + :ivar name: Scale Rule Name. + :vartype name: str + :ivar type: Type of the scale rule + eg: azure-servicebus, redis etc. + :vartype type: str + :ivar metadata: Metadata properties to describe the scale rule. + :vartype metadata: JSON + :ivar auth: Authentication secrets for the scale rule. + :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "metadata": {"key": "metadata", "type": "object"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + metadata: Optional[JSON] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Scale Rule Name. + :paramtype name: str + :keyword type: Type of the scale rule + eg: azure-servicebus, redis etc. + :paramtype type: str + :keyword metadata: Metadata properties to describe the scale rule. + :paramtype metadata: JSON + :keyword auth: Authentication secrets for the scale rule. + :paramtype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + """ + super().__init__(**kwargs) + self.name = name + self.type = type + self.metadata = metadata + self.auth = auth + + class JobsCollection(_serialization.Model): """Container Apps Jobs collection ARM resource. @@ -5707,7 +5878,8 @@ def __init__(self, **kwargs: Any) -> None: class LogAnalyticsConfiguration(_serialization.Model): - """Log analytics configuration. + """Log Analytics configuration, must only be provided when destination is configured as + 'log-analytics'. :ivar customer_id: Log analytics customer id. :vartype customer_id: str @@ -6075,6 +6247,9 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. :vartype infrastructure_resource_group: str + :ivar peer_authentication: Peer authentication settings for the Managed Environment. + :vartype peer_authentication: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication """ _validation = { @@ -6116,6 +6291,10 @@ class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance- "keda_configuration": {"key": "properties.kedaConfiguration", "type": "KedaConfiguration"}, "dapr_configuration": {"key": "properties.daprConfiguration", "type": "DaprConfiguration"}, "infrastructure_resource_group": {"key": "properties.infrastructureResourceGroup", "type": "str"}, + "peer_authentication": { + "key": "properties.peerAuthentication", + "type": "ManagedEnvironmentPropertiesPeerAuthentication", + }, } def __init__( @@ -6134,6 +6313,7 @@ def __init__( keda_configuration: Optional["_models.KedaConfiguration"] = None, dapr_configuration: Optional["_models.DaprConfiguration"] = None, infrastructure_resource_group: Optional[str] = None, + peer_authentication: Optional["_models.ManagedEnvironmentPropertiesPeerAuthentication"] = None, **kwargs: Any ) -> None: """ @@ -6170,6 +6350,9 @@ def __init__( the Managed Environment to host infrastructure resources. If a subnet ID is provided, this resource group will be created in the same subscription as the subnet. :paramtype infrastructure_resource_group: str + :keyword peer_authentication: Peer authentication settings for the Managed Environment. + :paramtype peer_authentication: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication """ super().__init__(tags=tags, location=location, **kwargs) self.kind = kind @@ -6188,6 +6371,27 @@ def __init__( self.keda_configuration = keda_configuration self.dapr_configuration = dapr_configuration self.infrastructure_resource_group = infrastructure_resource_group + self.peer_authentication = peer_authentication + + +class ManagedEnvironmentPropertiesPeerAuthentication(_serialization.Model): + """Peer authentication settings for the Managed Environment. + + :ivar mtls: Mutual TLS authentication settings for the Managed Environment. + :vartype mtls: ~azure.mgmt.appcontainers.models.Mtls + """ + + _attribute_map = { + "mtls": {"key": "mtls", "type": "Mtls"}, + } + + def __init__(self, *, mtls: Optional["_models.Mtls"] = None, **kwargs: Any) -> None: + """ + :keyword mtls: Mutual TLS authentication settings for the Managed Environment. + :paramtype mtls: ~azure.mgmt.appcontainers.models.Mtls + """ + super().__init__(**kwargs) + self.mtls = mtls class ManagedEnvironmentsCollection(_serialization.Model): @@ -6379,6 +6583,26 @@ def __init__( self.user_assigned_identities = user_assigned_identities +class Mtls(_serialization.Model): + """Configuration properties for mutual TLS authentication. + + :ivar enabled: Boolean indicating whether the mutual TLS authentication is enabled. + :vartype enabled: bool + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: + """ + :keyword enabled: Boolean indicating whether the mutual TLS authentication is enabled. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + class Nonce(_serialization.Model): """The configuration settings of the nonce used in the login flow. @@ -6811,8 +7035,15 @@ class Replica(ProxyResource): :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData :ivar created_time: Timestamp describing when the pod was created by controller. :vartype created_time: ~datetime.datetime + :ivar running_state: Current running state of the replica. Known values are: "Running", + "NotRunning", and "Unknown". + :vartype running_state: str or ~azure.mgmt.appcontainers.models.ContainerAppReplicaRunningState + :ivar running_state_details: The details of replica current running state. + :vartype running_state_details: str :ivar containers: The containers collection under a replica. :vartype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :ivar init_containers: The init containers collection under a replica. + :vartype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] """ _validation = { @@ -6821,6 +7052,8 @@ class Replica(ProxyResource): "type": {"readonly": True}, "system_data": {"readonly": True}, "created_time": {"readonly": True}, + "running_state": {"readonly": True}, + "running_state_details": {"readonly": True}, } _attribute_map = { @@ -6829,17 +7062,31 @@ class Replica(ProxyResource): "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "running_state": {"key": "properties.runningState", "type": "str"}, + "running_state_details": {"key": "properties.runningStateDetails", "type": "str"}, "containers": {"key": "properties.containers", "type": "[ReplicaContainer]"}, + "init_containers": {"key": "properties.initContainers", "type": "[ReplicaContainer]"}, } - def __init__(self, *, containers: Optional[List["_models.ReplicaContainer"]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + containers: Optional[List["_models.ReplicaContainer"]] = None, + init_containers: Optional[List["_models.ReplicaContainer"]] = None, + **kwargs: Any + ) -> None: """ :keyword containers: The containers collection under a replica. :paramtype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :keyword init_containers: The init containers collection under a replica. + :paramtype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] """ super().__init__(**kwargs) self.created_time = None + self.running_state = None + self.running_state_details = None self.containers = containers + self.init_containers = init_containers class ReplicaCollection(_serialization.Model): @@ -6883,6 +7130,12 @@ class ReplicaContainer(_serialization.Model): :vartype started: bool :ivar restart_count: The container restart count. :vartype restart_count: int + :ivar running_state: Current running state of the container. Known values are: "Running", + "Terminated", and "Waiting". + :vartype running_state: str or + ~azure.mgmt.appcontainers.models.ContainerAppContainerRunningState + :ivar running_state_details: The details of container current running state. + :vartype running_state_details: str :ivar log_stream_endpoint: Log Stream endpoint. :vartype log_stream_endpoint: str :ivar exec_endpoint: Container exec endpoint. @@ -6890,6 +7143,8 @@ class ReplicaContainer(_serialization.Model): """ _validation = { + "running_state": {"readonly": True}, + "running_state_details": {"readonly": True}, "log_stream_endpoint": {"readonly": True}, "exec_endpoint": {"readonly": True}, } @@ -6900,6 +7155,8 @@ class ReplicaContainer(_serialization.Model): "ready": {"key": "ready", "type": "bool"}, "started": {"key": "started", "type": "bool"}, "restart_count": {"key": "restartCount", "type": "int"}, + "running_state": {"key": "runningState", "type": "str"}, + "running_state_details": {"key": "runningStateDetails", "type": "str"}, "log_stream_endpoint": {"key": "logStreamEndpoint", "type": "str"}, "exec_endpoint": {"key": "execEndpoint", "type": "str"}, } @@ -6932,6 +7189,8 @@ def __init__( self.ready = ready self.started = started self.restart_count = restart_count + self.running_state = None + self.running_state_details = None self.log_stream_endpoint = None self.exec_endpoint = None @@ -6978,6 +7237,9 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes :ivar provisioning_state: Current provisioning State of the revision. Known values are: "Provisioning", "Provisioned", "Failed", "Deprovisioning", and "Deprovisioned". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.RevisionProvisioningState + :ivar running_state: Current running state of the revision. Known values are: "Running", + "Processing", "Stopped", "Degraded", "Failed", and "Unknown". + :vartype running_state: str or ~azure.mgmt.appcontainers.models.RevisionRunningState """ _validation = { @@ -6995,6 +7257,7 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes "provisioning_error": {"readonly": True}, "health_state": {"readonly": True}, "provisioning_state": {"readonly": True}, + "running_state": {"readonly": True}, } _attribute_map = { @@ -7012,6 +7275,7 @@ class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes "provisioning_error": {"key": "properties.provisioningError", "type": "str"}, "health_state": {"key": "properties.healthState", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "running_state": {"key": "properties.runningState", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -7027,6 +7291,7 @@ def __init__(self, **kwargs: Any) -> None: self.provisioning_error = None self.health_state = None self.provisioning_state = None + self.running_state = None class RevisionCollection(_serialization.Model): @@ -7156,9 +7421,9 @@ def __init__( class ScaleRuleAuth(_serialization.Model): - """Auth Secrets for Container App Scale Rule. + """Auth Secrets for Scale Rule. - :ivar secret_ref: Name of the Container App secret from which to pull the auth params. + :ivar secret_ref: Name of the secret from which to pull the auth params. :vartype secret_ref: str :ivar trigger_parameter: Trigger Parameter that uses the secret. :vartype trigger_parameter: str @@ -7173,7 +7438,7 @@ def __init__( self, *, secret_ref: Optional[str] = None, trigger_parameter: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword secret_ref: Name of the Container App secret from which to pull the auth params. + :keyword secret_ref: Name of the secret from which to pull the auth params. :paramtype secret_ref: str :keyword trigger_parameter: Trigger Parameter that uses the secret. :paramtype trigger_parameter: str @@ -7287,6 +7552,58 @@ def __init__(self, *, secret_ref: Optional[str] = None, path: Optional[str] = No self.path = path +class Service(_serialization.Model): + """Container App to be a dev service. + + All required parameters must be populated in order to send to Azure. + + :ivar type: Dev ContainerApp service type. Required. + :vartype type: str + """ + + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type: str, **kwargs: Any) -> None: + """ + :keyword type: Dev ContainerApp service type. Required. + :paramtype type: str + """ + super().__init__(**kwargs) + self.type = type + + +class ServiceBind(_serialization.Model): + """Configuration to bind a ContainerApp to a dev ContainerApp Service. + + :ivar service_id: Resource id of the target service. + :vartype service_id: str + :ivar name: Name of the service bind. + :vartype name: str + """ + + _attribute_map = { + "service_id": {"key": "serviceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, service_id: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword service_id: Resource id of the target service. + :paramtype service_id: str + :keyword name: Name of the service bind. + :paramtype name: str + """ + super().__init__(**kwargs) + self.service_id = service_id + self.name = name + + class SourceControl(ProxyResource): """Container App SourceControl. @@ -7503,6 +7820,12 @@ class Template(_serialization.Model): :ivar revision_suffix: User friendly suffix that is appended to the revision name. :vartype revision_suffix: str + :ivar termination_grace_period_seconds: Optional duration in seconds the Container App Instance + needs to terminate gracefully. Value must be non-negative integer. The value zero indicates + stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the + default grace period will be used instead. Set this value longer than the expected cleanup time + for your process. Defaults to 30 seconds. + :vartype termination_grace_period_seconds: int :ivar init_containers: List of specialized containers that run before app containers. :vartype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] :ivar containers: List of container definitions for the Container App. @@ -7511,29 +7834,41 @@ class Template(_serialization.Model): :vartype scale: ~azure.mgmt.appcontainers.models.Scale :ivar volumes: List of volume definitions for the Container App. :vartype volumes: list[~azure.mgmt.appcontainers.models.Volume] + :ivar service_binds: List of container app services bound to the app. + :vartype service_binds: list[~azure.mgmt.appcontainers.models.ServiceBind] """ _attribute_map = { "revision_suffix": {"key": "revisionSuffix", "type": "str"}, + "termination_grace_period_seconds": {"key": "terminationGracePeriodSeconds", "type": "int"}, "init_containers": {"key": "initContainers", "type": "[InitContainer]"}, "containers": {"key": "containers", "type": "[Container]"}, "scale": {"key": "scale", "type": "Scale"}, "volumes": {"key": "volumes", "type": "[Volume]"}, + "service_binds": {"key": "serviceBinds", "type": "[ServiceBind]"}, } def __init__( self, *, revision_suffix: Optional[str] = None, + termination_grace_period_seconds: Optional[int] = None, init_containers: Optional[List["_models.InitContainer"]] = None, containers: Optional[List["_models.Container"]] = None, scale: Optional["_models.Scale"] = None, volumes: Optional[List["_models.Volume"]] = None, + service_binds: Optional[List["_models.ServiceBind"]] = None, **kwargs: Any ) -> None: """ :keyword revision_suffix: User friendly suffix that is appended to the revision name. :paramtype revision_suffix: str + :keyword termination_grace_period_seconds: Optional duration in seconds the Container App + Instance needs to terminate gracefully. Value must be non-negative integer. The value zero + indicates stop immediately via the kill signal (no opportunity to shut down). If this value is + nil, the default grace period will be used instead. Set this value longer than the expected + cleanup time for your process. Defaults to 30 seconds. + :paramtype termination_grace_period_seconds: int :keyword init_containers: List of specialized containers that run before app containers. :paramtype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] :keyword containers: List of container definitions for the Container App. @@ -7542,13 +7877,17 @@ def __init__( :paramtype scale: ~azure.mgmt.appcontainers.models.Scale :keyword volumes: List of volume definitions for the Container App. :paramtype volumes: list[~azure.mgmt.appcontainers.models.Volume] + :keyword service_binds: List of container app services bound to the app. + :paramtype service_binds: list[~azure.mgmt.appcontainers.models.ServiceBind] """ super().__init__(**kwargs) self.revision_suffix = revision_suffix + self.termination_grace_period_seconds = termination_grace_period_seconds self.init_containers = init_containers self.containers = containers self.scale = scale self.volumes = volumes + self.service_binds = service_binds class TrafficWeight(_serialization.Model): @@ -7776,6 +8115,9 @@ class Volume(_serialization.Model): :ivar secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :vartype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] + :ivar mount_options: Mount options used while mounting the AzureFile. Must be a comma-separated + string. + :vartype mount_options: str """ _attribute_map = { @@ -7783,6 +8125,7 @@ class Volume(_serialization.Model): "storage_type": {"key": "storageType", "type": "str"}, "storage_name": {"key": "storageName", "type": "str"}, "secrets": {"key": "secrets", "type": "[SecretVolumeItem]"}, + "mount_options": {"key": "mountOptions", "type": "str"}, } def __init__( @@ -7792,6 +8135,7 @@ def __init__( storage_type: Optional[Union[str, "_models.StorageType"]] = None, storage_name: Optional[str] = None, secrets: Optional[List["_models.SecretVolumeItem"]] = None, + mount_options: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -7805,12 +8149,16 @@ def __init__( :keyword secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :paramtype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] + :keyword mount_options: Mount options used while mounting the AzureFile. Must be a + comma-separated string. + :paramtype mount_options: str """ super().__init__(**kwargs) self.name = name self.storage_type = storage_type self.storage_name = storage_name self.secrets = secrets + self.mount_options = mount_options class VolumeMount(_serialization.Model): @@ -7821,24 +8169,39 @@ class VolumeMount(_serialization.Model): :ivar mount_path: Path within the container at which the volume should be mounted.Must not contain ':'. :vartype mount_path: str + :ivar sub_path: Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). + :vartype sub_path: str """ _attribute_map = { "volume_name": {"key": "volumeName", "type": "str"}, "mount_path": {"key": "mountPath", "type": "str"}, + "sub_path": {"key": "subPath", "type": "str"}, } - def __init__(self, *, volume_name: Optional[str] = None, mount_path: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + volume_name: Optional[str] = None, + mount_path: Optional[str] = None, + sub_path: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword volume_name: This must match the Name of a Volume. :paramtype volume_name: str :keyword mount_path: Path within the container at which the volume should be mounted.Must not contain ':'. :paramtype mount_path: str + :keyword sub_path: Path within the volume from which the container's volume should be mounted. + Defaults to "" (volume's root). + :paramtype sub_path: str """ super().__init__(**kwargs) self.volume_name = volume_name self.mount_path = mount_path + self.sub_path = sub_path class WorkloadProfile(_serialization.Model): diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py index 5fc2fc5c9aa4..839be84fdb2f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py @@ -14,14 +14,15 @@ from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations from ._container_apps_operations import ContainerAppsOperations -from ._jobs_operations import JobsOperations -from ._jobs_executions_operations import JobsExecutionsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations from ._operations import Operations +from ._jobs_operations import JobsOperations +from ._jobs_executions_operations import JobsExecutionsOperations +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations from ._managed_certificates_operations import ManagedCertificatesOperations @@ -43,14 +44,15 @@ "ConnectedEnvironmentsDaprComponentsOperations", "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", - "JobsOperations", - "JobsExecutionsOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", "Operations", + "JobsOperations", + "JobsExecutionsOperations", + "ContainerAppsAPIClientOperationsMixin", "ManagedEnvironmentsOperations", "CertificatesOperations", "ManagedCertificatesOperations", diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py index 11e2e26d1e44..a4512d46ae92 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +53,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py index dcd748db4c33..c14efc555e25 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +38,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -50,7 +50,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "location": _SERIALIZER.url("location", location, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py index ecf0b07ef59b..27f61a142e07 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +59,7 @@ def build_list_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +93,7 @@ def build_get_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +128,7 @@ def build_create_or_update_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +164,7 @@ def build_delete_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,7 +181,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -198,7 +199,7 @@ def build_update_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -507,7 +508,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: if certificate_envelope is not None: @@ -735,7 +736,7 @@ def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: _json = self._serialize.body(certificate_envelope, "CertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py index bd975a1f8b4d..62a998e48a9b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +59,7 @@ def build_list_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +97,7 @@ def build_get_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,7 +118,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -135,7 +136,7 @@ def build_create_or_update_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,7 +159,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +176,7 @@ def build_delete_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,7 +197,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +215,7 @@ def build_update_request( "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -525,7 +526,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: if certificate_envelope is not None: @@ -753,7 +754,7 @@ def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(certificate_envelope, (IO, bytes)): + if isinstance(certificate_envelope, (IOBase, bytes)): _content = certificate_envelope else: _json = self._serialize.body(certificate_envelope, "CertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py index e7486c67d20c..231c1e56afd3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +59,7 @@ def build_list_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +93,7 @@ def build_get_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +128,7 @@ def build_create_or_update_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +164,7 @@ def build_delete_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,7 +181,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +198,7 @@ def build_list_secrets_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -506,7 +507,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(dapr_component_envelope, (IO, bytes)): + if isinstance(dapr_component_envelope, (IOBase, bytes)): _content = dapr_component_envelope else: _json = self._serialize.body(dapr_component_envelope, "DaprComponent") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py index 3dd7eb1df7ea..df60ba17c572 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -66,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +115,7 @@ def build_get_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,7 +149,7 @@ def build_create_or_update_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,7 +168,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +184,7 @@ def build_delete_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -200,7 +201,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +217,7 @@ def build_update_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -233,7 +234,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +251,7 @@ def build_check_name_availability_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -548,7 +549,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ConnectedEnvironment") @@ -1048,7 +1049,7 @@ def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py index 24aef4a0e09b..137b91f69a70 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +41,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +57,7 @@ def build_list_request( "connectedEnvironmentName": _SERIALIZER.url("connected_environment_name", connected_environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +74,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +91,7 @@ def build_get_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +108,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +126,7 @@ def build_create_or_update_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,7 +145,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +162,7 @@ def build_delete_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -443,7 +444,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(storage_envelope, (IO, bytes)): + if isinstance(storage_envelope, (IOBase, bytes)): _content = storage_envelope else: _json = self._serialize.body(storage_envelope, "ConnectedEnvironmentStorage") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py new file mode 100644 index 000000000000..32fc8b154350 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py @@ -0,0 +1,142 @@ +# pylint: disable=too-many-lines +# 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, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._serialization import Serializer +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_job_execution_request( + resource_group_name: str, job_name: str, job_execution_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), + "jobExecutionName": _SERIALIZER.url( + "job_execution_name", job_execution_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ContainerAppsAPIClientOperationsMixin(ContainerAppsAPIClientMixinABC): + @distributed_trace + def job_execution( + self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any + ) -> _models.JobExecution: + """Get details of a single job execution. + + Get details of a single job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.appcontainers.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + request = build_job_execution_request( + resource_group_name=resource_group_name, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.job_execution.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **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) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + job_execution.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}" + } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py index 02579714750a..4d5a8ba42b0b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +59,7 @@ def build_list_by_container_app_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +93,7 @@ def build_get_request( "authConfigName": _SERIALIZER.url("auth_config_name", auth_config_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +128,7 @@ def build_create_or_update_request( "authConfigName": _SERIALIZER.url("auth_config_name", auth_config_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +164,7 @@ def build_delete_request( "authConfigName": _SERIALIZER.url("auth_config_name", auth_config_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -472,7 +473,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(auth_config_envelope, (IO, bytes)): + if isinstance(auth_config_envelope, (IOBase, bytes)): _content = auth_config_envelope else: _json = self._serialize.body(auth_config_envelope, "AuthConfig") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py index 0303e28aa0d4..c0b74244ccaa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +42,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_detectors_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,7 +75,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_detector_request( "detectorName": _SERIALIZER.url("detector_name", detector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +114,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +130,7 @@ def build_list_revisions_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,7 +149,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +166,7 @@ def build_get_revision_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -183,7 +183,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -199,7 +199,7 @@ def build_get_root_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py index 9e41e38dbe9e..c34634c1b3c5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -66,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +115,7 @@ def build_get_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,7 +149,7 @@ def build_create_or_update_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,7 +168,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +184,7 @@ def build_delete_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -200,7 +201,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -217,7 +218,7 @@ def build_update_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,7 +231,7 @@ def build_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-long +def build_list_custom_host_name_analysis_request( resource_group_name: str, container_app_name: str, subscription_id: str, @@ -241,7 +242,7 @@ def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -257,7 +258,7 @@ def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-lo "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if custom_hostname is not None: @@ -276,7 +277,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +293,7 @@ def build_list_secrets_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -309,7 +310,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -325,7 +326,77 @@ def build_get_auth_token_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_request( + resource_group_name: str, container_app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "containerAppName": _SERIALIZER.url( + "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_request( + resource_group_name: str, container_app_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "containerAppName": _SERIALIZER.url( + "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -617,7 +688,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(container_app_envelope, (IO, bytes)): + if isinstance(container_app_envelope, (IOBase, bytes)): _content = container_app_envelope else: _json = self._serialize.body(container_app_envelope, "ContainerApp") @@ -971,7 +1042,7 @@ def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(container_app_envelope, (IO, bytes)): + if isinstance(container_app_envelope, (IOBase, bytes)): _content = container_app_envelope else: _json = self._serialize.body(container_app_envelope, "ContainerApp") @@ -1383,3 +1454,265 @@ def get_auth_token( get_auth_token.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken" } + + def _start_initial( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> Optional[_models.ContainerApp]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.ContainerApp]] = kwargs.pop("cls", None) + + request = build_start_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._start_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerApp", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _start_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start" + } + + @distributed_trace + def begin_start( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> LROPoller[_models.ContainerApp]: + """Start a container app. + + Start a container app. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_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 ContainerApp or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerApp] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ContainerApp] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerApp", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_start.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start" + } + + def _stop_initial( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> Optional[_models.ContainerApp]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Optional[_models.ContainerApp]] = kwargs.pop("cls", None) + + request = build_stop_request( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._stop_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ContainerApp", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _stop_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop" + } + + @distributed_trace + def begin_stop( + self, resource_group_name: str, container_app_name: str, **kwargs: Any + ) -> LROPoller[_models.ContainerApp]: + """Stop a container app. + + Stop a container app. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param container_app_name: Name of the Container App. Required. + :type container_app_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 ContainerApp or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerApp] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ContainerApp] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + container_app_name=container_app_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ContainerApp", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_stop.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop" + } diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py index 083d4b07acac..07d96073dab9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,7 @@ def build_get_replica_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_get_replica_request( "replicaName": _SERIALIZER.url("replica_name", replica_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +80,7 @@ def build_list_replicas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_replicas_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py index 9ae4e226a207..f3b824f57146 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +63,7 @@ def build_list_revisions_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +82,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,7 +99,7 @@ def build_get_revision_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +116,7 @@ def build_activate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_activate_revision_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,7 +150,7 @@ def build_deactivate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +167,7 @@ def build_deactivate_revision_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,7 +184,7 @@ def build_restart_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -201,7 +201,7 @@ def build_restart_revision_request( "revisionName": _SERIALIZER.url("revision_name", revision_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py index 715633b761f0..b63b5e798db5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +45,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +61,7 @@ def build_list_by_container_app_request( "containerAppName": _SERIALIZER.url("container_app_name", container_app_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -77,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +95,7 @@ def build_get_request( "sourceControlName": _SERIALIZER.url("source_control_name", source_control_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -111,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -129,7 +130,7 @@ def build_create_or_update_request( "sourceControlName": _SERIALIZER.url("source_control_name", source_control_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -148,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -165,7 +166,7 @@ def build_delete_request( "sourceControlName": _SERIALIZER.url("source_control_name", source_control_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -385,7 +386,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(source_control_envelope, (IO, bytes)): + if isinstance(source_control_envelope, (IOBase, bytes)): _content = source_control_envelope else: _json = self._serialize.body(source_control_envelope, "SourceControl") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py index c14821467fb7..13bdf064e305 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse @@ -27,7 +28,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +59,7 @@ def build_list_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -75,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +93,7 @@ def build_get_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -109,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +128,7 @@ def build_create_or_update_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -146,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +164,7 @@ def build_delete_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,7 +181,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +198,7 @@ def build_list_secrets_request( "componentName": _SERIALIZER.url("component_name", component_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -504,7 +505,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(dapr_component_envelope, (IO, bytes)): + if isinstance(dapr_component_envelope, (IOBase, bytes)): _content = dapr_component_envelope else: _json = self._serialize.body(dapr_component_envelope, "DaprComponent") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py index fa1a89634dad..8fb796cc10bb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +42,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -58,7 +58,7 @@ def build_list_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -101,7 +101,7 @@ def list( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param filter: The filter to apply on the operation. Default value is None. :type filter: str diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py index b35271391722..8c365448a72c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -66,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -96,7 +97,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +113,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,7 +130,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,10 +144,10 @@ def build_create_or_update_request( "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,7 +164,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -176,10 +177,10 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -194,7 +195,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -208,10 +209,10 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -228,7 +229,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -245,7 +246,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -264,7 +265,7 @@ def build_stop_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -283,7 +284,7 @@ def build_stop_execution_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -300,8 +301,7 @@ def build_stop_multiple_executions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -317,14 +317,12 @@ def build_stop_multiple_executions_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -336,7 +334,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -352,7 +350,7 @@ def build_list_secrets_request( "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -563,7 +561,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Job or the result of cls(response) @@ -640,7 +638,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_envelope, (IO, bytes)): + if isinstance(job_envelope, (IOBase, bytes)): _content = job_envelope else: _json = self._serialize.body(job_envelope, "Job") @@ -704,7 +702,7 @@ def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.Job @@ -741,7 +739,7 @@ def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO @@ -772,7 +770,7 @@ def begin_create_or_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Is either a Job type or a IO type. Required. @@ -903,7 +901,7 @@ def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_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. @@ -987,7 +985,7 @@ def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(job_envelope, (IO, bytes)): + if isinstance(job_envelope, (IOBase, bytes)): _content = job_envelope else: _json = self._serialize.body(job_envelope, "JobPatchProperties") @@ -1053,7 +1051,7 @@ def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties @@ -1090,7 +1088,7 @@ def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO @@ -1125,7 +1123,7 @@ def begin_update( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_envelope: Properties used to create a container apps job. Is either a JobPatchProperties type or a IO type. Required. @@ -1194,7 +1192,11 @@ def get_long_running_output(pipeline_response): } def _start_initial( - self, resource_group_name: str, job_name: str, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any + self, + resource_group_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO]] = None, + **kwargs: Any ) -> Optional[_models.JobExecutionBase]: error_map = { 401: ClientAuthenticationError, @@ -1214,10 +1216,13 @@ def _start_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(template, (IO, bytes)): + if isinstance(template, (IOBase, bytes)): _content = template else: - _json = self._serialize.body(template, "JobExecutionTemplate") + if template is not None: + _json = self._serialize.body(template, "JobExecutionTemplate") + else: + _json = None request = build_start_request( resource_group_name=resource_group_name, @@ -1268,7 +1273,7 @@ def begin_start( self, resource_group_name: str, job_name: str, - template: _models.JobExecutionTemplate, + template: Optional[_models.JobExecutionTemplate] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1280,9 +1285,9 @@ def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Required. + :param template: Properties used to start a job execution. Default value is None. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". @@ -1306,7 +1311,7 @@ def begin_start( self, resource_group_name: str, job_name: str, - template: IO, + template: Optional[IO] = None, *, content_type: str = "application/json", **kwargs: Any @@ -1318,9 +1323,9 @@ def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Required. + :param template: Properties used to start a job execution. Default value is None. :type template: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -1341,7 +1346,11 @@ def begin_start( @distributed_trace def begin_start( - self, resource_group_name: str, job_name: str, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any + self, + resource_group_name: str, + job_name: str, + template: Optional[Union[_models.JobExecutionTemplate, IO]] = None, + **kwargs: Any ) -> LROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1350,10 +1359,10 @@ def begin_start( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param template: Properties used to start a job instance. Is either a JobExecutionTemplate type - or a IO type. Required. + :param template: Properties used to start a job execution. Is either a JobExecutionTemplate + type or a IO type. Default value is None. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -1485,7 +1494,7 @@ def begin_stop_execution( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :param job_execution_name: Job execution name. Required. :type job_execution_name: str @@ -1548,11 +1557,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- } def _stop_multiple_executions_initial( - self, - resource_group_name: str, - job_name: str, - job_execution_name: Union[_models.JobExecutionNamesCollection, IO], - **kwargs: Any + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> Optional[_models.ContainerAppJobExecutions]: error_map = { 401: ClientAuthenticationError, @@ -1562,29 +1567,17 @@ def _stop_multiple_executions_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.ContainerAppJobExecutions]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_execution_name, (IO, bytes)): - _content = job_execution_name - else: - _json = self._serialize.body(job_execution_name, "JobExecutionNamesCollection") - request = build_stop_multiple_executions_request( resource_group_name=resource_group_name, job_name=job_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, template_url=self._stop_multiple_executions_initial.metadata["url"], headers=_headers, params=_params, @@ -1621,91 +1614,9 @@ def _stop_multiple_executions_initial( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop" } - @overload - def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: _models.JobExecutionNamesCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ContainerAppJobExecutions]: - """Terminates execution of a running container apps job. - - Terminates execution of a running container apps job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. - :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Required. - :type job_execution_name: ~azure.mgmt.appcontainers.models.JobExecutionNamesCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: 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 ContainerAppJobExecutions or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: IO, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ContainerAppJobExecutions]: - """Terminates execution of a running container apps job. - - Terminates execution of a running container apps job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. - :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Required. - :type job_execution_name: IO - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: 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 ContainerAppJobExecutions or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace def begin_stop_multiple_executions( - self, - resource_group_name: str, - job_name: str, - job_execution_name: Union[_models.JobExecutionNamesCollection, IO], - **kwargs: Any + self, resource_group_name: str, job_name: str, **kwargs: Any ) -> LROPoller[_models.ContainerAppJobExecutions]: """Terminates execution of a running container apps job. @@ -1714,14 +1625,8 @@ def begin_stop_multiple_executions( :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str - :param job_execution_name: List of all job executions that should be stopped. Is either a - JobExecutionNamesCollection type or a IO type. Required. - :type job_execution_name: ~azure.mgmt.appcontainers.models.JobExecutionNamesCollection or IO - :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. - Default value is None. - :paramtype content_type: 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 @@ -1736,11 +1641,10 @@ def begin_stop_multiple_executions( ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerAppJobExecutions] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1749,9 +1653,7 @@ def begin_stop_multiple_executions( raw_result = self._stop_multiple_executions_initial( resource_group_name=resource_group_name, job_name=job_name, - job_execution_name=job_execution_name, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1795,7 +1697,7 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param job_name: Name of the Container Apps Job. Required. + :param job_name: Job Name. Required. :type job_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: JobSecretsCollection or the result of cls(response) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py index 95baed2e910c..fae571bdf1bf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +45,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +62,7 @@ def build_get_request( "managedCertificateName": _SERIALIZER.url("managed_certificate_name", managed_certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -78,7 +79,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -96,7 +97,7 @@ def build_create_or_update_request( "managedCertificateName": _SERIALIZER.url("managed_certificate_name", managed_certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -115,7 +116,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +133,7 @@ def build_delete_request( "managedCertificateName": _SERIALIZER.url("managed_certificate_name", managed_certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -149,7 +150,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -167,7 +168,7 @@ def build_update_request( "managedCertificateName": _SERIALIZER.url("managed_certificate_name", managed_certificate_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,7 +187,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +203,7 @@ def build_list_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -329,7 +330,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(managed_certificate_envelope, (IO, bytes)): + if isinstance(managed_certificate_envelope, (IOBase, bytes)): _content = managed_certificate_envelope else: if managed_certificate_envelope is not None: @@ -738,7 +739,7 @@ def update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(managed_certificate_envelope, (IO, bytes)): + if isinstance(managed_certificate_envelope, (IOBase, bytes)): _content = managed_certificate_envelope else: _json = self._serialize.body(managed_certificate_envelope, "ManagedCertificatePatch") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py index 94264a0240b9..d1bcbc91fd4b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_list_detectors_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +73,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_get_detector_request( "detectorName": _SERIALIZER.url("detector_name", detector_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py index a7c5bcbe547c..c3f01b2462f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +56,7 @@ def build_get_root_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py index 250562ee320f..79a74f4d0ccc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -29,7 +30,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -51,7 +52,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -66,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +99,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +115,7 @@ def build_get_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -131,7 +132,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,7 +149,7 @@ def build_create_or_update_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -167,7 +168,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +184,7 @@ def build_delete_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -200,7 +201,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -217,7 +218,7 @@ def build_update_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -236,7 +237,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -252,7 +253,7 @@ def build_get_auth_token_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -263,13 +264,13 @@ def build_get_auth_token_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_workload_profile_states_request( # pylint: disable=name-too-long +def build_list_workload_profile_states_request( resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -285,7 +286,7 @@ def build_list_workload_profile_states_request( # pylint: disable=name-too-long "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -579,7 +580,7 @@ def _create_or_update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ManagedEnvironment") @@ -925,7 +926,7 @@ def _update_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(environment_envelope, (IO, bytes)): + if isinstance(environment_envelope, (IOBase, bytes)): _content = environment_envelope else: _json = self._serialize.body(environment_envelope, "ManagedEnvironment") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py index a57f8221fea2..733f73c8967d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +41,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -56,7 +57,7 @@ def build_list_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -73,7 +74,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +91,7 @@ def build_get_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -107,7 +108,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +126,7 @@ def build_create_or_update_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,7 +145,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +162,7 @@ def build_delete_request( "storageName": _SERIALIZER.url("storage_name", storage_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -443,7 +444,7 @@ def create_or_update( content_type = content_type or "application/json" _json = None _content = None - if isinstance(storage_envelope, (IO, bytes)): + if isinstance(storage_envelope, (IOBase, bytes)): _content = storage_envelope else: _json = self._serialize.body(storage_envelope, "ManagedEnvironmentStorage") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py index 307e3a24ea7b..c18e4e341a53 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -25,7 +26,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +41,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -57,7 +58,7 @@ def build_check_name_availability_request( "environmentName": _SERIALIZER.url("environment_name", environment_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -197,7 +198,7 @@ def check_name_availability( content_type = content_type or "application/json" _json = None _content = None - if isinstance(check_name_availability_request, (IO, bytes)): + if isinstance(check_name_availability_request, (IOBase, bytes)): _content = check_name_availability_request else: _json = self._serialize.body(check_name_availability_request, "CheckNameAvailabilityRequest") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py index 1c1b25cf0853..72dfb15cee16 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py @@ -27,7 +27,7 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import _convert_request +from .._vendor import ContainerAppsAPIClientMixinABC, _convert_request T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py index 2fdfd27a32e4..e933e3c96b01 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/AuthConfigs_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/AuthConfigs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py index 73499cbfb34b..d913c3efce8c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) - response = client.container_apps_auth_configs.delete( + client.container_apps_auth_configs.delete( resource_group_name="workerapps-rg-xj", container_app_name="testcanadacentral", auth_config_name="current", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/AuthConfigs_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/AuthConfigs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py index 68155c3309ed..c9d09e41f997 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/AuthConfigs_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/AuthConfigs_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py index e82fd4737f30..370df7f6cdaf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/AuthConfigs_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/AuthConfigs_ListByContainer.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py index eaaa81fd402e..8ebff8a5ac89 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/AvailableWorkloadProfiles_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/AvailableWorkloadProfiles_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py index d0d3426a753a..a5f9b32efea8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py @@ -35,6 +35,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/BillingMeters_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/BillingMeters_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py index 6856fa9f931c..dea5245c2589 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py index b73cd9dd3920..9bedcdc0d2c4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.certificates.delete( + client.certificates.delete( resource_group_name="examplerg", environment_name="testcontainerenv", certificate_name="certificate-firendly-name", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py index db6a07c05054..62539bee8b81 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py index fc86e5e16994..af5b1bdad649 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py index 49ef6bc42fce..680006d38a36 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py index 73cab76b12d6..1f2f47e01827 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Certificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Certificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py index f171f42543a1..5dc0509c4cf9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py index 49e5ca3bf982..2633d9418944 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.connected_environments_certificates.delete( + client.connected_environments_certificates.delete( resource_group_name="examplerg", connected_environment_name="testcontainerenv", certificate_name="certificate-firendly-name", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py index 4610afba1abc..546e64901b68 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py index 0ca25b65856a..e5ccd5834d34 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py index a4f99a44e3f4..9d5231c54a61 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py index 6ce10b0ce4c3..50ac15f55c98 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py index 422d52046e63..024b703035d0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py index 96fe989716ea..30ab1302e2e4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py index 0a903fa82e08..94be51b901ab 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.connected_environments_dapr_components.delete( + client.connected_environments_dapr_components.delete( resource_group_name="examplerg", connected_environment_name="myenvironment", component_name="reddog", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py index eae2e4845f05..034e8c27c470 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsDaprComponents_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py index d49b235eedd1..929659d36ee9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsDaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsDaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py index fc344c736fe1..ea1924799cfe 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py index 450b11d08949..e91c1a4ad166 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.connected_environments.begin_delete( + client.connected_environments.begin_delete( resource_group_name="examplerg", connected_environment_name="examplekenv", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py index 27e4454edf2d..8ecda7c844be 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py index 9cbafd29496f..a7437b6acabe 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py index 5aebc8fccbdc..31d38cb5e5dd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py index 422a452309e9..af6d619d9777 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py index cfcb5a02397c..e4e7ab5a9df6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py index 6b002285462a..bca28941a160 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.connected_environments_storages.delete( + client.connected_environments_storages.delete( resource_group_name="examplerg", connected_environment_name="env", storage_name="jlaw-demo1", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py index 670c8a3fc198..97a62f342dd5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py index 66a403d4f0f3..a90a72645a73 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ConnectedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ConnectedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py index 36050f16644c..5c35e5a4779f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py index c659765ab4e8..10fe12cf4049 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py @@ -87,6 +87,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "service": {"type": "redis"}, }, "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", "template": { @@ -127,6 +128,12 @@ def main(): } ], }, + "serviceBinds": [ + { + "name": "redisService", + "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService", + } + ], }, "workloadProfileName": "My-GP-01", }, @@ -135,6 +142,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py index d7bf3d3591c7..48c2756b876f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps.begin_delete( + client.container_apps.begin_delete( resource_group_name="rg", container_app_name="testWorkerApp0", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py index 963d4099b31e..0761a61c008a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerAppsDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerAppsDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py index 5501553a879e..5aa2868ba2f0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerAppsDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerAppsDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py index 05e98d9af08c..c2559b742b38 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py index e2a3e0cb9506..85cbd920a7aa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py index 786e0f64690a..73845482b33c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py index ac9e505a4f6b..ce7078802744 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py index 1f252b45b5e7..2eae969a7545 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListCustomHostNameAnalysis.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py index 52f325c6f9ee..231a13c9fcfd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py index a6ee960e6641..3133e2bdfcdd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_ManagedBy_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py index e3ec24836ce4..3e56a5045fd9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py @@ -78,6 +78,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "service": {"type": "redis"}, }, "template": { "containers": [ @@ -115,6 +116,12 @@ def main(): } ], }, + "serviceBinds": [ + { + "name": "service", + "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service", + } + ], }, }, "tags": {"tag1": "value1", "tag2": "value2"}, @@ -123,6 +130,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py new file mode 100644 index 000000000000..71164ee29964 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py @@ -0,0 +1,41 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python container_apps_start.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_start( + resource_group_name="rg", + container_app_name="testWorkerApp0", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_Start.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py new file mode 100644 index 000000000000..c0d7fd44776d --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py @@ -0,0 +1,41 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python container_apps_stop.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_stop( + resource_group_name="rg", + container_app_name="testWorkerApp0", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_Stop.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py index 785238a57383..a0c0482f4f7f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py index 0d919dcb27f2..bb315049008e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py index 0ae187bde673..39a7b6e29848 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_CreateOrUpdate_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py index e852846872be..2324831379ea 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.dapr_components.delete( + client.dapr_components.delete( resource_group_name="examplerg", environment_name="myenvironment", component_name="reddog", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py index e32d640601a2..09054b947037 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_Get_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_Get_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py index bede0270bd3d..3c46e8ecf802 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_Get_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_Get_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py index 90fc4d76af7e..a965910cf0cb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py index abee031c340e..8f12f74c815f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/DaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/DaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py new file mode 100644 index 000000000000..5d2531451ea8 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update.py @@ -0,0 +1,82 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python job_createor_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.jobs.begin_create_or_update( + resource_group_name="rg", + job_name="testcontainerAppsJob0", + job_envelope={ + "location": "East US", + "properties": { + "configuration": { + "manualTriggerConfig": {"parallelism": 4, "replicaCompletionCount": 1}, + "replicaRetryLimit": 10, + "replicaTimeout": 10, + "triggerType": "Manual", + }, + "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "template": { + "containers": [ + { + "image": "repo/testcontainerAppsJob0:v1", + "name": "testcontainerAppsJob0", + "probes": [ + { + "httpGet": { + "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], + "path": "/health", + "port": 8080, + }, + "initialDelaySeconds": 5, + "periodSeconds": 3, + "type": "Liveness", + } + ], + } + ], + "initContainers": [ + { + "args": ["-c", "while true; do echo hello; sleep 10;done"], + "command": ["/bin/sh"], + "image": "repo/testcontainerAppsJob0:v4", + "name": "testinitcontainerAppsJob0", + "resources": {"cpu": 0.2, "memory": "100Mi"}, + } + ], + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_CreateorUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py new file mode 100644 index 000000000000..e8a7418aa1b0 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_createor_update_event_trigger.py @@ -0,0 +1,80 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python job_createor_update_event_trigger.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.jobs.begin_create_or_update( + resource_group_name="rg", + job_name="testcontainerAppsJob0", + job_envelope={ + "location": "East US", + "properties": { + "configuration": { + "eventTriggerConfig": { + "parallelism": 4, + "replicaCompletionCount": 1, + "scale": { + "maxExecutions": 5, + "minExecutions": 1, + "pollingInterval": 40, + "rules": [ + { + "metadata": {"topicName": "my-topic"}, + "name": "servicebuscalingrule", + "type": "azure-servicebus", + } + ], + }, + }, + "replicaRetryLimit": 10, + "replicaTimeout": 10, + "triggerType": "Event", + }, + "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "template": { + "containers": [{"image": "repo/testcontainerAppsJob0:v1", "name": "testcontainerAppsJob0"}], + "initContainers": [ + { + "args": ["-c", "while true; do echo hello; sleep 10;done"], + "command": ["/bin/sh"], + "image": "repo/testcontainerAppsJob0:v4", + "name": "testinitcontainerAppsJob0", + "resources": {"cpu": 0.2, "memory": "100Mi"}, + } + ], + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_CreateorUpdate_EventTrigger.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py index 1db54ecaa3a5..67bf62912f9e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.jobs.begin_delete( + client.jobs.begin_delete( resource_group_name="rg", job_name="testWorkerContainerAppsJob0", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py new file mode 100644 index 000000000000..9040eb4aaee7 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py @@ -0,0 +1,42 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python job_execution_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.job_execution( + resource_group_name="rg", + job_name="testcontainerAppsJob0", + job_execution_name="jobExecution1", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Execution_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py index f7769f7018b5..f374a86cd237 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Executions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Executions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py index cf7b680c5a6e..489e21ab3c9a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py index de7e9d3dff56..68992384b2e4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py new file mode 100644 index 000000000000..654850772d0a --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_patch.py @@ -0,0 +1,80 @@ +# 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 azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python job_patch.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.jobs.begin_update( + resource_group_name="rg", + job_name="testcontainerAppsJob0", + job_envelope={ + "properties": { + "configuration": { + "manualTriggerConfig": {"parallelism": 4, "replicaCompletionCount": 1}, + "replicaRetryLimit": 10, + "replicaTimeout": 10, + "triggerType": "Manual", + }, + "template": { + "containers": [ + { + "image": "repo/testcontainerAppsJob0:v1", + "name": "testcontainerAppsJob0", + "probes": [ + { + "httpGet": { + "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], + "path": "/health", + "port": 8080, + }, + "initialDelaySeconds": 3, + "periodSeconds": 3, + "type": "Liveness", + } + ], + } + ], + "initContainers": [ + { + "args": ["-c", "while true; do echo hello; sleep 10;done"], + "command": ["/bin/sh"], + "image": "repo/testcontainerAppsJob0:v4", + "name": "testinitcontainerAppsJob0", + "resources": {"cpu": 0.2, "memory": "100Mi"}, + } + ], + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Patch.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py index 6c04dd9f87a3..b1bd6eb6eb1b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py @@ -32,28 +32,10 @@ def main(): response = client.jobs.begin_start( resource_group_name="rg", job_name="testcontainerAppsJob0", - template={ - "containers": [ - { - "image": "repo/testcontainerAppsJob0:v4", - "name": "testcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - "initContainers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainerAppsJob0:v4", - "name": "testinitcontainerAppsJob0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - }, ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Start.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py index e132308deedb..34e063182943 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.jobs.begin_stop_execution( + client.jobs.begin_stop_execution( resource_group_name="rg", job_name="testcontainerAppsJob0", job_execution_name="jobExecution1", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Stop_Execution.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Stop_Execution.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py index bd26134cc901..ad671acce7fa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py @@ -32,17 +32,10 @@ def main(): response = client.jobs.begin_stop_multiple_executions( resource_group_name="rg", job_name="testcontainerAppsJob0", - job_execution_name={ - "value": [ - {"name": "jobExecution-27944453"}, - {"name": "jobExecution-27944452"}, - {"name": "jobExecution-27944451"}, - ] - }, ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Job_Stop_Multiple.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Job_Stop_Multiple.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py index 8028e4e11e52..974f1948ea56 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Jobs_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Jobs_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py index 6299518cd71e..dbf9fb00334f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Jobs_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Jobs_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py index 73da2b9fce78..59cf78f978dc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py index dbdcc95ab8d9..3f20a343dbe5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.managed_certificates.delete( + client.managed_certificates.delete( resource_group_name="examplerg", environment_name="testcontainerenv", managed_certificate_name="certificate-firendly-name", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py index 697f0c4125b8..d9b1fd94cdc5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py index d6c1d7ac38ab..05a25fd05c2c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedCertificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedCertificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py index 186eac57bacd..5653b6bcde0a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py index 3860290d1b5f..d5481f13e31e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py index 825473fab1c2..8e6dcc86a300 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py index c396e7a4fd2a..46827d450f11 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py @@ -42,6 +42,7 @@ def main(): "dnsSuffix": "www.my-name.com", }, "daprAIConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", + "peerAuthentication": {"mtls": {"enabled": True}}, "vnetConfiguration": { "infrastructureSubnetId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1" }, @@ -73,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py index fca0f8215ca0..fd5232fae232 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py index d0300efc6188..ddf5bc40e33b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py @@ -29,13 +29,12 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.managed_environments.begin_delete( + client.managed_environments.begin_delete( resource_group_name="examplerg", environment_name="examplekenv", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py index 3635fe7070f1..e4873afecaa8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py index 194a5a004cdd..56e3171f8129 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py index e9441bb41f6a..d0e3555d080e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py index b70ad83ded5f..48105b604bb0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py index 166fce770544..73b67ee3f603 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_ListWorkloadProfileStates.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py index 9b5120a0c742..96b6650b2bcd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py index bb1ac9b8e29f..da74a2c75c5d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py index 6c278a6e9587..60a920675098 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) - response = client.managed_environments_storages.delete( + client.managed_environments_storages.delete( resource_group_name="examplerg", environment_name="managedEnv", storage_name="jlaw-demo1", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py index 1ac7c222c6e4..8a534fd74c8d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py index 3dc6150044fb..27117ddea822 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/ManagedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/ManagedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py index dbd5b745b386..e04bb66279db 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Operations_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py index 662f4e832eb9..e0780e406120 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Replicas_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Replicas_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py index e4ce31844076..59dae6a808c3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Replicas_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Replicas_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py index 13d18f3e87d4..07aa985c27a9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_revisions.activate_revision( + client.container_apps_revisions.activate_revision( resource_group_name="rg", container_app_name="testcontainerApp0", revision_name="testcontainerApp0-pjxhsye", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Revisions_Activate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Revisions_Activate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py index 01bb6e5ae416..f1c8b953f9b5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_revisions.deactivate_revision( + client.container_apps_revisions.deactivate_revision( resource_group_name="rg", container_app_name="testcontainerApp0", revision_name="testcontainerApp0-pjxhsye", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Revisions_Deactivate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Revisions_Deactivate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py index 23bada99296c..c9a7dbf05f90 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Revisions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Revisions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py index 7d3713f40773..4df2b7c55692 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Revisions_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Revisions_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py index 5b69a8a05d5a..126a3c1a84a3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py @@ -29,14 +29,13 @@ def main(): subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) - response = client.container_apps_revisions.restart_revision( + client.container_apps_revisions.restart_revision( resource_group_name="rg", container_app_name="testStaticSite0", revision_name="testcontainerApp0-pjxhsye", ) - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/Revisions_Restart.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/Revisions_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py index 32a00cfe8d00..bcfcea00137e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py @@ -40,14 +40,16 @@ def main(): "azureCredentials": { "clientId": "", "clientSecret": "", + "kind": "feaderated", "tenantId": "", }, "contextPath": "./", + "githubPersonalAccessToken": "test", "image": "image/tag", "registryInfo": { "registryPassword": "", - "registryUrl": "xwang971reg.azurecr.io", - "registryUserName": "xwang971reg", + "registryUrl": "test-registry.azurecr.io", + "registryUserName": "test-registry", }, }, "repoUrl": "https://github.com/xwang971/ghatest", @@ -57,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/SourceControls_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/SourceControls_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py index d8124cab5b61..c4da8857288c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py @@ -29,14 +29,13 @@ def main(): subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) - response = client.container_apps_source_controls.begin_delete( + client.container_apps_source_controls.begin_delete( resource_group_name="workerapps-rg-xj", container_app_name="testcanadacentral", source_control_name="current", ).result() - print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/SourceControls_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/SourceControls_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py index f819d955b351..cb0dd31f2206 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/SourceControls_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/SourceControls_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py index 85b4f542cc83..6c7178b74834 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-11-01-preview/examples/SourceControls_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2023-05-01/examples/SourceControls_ListByContainer.json if __name__ == "__main__": main()