From dd1265a7654fec77c62e8ed7e2f5148848951da2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 24 May 2023 07:43:58 +0000 Subject: [PATCH] CodeGen from PR 24107 in Azure/azure-rest-api-specs Merge 7690350eeab865a9731b4b71c2d9b29e58dbad0b into dad7d3cc55a6309bd5a35327bf24e3fb363f4777 --- .../azure-mgmt-appcontainers/_meta.json | 6 +- .../mgmt/appcontainers/_configuration.py | 18 +- .../_container_apps_api_client.py | 31 +- .../azure/mgmt/appcontainers/_vendor.py | 20 +- .../azure/mgmt/appcontainers/_version.py | 2 +- .../mgmt/appcontainers/aio/_configuration.py | 23 +- .../aio/_container_apps_api_client.py | 31 +- .../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 | 98 +++++ ..._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 | 7 +- .../aio/operations/_jobs_operations.py | 241 ++---------- .../_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 | 27 ++ .../mgmt/appcontainers/models/_models_py3.py | 372 +++++++++++++++++- .../mgmt/appcontainers/operations/__init__.py | 10 +- ..._available_workload_profiles_operations.py | 4 +- .../operations/_billing_meters_operations.py | 4 +- .../operations/_certificates_operations.py | 17 +- ...ed_environments_certificates_operations.py | 17 +- ...environments_dapr_components_operations.py | 15 +- .../_connected_environments_operations.py | 21 +- ...nected_environments_storages_operations.py | 13 +- .../_container_apps_api_client_operations.py | 136 +++++++ ..._container_apps_auth_configs_operations.py | 13 +- .../_container_apps_diagnostics_operations.py | 12 +- .../operations/_container_apps_operations.py | 359 ++++++++++++++++- ...ainer_apps_revision_replicas_operations.py | 6 +- .../_container_apps_revisions_operations.py | 12 +- ...ntainer_apps_source_controls_operations.py | 13 +- .../operations/_dapr_components_operations.py | 15 +- .../operations/_jobs_executions_operations.py | 12 +- .../operations/_jobs_operations.py | 285 +++----------- .../_managed_certificates_operations.py | 17 +- ...aged_environment_diagnostics_operations.py | 6 +- ...ged_environments_diagnostics_operations.py | 4 +- .../_managed_environments_operations.py | 25 +- ...anaged_environments_storages_operations.py | 13 +- .../operations/_namespaces_operations.py | 7 +- .../appcontainers/operations/_operations.py | 4 +- .../auth_configs_create_or_update.py | 4 +- .../generated_samples/auth_configs_delete.py | 7 +- .../generated_samples/auth_configs_get.py | 4 +- .../auth_configs_list_by_container.py | 4 +- .../available_workload_profiles_get.py | 4 +- .../generated_samples/billing_meters_get.py | 4 +- .../certificate_create_or_update.py | 4 +- .../generated_samples/certificate_delete.py | 7 +- .../generated_samples/certificate_get.py | 4 +- .../certificates_check_name_availability.py | 4 +- ...ertificates_list_by_managed_environment.py | 4 +- .../generated_samples/certificates_patch.py | 4 +- ...vironments_certificate_create_or_update.py | 4 +- ...nnected_environments_certificate_delete.py | 7 +- .../connected_environments_certificate_get.py | 4 +- ...ts_certificates_check_name_availability.py | 4 +- ...tificates_list_by_connected_environment.py | 4 +- ...nnected_environments_certificates_patch.py | 4 +- ...connected_environments_create_or_update.py | 4 +- ...nments_dapr_components_create_or_update.py | 4 +- ...ted_environments_dapr_components_delete.py | 7 +- ...nected_environments_dapr_components_get.py | 4 +- ...ected_environments_dapr_components_list.py | 4 +- ...vironments_dapr_components_list_secrets.py | 4 +- .../connected_environments_delete.py | 7 +- .../connected_environments_get.py | 4 +- ...ted_environments_list_by_resource_group.py | 4 +- ...ected_environments_list_by_subscription.py | 4 +- .../connected_environments_patch.py | 4 +- ..._environments_storages_create_or_update.py | 4 +- .../connected_environments_storages_delete.py | 7 +- .../connected_environments_storages_get.py | 4 +- .../connected_environments_storages_list.py | 4 +- .../container_apps_check_name_availability.py | 4 +- .../container_apps_create_or_update.py | 11 +- .../container_apps_delete.py | 7 +- .../container_apps_diagnostics_get.py | 4 +- .../container_apps_diagnostics_list.py | 4 +- .../generated_samples/container_apps_get.py | 4 +- .../container_apps_get_auth_token.py | 4 +- .../container_apps_list_by_resource_group.py | 4 +- .../container_apps_list_by_subscription.py | 4 +- ...ner_apps_list_custom_host_name_analysis.py | 4 +- .../container_apps_list_secrets.py | 4 +- ...tainer_apps_managed_by_create_or_update.py | 4 +- .../generated_samples/container_apps_patch.py | 11 +- .../generated_samples/container_apps_start.py | 43 ++ .../generated_samples/container_apps_stop.py | 43 ++ ...container_apps_tcp_app_create_or_update.py | 4 +- ...create_or_update_secret_store_component.py | 4 +- ...apr_components_create_or_update_secrets.py | 4 +- .../dapr_components_delete.py | 7 +- ...r_components_get_secret_store_component.py | 4 +- .../dapr_components_get_secrets.py | 4 +- .../generated_samples/dapr_components_list.py | 4 +- .../dapr_components_list_secrets.py | 4 +- .../generated_samples/job_delete.py | 8 +- .../generated_samples/job_execution_get.py | 42 ++ .../generated_samples/job_executions_get.py | 5 +- .../generated_samples/job_get.py | 5 +- .../generated_samples/job_list_secrets.py | 5 +- .../generated_samples/job_start.py | 5 +- .../generated_samples/job_stop_execution.py | 9 +- .../generated_samples/job_stop_multiple.py | 12 +- .../jobs_list_by_resource_group.py | 4 +- .../jobs_list_by_subscription.py | 4 +- .../managed_certificate_create_or_update.py | 4 +- .../managed_certificate_delete.py | 7 +- .../managed_certificate_get.py | 4 +- ...ertificates_list_by_managed_environment.py | 4 +- .../managed_certificates_patch.py | 4 +- .../managed_environment_diagnostics_get.py | 4 +- .../managed_environment_diagnostics_list.py | 4 +- .../managed_environments_create_or_update.py | 5 +- ...om_infrastructure_resource_group_create.py | 4 +- .../managed_environments_delete.py | 7 +- .../managed_environments_get.py | 4 +- .../managed_environments_get_auth_token.py | 4 +- ...ged_environments_list_by_resource_group.py | 4 +- ...naged_environments_list_by_subscription.py | 4 +- ...vironments_list_workload_profile_states.py | 4 +- .../managed_environments_patch.py | 4 +- ..._environments_storages_create_or_update.py | 4 +- .../managed_environments_storages_delete.py | 7 +- .../managed_environments_storages_get.py | 4 +- .../managed_environments_storages_list.py | 4 +- .../generated_samples/operations_list.py | 4 +- .../generated_samples/replicas_get.py | 4 +- .../generated_samples/replicas_list.py | 4 +- .../generated_samples/revisions_activate.py | 7 +- .../generated_samples/revisions_deactivate.py | 7 +- .../generated_samples/revisions_get.py | 4 +- .../generated_samples/revisions_list.py | 4 +- .../generated_samples/revisions_restart.py | 7 +- .../source_controls_create_or_update.py | 10 +- .../source_controls_delete.py | 7 +- .../generated_samples/source_controls_get.py | 4 +- .../source_controls_list_by_container.py | 4 +- 159 files changed, 2121 insertions(+), 784 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_execution_get.py diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index 4059fd27c549..9e6c677235d8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3c639105c011765893db51cbb0dda056e34dc994", + "commit": "ab767a0c0c427d79d8558dce5f9cc3d14b6a16e5", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.8", + "@autorest/python@6.4.12", "@autorest/modelerfour@4.24.3" ], - "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.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --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..43f43a88eee9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -27,23 +27,35 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str :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 + :keyword api_version: Api Version. Default value is "2023-04-01-preview". 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: + def __init__( + self, credential: "TokenCredential", job_name: str, job_execution_name: str, 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-04-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") + if job_name is None: + raise ValueError("Parameter 'job_name' must not be None.") + if job_execution_name is None: + raise ValueError("Parameter 'job_execution_name' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") self.credential = credential + self.job_name = job_name + self.job_execution_name = job_execution_name self.subscription_id = subscription_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) 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..cfc150c70f1c 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 @@ -114,11 +117,15 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.operations.ContainerAppsSourceControlsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str :param subscription_id: The ID of the target subscription. Required. :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 + :keyword api_version: Api Version. Default value is "2023-04-01-preview". 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 @@ -128,12 +135,18 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw def __init__( self, credential: "TokenCredential", + job_name: str, + job_execution_name: str, subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = ContainerAppsAPIClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=subscription_id, + **kwargs ) self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) @@ -161,8 +174,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 +190,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/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py index bd0df84f5319..7c521a8b16d2 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 List, TYPE_CHECKING, cast 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 @@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs): 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..f35dbf129ce1 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 @@ -27,23 +27,40 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str :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 + :keyword api_version: Api Version. Default value is "2023-04-01-preview". 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: + def __init__( + self, + credential: "AsyncTokenCredential", + job_name: str, + job_execution_name: str, + 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-04-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") + if job_name is None: + raise ValueError("Parameter 'job_name' must not be None.") + if job_execution_name is None: + raise ValueError("Parameter 'job_execution_name' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") self.credential = credential + self.job_name = job_name + self.job_execution_name = job_execution_name self.subscription_id = subscription_id self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) 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..3198270d66e6 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 @@ -114,11 +117,15 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw azure.mgmt.appcontainers.aio.operations.ContainerAppsSourceControlsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param job_name: Job Name. Required. + :type job_name: str + :param job_execution_name: Job execution name. Required. + :type job_execution_name: str :param subscription_id: The ID of the target subscription. Required. :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 + :keyword api_version: Api Version. Default value is "2023-04-01-preview". 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 @@ -128,12 +135,18 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw def __init__( self, credential: "AsyncTokenCredential", + job_name: str, + job_execution_name: str, subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: self._config = ContainerAppsAPIClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + job_name=job_name, + job_execution_name=job_execution_name, + subscription_id=subscription_id, + **kwargs ) self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) @@ -161,8 +174,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 +190,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..408106c51bc8 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py @@ -0,0 +1,98 @@ +# 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, **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 + :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, + subscription_id=self._config.subscription_id, + job_name=self._config.job_name, + job_execution_name=self._config.job_execution_name, + 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..7e9bd7dc025e 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]] @@ -54,7 +55,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list( - self, resource_group_name: str, job_name: str, filter: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.JobExecution"]: """Get a Container Apps Job's executions. @@ -63,8 +64,6 @@ 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. - :type job_name: str :param filter: The filter to apply on the operation. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -91,8 +90,8 @@ def prepare_request(next_link=None): request = build_list_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, filter=filter, api_version=api_version, template_url=self.list.metadata["url"], 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..e41493908baa 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]] @@ -239,7 +241,7 @@ async def get_next(next_link=None): } @distributed_trace_async - async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.Job: + async def get(self, resource_group_name: str, **kwargs: Any) -> _models.Job: """Get the properties of a Container Apps Job. Get the properties of a Container Apps Job. @@ -247,8 +249,6 @@ 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. - :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) :rtype: ~azure.mgmt.appcontainers.models.Job @@ -270,8 +270,8 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ request = build_get_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self.get.metadata["url"], headers=_headers, @@ -304,7 +304,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ } async def _create_or_update_initial( - self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any ) -> _models.Job: error_map = { 401: ClientAuthenticationError, @@ -324,15 +324,15 @@ 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") request = build_create_or_update_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -375,7 +375,6 @@ async def _create_or_update_initial( async def begin_create_or_update( self, resource_group_name: str, - job_name: str, job_envelope: _models.Job, *, content_type: str = "application/json", @@ -388,8 +387,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.Job :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -410,13 +407,7 @@ async def begin_create_or_update( @overload async def begin_create_or_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, job_envelope: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Job]: """Create or Update a Container Apps Job. @@ -425,8 +416,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -447,7 +436,7 @@ async def begin_create_or_update( @distributed_trace_async async def begin_create_or_update( - self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Job]: """Create or Update a Container Apps Job. @@ -456,8 +445,6 @@ 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. - :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. :type job_envelope: ~azure.mgmt.appcontainers.models.Job or IO @@ -488,7 +475,6 @@ async def begin_create_or_update( if cont_token is None: raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, - job_name=job_name, job_envelope=job_envelope, api_version=api_version, content_type=content_type, @@ -528,7 +514,7 @@ def get_long_running_output(pipeline_response): } async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -546,8 +532,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = build_delete_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self._delete_initial.metadata["url"], headers=_headers, @@ -580,7 +566,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements } @distributed_trace_async - async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + async def begin_delete(self, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Delete a Container Apps Job. Delete a Container Apps Job. @@ -588,8 +574,6 @@ 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. - :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. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -613,7 +597,6 @@ async def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, - job_name=job_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -648,11 +631,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- } async def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_envelope: Union[_models.JobPatchProperties, IO], - **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.JobPatchProperties, IO], **kwargs: Any ) -> Optional[_models.Job]: error_map = { 401: ClientAuthenticationError, @@ -672,15 +651,15 @@ 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") request = build_update_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -725,7 +704,6 @@ async def _update_initial( async def begin_update( self, resource_group_name: str, - job_name: str, job_envelope: _models.JobPatchProperties, *, content_type: str = "application/json", @@ -738,8 +716,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -760,13 +736,7 @@ async def begin_update( @overload async def begin_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, job_envelope: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.Job]: """Update properties of a Container Apps Job. @@ -775,8 +745,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -797,11 +765,7 @@ async def begin_update( @distributed_trace_async async def begin_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: Union[_models.JobPatchProperties, IO], - **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.JobPatchProperties, IO], **kwargs: Any ) -> AsyncLROPoller[_models.Job]: """Update properties of a Container Apps Job. @@ -810,8 +774,6 @@ 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. - :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. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties or IO @@ -842,7 +804,6 @@ async def begin_update( if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, - job_name=job_name, job_envelope=job_envelope, api_version=api_version, content_type=content_type, @@ -879,7 +840,7 @@ 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, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any ) -> Optional[_models.JobExecutionBase]: error_map = { 401: ClientAuthenticationError, @@ -899,15 +860,15 @@ 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") request = build_start_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -952,7 +913,6 @@ async def _start_initial( async def begin_start( self, resource_group_name: str, - job_name: str, template: _models.JobExecutionTemplate, *, content_type: str = "application/json", @@ -965,8 +925,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Required. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -988,13 +946,7 @@ async def begin_start( @overload async def begin_start( - self, - resource_group_name: str, - job_name: str, - template: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, template: IO, *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1003,8 +955,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Required. :type template: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -1026,7 +976,7 @@ 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, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any ) -> AsyncLROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1035,8 +985,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Is either a JobExecutionTemplate type or a IO type. Required. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate or IO @@ -1068,7 +1016,6 @@ async def begin_start( if cont_token is None: raw_result = await self._start_initial( resource_group_name=resource_group_name, - job_name=job_name, template=template, api_version=api_version, content_type=content_type, @@ -1107,7 +1054,7 @@ def get_long_running_output(pipeline_response): } async def _stop_execution_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1125,9 +1072,9 @@ async def _stop_execution_initial( # pylint: disable=inconsistent-return-statem request = build_stop_execution_request( resource_group_name=resource_group_name, - job_name=job_name, - job_execution_name=job_execution_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, + job_execution_name=self._config.job_execution_name, api_version=api_version, template_url=self._stop_execution_initial.metadata["url"], headers=_headers, @@ -1160,9 +1107,7 @@ async def _stop_execution_initial( # pylint: disable=inconsistent-return-statem } @distributed_trace_async - async def begin_stop_execution( - self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: + async def begin_stop_execution(self, resource_group_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Terminates execution of a running container apps job. Terminates execution of a running container apps job. @@ -1170,10 +1115,6 @@ 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. - :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 :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 @@ -1197,8 +1138,6 @@ async def begin_stop_execution( if cont_token is None: raw_result = await self._stop_execution_initial( # type: ignore resource_group_name=resource_group_name, - job_name=job_name, - job_execution_name=job_execution_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -1233,11 +1172,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, **kwargs: Any ) -> Optional[_models.ContainerAppJobExecutions]: error_map = { 401: ClientAuthenticationError, @@ -1247,29 +1182,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, + job_name=self._config.job_name, 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 +1229,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, **kwargs: Any ) -> AsyncLROPoller[_models.ContainerAppJobExecutions]: """Terminates execution of a running container apps job. @@ -1399,14 +1240,6 @@ 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. - :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 +1254,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) @@ -1433,10 +1265,7 @@ async def begin_stop_multiple_executions( if cont_token is None: 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, @@ -1472,9 +1301,7 @@ def get_long_running_output(pipeline_response): } @distributed_trace_async - async def list_secrets( - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> _models.JobSecretsCollection: + async def list_secrets(self, resource_group_name: str, **kwargs: Any) -> _models.JobSecretsCollection: """List secrets for a container apps job. List secrets for a container apps job. @@ -1482,8 +1309,6 @@ 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. - :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) :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection @@ -1505,8 +1330,8 @@ async def list_secrets( request = build_list_secrets_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self.list_secrets.metadata["url"], headers=_headers, 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..f8565184e653 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.""" 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..70e5f16ef8fb 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 @@ -878,6 +878,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 +888,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 +898,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 +909,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 +918,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 +1580,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 +1591,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 +1603,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 +1628,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 +1638,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 +4354,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 +4372,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 +4386,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 +4401,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 +4418,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 @@ -5092,6 +5113,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 +5133,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,6 +5146,7 @@ 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: @@ -5142,6 +5168,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 +5182,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 +5309,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. @@ -5552,6 +5623,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. @@ -6075,6 +6244,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 +6288,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 +6310,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 +6347,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 +6368,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 +6580,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 +7032,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 +7049,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 +7059,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 +7127,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 +7140,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 +7152,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 +7186,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 +7234,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 +7254,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 +7272,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 +7288,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 +7418,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 +7435,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 +7549,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 +7817,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 +7831,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 +7874,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 +8112,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 +8122,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 +8132,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 +8146,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 +8166,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..6dbbd4dc0452 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..9730784e44f2 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..be94c4459a58 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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..9f9311fe852b 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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..ad9c5c21759f 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..f6d2ad57ecb0 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) 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_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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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..299eca96dfbf 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..360a7fd7207c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py @@ -0,0 +1,136 @@ +# 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, _format_url_section + +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, subscription_id: str, job_name: str, job_execution_name: 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-04-01-preview")) + 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 = _format_url_section(_url, **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, **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 + :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, + subscription_id=self._config.subscription_id, + job_name=self._config.job_name, + job_execution_name=self._config.job_execution_name, + 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..5d5fce14014d 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..025831271e2e 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..6ddaae46a0c5 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) 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_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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,6 +337,76 @@ def build_get_auth_token_request( 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-04-01-preview")) + 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 = _format_url_section(_url, **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-04-01-preview")) + 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 = _format_url_section(_url, **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) + + class ContainerAppsOperations: """ .. warning:: @@ -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..15053d94b804 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..48991451ab03 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..955896c826af 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) 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_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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..2832f10647d6 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..e0ba2cc207d3 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, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -37,12 +37,12 @@ def build_list_request( - resource_group_name: str, job_name: str, subscription_id: str, *, filter: Optional[str] = None, **kwargs: Any + resource_group_name: str, subscription_id: str, job_name: str, *, filter: Optional[str] = None, **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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def __init__(self, *args, **kwargs): @distributed_trace def list( - self, resource_group_name: str, job_name: str, filter: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, filter: Optional[str] = None, **kwargs: Any ) -> Iterable["_models.JobExecution"]: """Get a Container Apps Job's executions. @@ -101,8 +101,6 @@ 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. - :type job_name: str :param filter: The filter to apply on the operation. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -129,8 +127,8 @@ def prepare_request(next_link=None): request = build_list_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, filter=filter, api_version=api_version, template_url=self.list.metadata["url"], 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..26849985ebaf 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,11 +93,11 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_get_request(resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,12 +125,12 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: def build_create_or_update_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,7 +144,7 @@ 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 @@ -159,11 +160,11 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_delete_request(resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -176,7 +177,7 @@ 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 @@ -190,11 +191,11 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_update_request(resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -208,7 +209,7 @@ 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 @@ -224,11 +225,11 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_start_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_start_request(resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -259,12 +260,12 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id def build_stop_execution_request( - resource_group_name: str, job_name: str, job_execution_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, subscription_id: str, job_name: str, job_execution_name: 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -295,13 +296,12 @@ def build_stop_execution_request( def build_stop_multiple_executions_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, subscription_id: str, job_name: 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")) - 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,20 +323,18 @@ def build_stop_multiple_executions_request( _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) def build_list_secrets_request( - resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any + resource_group_name: str, subscription_id: str, job_name: 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -555,7 +553,7 @@ def get_next(next_link=None): } @distributed_trace - def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.Job: + def get(self, resource_group_name: str, **kwargs: Any) -> _models.Job: """Get the properties of a Container Apps Job. Get the properties of a Container Apps Job. @@ -563,8 +561,6 @@ 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. - :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) :rtype: ~azure.mgmt.appcontainers.models.Job @@ -586,8 +582,8 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models request = build_get_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self.get.metadata["url"], headers=_headers, @@ -620,7 +616,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models } def _create_or_update_initial( - self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any ) -> _models.Job: error_map = { 401: ClientAuthenticationError, @@ -640,15 +636,15 @@ 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") request = build_create_or_update_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -691,7 +687,6 @@ def _create_or_update_initial( def begin_create_or_update( self, resource_group_name: str, - job_name: str, job_envelope: _models.Job, *, content_type: str = "application/json", @@ -704,8 +699,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.Job :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -726,13 +719,7 @@ def begin_create_or_update( @overload def begin_create_or_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, job_envelope: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Job]: """Create or Update a Container Apps Job. @@ -741,8 +728,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -763,7 +748,7 @@ def begin_create_or_update( @distributed_trace def begin_create_or_update( - self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.Job, IO], **kwargs: Any ) -> LROPoller[_models.Job]: """Create or Update a Container Apps Job. @@ -772,8 +757,6 @@ 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. - :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. :type job_envelope: ~azure.mgmt.appcontainers.models.Job or IO @@ -804,7 +787,6 @@ def begin_create_or_update( if cont_token is None: raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, - job_name=job_name, job_envelope=job_envelope, api_version=api_version, content_type=content_type, @@ -843,7 +825,7 @@ def get_long_running_output(pipeline_response): } def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -861,8 +843,8 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = build_delete_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self._delete_initial.metadata["url"], headers=_headers, @@ -895,7 +877,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements } @distributed_trace - def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[None]: + def begin_delete(self, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a Container Apps Job. Delete a Container Apps Job. @@ -903,8 +885,6 @@ 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. - :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. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -928,7 +908,6 @@ def begin_delete(self, resource_group_name: str, job_name: str, **kwargs: Any) - if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, - job_name=job_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -963,11 +942,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- } def _update_initial( - self, - resource_group_name: str, - job_name: str, - job_envelope: Union[_models.JobPatchProperties, IO], - **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.JobPatchProperties, IO], **kwargs: Any ) -> Optional[_models.Job]: error_map = { 401: ClientAuthenticationError, @@ -987,15 +962,15 @@ 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") request = build_update_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -1040,7 +1015,6 @@ def _update_initial( def begin_update( self, resource_group_name: str, - job_name: str, job_envelope: _models.JobPatchProperties, *, content_type: str = "application/json", @@ -1053,8 +1027,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -1075,13 +1047,7 @@ def begin_update( @overload def begin_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, job_envelope: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.Job]: """Update properties of a Container Apps Job. @@ -1090,8 +1056,6 @@ 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. - :type job_name: str :param job_envelope: Properties used to create a container apps job. Required. :type job_envelope: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -1112,11 +1076,7 @@ def begin_update( @distributed_trace def begin_update( - self, - resource_group_name: str, - job_name: str, - job_envelope: Union[_models.JobPatchProperties, IO], - **kwargs: Any + self, resource_group_name: str, job_envelope: Union[_models.JobPatchProperties, IO], **kwargs: Any ) -> LROPoller[_models.Job]: """Update properties of a Container Apps Job. @@ -1125,8 +1085,6 @@ 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. - :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. :type job_envelope: ~azure.mgmt.appcontainers.models.JobPatchProperties or IO @@ -1157,7 +1115,6 @@ def begin_update( if cont_token is None: raw_result = self._update_initial( resource_group_name=resource_group_name, - job_name=job_name, job_envelope=job_envelope, api_version=api_version, content_type=content_type, @@ -1194,7 +1151,7 @@ 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, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any ) -> Optional[_models.JobExecutionBase]: error_map = { 401: ClientAuthenticationError, @@ -1214,15 +1171,15 @@ 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") request = build_start_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, content_type=content_type, json=_json, @@ -1267,7 +1224,6 @@ def _start_initial( def begin_start( self, resource_group_name: str, - job_name: str, template: _models.JobExecutionTemplate, *, content_type: str = "application/json", @@ -1280,8 +1236,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Required. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -1303,13 +1257,7 @@ def begin_start( @overload def begin_start( - self, - resource_group_name: str, - job_name: str, - template: IO, - *, - content_type: str = "application/json", - **kwargs: Any + self, resource_group_name: str, template: IO, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1318,8 +1266,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Required. :type template: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -1341,7 +1287,7 @@ 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, template: Union[_models.JobExecutionTemplate, IO], **kwargs: Any ) -> LROPoller[_models.JobExecutionBase]: """Start a Container Apps Job. @@ -1350,8 +1296,6 @@ 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. - :type job_name: str :param template: Properties used to start a job instance. Is either a JobExecutionTemplate type or a IO type. Required. :type template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate or IO @@ -1383,7 +1327,6 @@ def begin_start( if cont_token is None: raw_result = self._start_initial( resource_group_name=resource_group_name, - job_name=job_name, template=template, api_version=api_version, content_type=content_type, @@ -1422,7 +1365,7 @@ def get_long_running_output(pipeline_response): } def _stop_execution_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> None: error_map = { 401: ClientAuthenticationError, @@ -1440,9 +1383,9 @@ def _stop_execution_initial( # pylint: disable=inconsistent-return-statements request = build_stop_execution_request( resource_group_name=resource_group_name, - job_name=job_name, - job_execution_name=job_execution_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, + job_execution_name=self._config.job_execution_name, api_version=api_version, template_url=self._stop_execution_initial.metadata["url"], headers=_headers, @@ -1475,9 +1418,7 @@ def _stop_execution_initial( # pylint: disable=inconsistent-return-statements } @distributed_trace - def begin_stop_execution( - self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any - ) -> LROPoller[None]: + def begin_stop_execution(self, resource_group_name: str, **kwargs: Any) -> LROPoller[None]: """Terminates execution of a running container apps job. Terminates execution of a running container apps job. @@ -1485,10 +1426,6 @@ 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. - :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 :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 @@ -1512,8 +1449,6 @@ def begin_stop_execution( if cont_token is None: raw_result = self._stop_execution_initial( # type: ignore resource_group_name=resource_group_name, - job_name=job_name, - job_execution_name=job_execution_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -1548,11 +1483,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, **kwargs: Any ) -> Optional[_models.ContainerAppJobExecutions]: error_map = { 401: ClientAuthenticationError, @@ -1562,29 +1493,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, + job_name=self._config.job_name, 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 +1540,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, **kwargs: Any ) -> LROPoller[_models.ContainerAppJobExecutions]: """Terminates execution of a running container apps job. @@ -1714,14 +1551,6 @@ 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. - :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 +1565,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) @@ -1748,10 +1576,7 @@ def begin_stop_multiple_executions( if cont_token is None: 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, @@ -1787,7 +1612,7 @@ def get_long_running_output(pipeline_response): } @distributed_trace - def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models.JobSecretsCollection: + def list_secrets(self, resource_group_name: str, **kwargs: Any) -> _models.JobSecretsCollection: """List secrets for a container apps job. List secrets for a container apps job. @@ -1795,8 +1620,6 @@ 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. - :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) :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection @@ -1818,8 +1641,8 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - request = build_list_secrets_request( resource_group_name=resource_group_name, - job_name=job_name, subscription_id=self._config.subscription_id, + job_name=self._config.job_name, api_version=api_version, template_url=self.list_secrets.metadata["url"], headers=_headers, 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..5d2bb204eca8 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..9c76e885b466 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..fc169255a30b 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL 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..3ea3685469a3 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) 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_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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..fc0ac94b0cde 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, _format_url_section 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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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-04-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -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..527f50034fdb 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, _format_url_section 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-04-01-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -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..1738002dad68 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-04-01-preview")) 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..3563efd6f2d1 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -46,6 +48,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/preview/2023-04-01-preview/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..b42666690af0 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..0aeb08ecb720 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..2a3a0a63ada4 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..acceadd38d76 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..7e6f041f1601 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -35,6 +37,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/preview/2023-04-01-preview/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..3585b73c589c 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..7ebcc3374083 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..2145194bff94 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..b92e2cd51283 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -40,6 +42,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/preview/2023-04-01-preview/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..4168acf5f1a8 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..08955eee8ecf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -38,6 +40,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/preview/2023-04-01-preview/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..c572639a07b6 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..ce98daf2416b 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..17ae707af6c0 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..22dc01b37205 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -40,6 +42,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/preview/2023-04-01-preview/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..5b45318cfeeb 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..35ae4ce3f9da 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -38,6 +40,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/preview/2023-04-01-preview/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..25050f17bba7 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -48,6 +50,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/preview/2023-04-01-preview/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..c59f04b22a80 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -53,6 +55,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/preview/2023-04-01-preview/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..943e7ce32543 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..cda9b118881c 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..c48ae04dcd6c 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..26d4b0310286 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..42093363a089 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 @@ -26,16 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..f64e57c8ca13 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..4ee8145eea68 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..588226c36152 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -34,6 +36,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/preview/2023-04-01-preview/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..e70a85e73b65 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..ad4ec559ab55 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -47,6 +49,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/preview/2023-04-01-preview/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..9bbdf74e0e55 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..8c51d42c2961 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..6120ab55f137 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..dd102dfa0208 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..1a9f57064856 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -87,6 +89,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 +130,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 +144,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/preview/2023-04-01-preview/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..7a82db505a22 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 @@ -26,16 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..4a1db03706be 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..8482b108967f 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..4a7d5be52630 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..9f43b100b8ad 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..07106571d2dc 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..9885a1bbe2e0 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -34,6 +36,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/preview/2023-04-01-preview/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..94a64e2b801b 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..a89df264ac04 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..11836767dfc7 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -73,6 +75,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/preview/2023-04-01-preview/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..060ad708b508 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -78,6 +80,7 @@ def main(): "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, + "service": {"type": "redis"}, }, "template": { "containers": [ @@ -115,6 +118,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 +132,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/preview/2023-04-01-preview/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..c69269b6f9cf --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py @@ -0,0 +1,43 @@ +# 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(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", + 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/preview/2023-04-01-preview/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..2e49e7396ee3 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py @@ -0,0 +1,43 @@ +# 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(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", + 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/preview/2023-04-01-preview/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..a77e1f0deac4 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -72,6 +74,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/preview/2023-04-01-preview/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..53935a95af91 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -53,6 +55,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/preview/2023-04-01-preview/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..f478c9a1798d 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -53,6 +55,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/preview/2023-04-01-preview/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..0d13ae5847b8 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..f42109e71e78 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..ac864a8f2757 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..06d431758346 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..af3d8de88e9b 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/examples/DaprComponents_ListSecrets.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..caedee990adb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py @@ -26,16 +26,16 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testWorkerContainerAppsJob0", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..2f0efacd83dc --- /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(), + job_name="testcontainerAppsJob0", + job_execution_name="jobExecution1", + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.job_execution( + resource_group_name="rg", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/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..b3c13e6a299c 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) response = client.jobs_executions.list( resource_group_name="rg", - job_name="testcontainerAppsJob0", ) for item in response: 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/preview/2023-04-01-preview/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..18ae0213b51b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py @@ -26,16 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) response = client.jobs.get( resource_group_name="rg", - job_name="testcontainerAppsJob0", ) 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/preview/2023-04-01-preview/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..867bb4a0a167 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 @@ -26,16 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) response = client.jobs.list_secrets( resource_group_name="rg", - job_name="testcontainerAppsJob0", ) 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/preview/2023-04-01-preview/examples/Job_ListSecrets.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..014442343093 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py @@ -26,12 +26,13 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) response = client.jobs.begin_start( resource_group_name="rg", - job_name="testcontainerAppsJob0", template={ "containers": [ { @@ -54,6 +55,6 @@ def main(): 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/preview/2023-04-01-preview/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..4eb48aa2317f 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 @@ -26,17 +26,16 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="jobExecution1", 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/preview/2023-04-01-preview/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..9dac7f116f01 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 @@ -26,23 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="testcontainerAppsJob0", + job_execution_name="{'value': [{'name': 'jobExecution-27944453'}, {'name': 'jobExecution-27944452'}, {'name': 'jobExecution-27944451'}]}", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) 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/preview/2023-04-01-preview/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..d639947ed0dd 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..ef271756a70f 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -34,6 +36,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/preview/2023-04-01-preview/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..b96a010ba3e5 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..deea28112454 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..0d8c67b50eef 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..abbf019768dc 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..e7a75474535d 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -38,6 +40,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/preview/2023-04-01-preview/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..0a7903cfb066 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..f917d118fd56 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..8871e8953006 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -42,6 +44,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 +76,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/preview/2023-04-01-preview/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..460d3c521ba2 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -74,6 +76,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/preview/2023-04-01-preview/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..66dd6e9575b6 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 @@ -26,16 +26,17 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..01ded2b9ad73 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..61f9b3468c54 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..1af0b7aa4121 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..fe09f1ed1cdd 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -34,6 +36,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/preview/2023-04-01-preview/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..557a17b37134 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..71ddfef55d80 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..fa2665db44a5 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -47,6 +49,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/preview/2023-04-01-preview/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..f47362480893 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..70375c085043 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..00ae6bebd304 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", ) @@ -36,6 +38,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/preview/2023-04-01-preview/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..0c3f5e6c50f0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="SUBSCRIPTION_ID", ) @@ -34,6 +36,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/preview/2023-04-01-preview/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..5425d7116e65 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -38,6 +40,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/preview/2023-04-01-preview/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..32b756b8c5d6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..d45a473f589d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..cdee941287e9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..74dfefdbf27d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..29f0c637d24a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..604f21ac4cf7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..10101be4bfb1 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -40,14 +42,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 +61,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/preview/2023-04-01-preview/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..e0ae9e74b652 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 @@ -26,17 +26,18 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", 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/preview/2023-04-01-preview/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..9fc3b5b0b107 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -37,6 +39,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/preview/2023-04-01-preview/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..7b8d5586c8d8 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 @@ -26,6 +26,8 @@ def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), + job_name="JOB_NAME", + job_execution_name="JOB_EXECUTION_NAME", subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", ) @@ -37,6 +39,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/preview/2023-04-01-preview/examples/SourceControls_ListByContainer.json if __name__ == "__main__": main()