From a991d8200914c4e6cdf81aa05fcc3d88512052b3 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 16 Feb 2023 03:11:40 -0500 Subject: [PATCH] [AutoRelease] t2-msi-2023-02-16-74257(can only be merged by SDK owner) (#28846) * code and test * update version --------- Co-authored-by: PythonSdkPipelines Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) --- sdk/resources/azure-mgmt-msi/CHANGELOG.md | 7 +++ sdk/resources/azure-mgmt-msi/_meta.json | 6 +-- .../azure-mgmt-msi/azure/mgmt/msi/_version.py | 2 +- .../_managed_service_identity_client.py | 2 +- .../azure/mgmt/msi/v2018_11_30/_version.py | 2 +- .../aio/_managed_service_identity_client.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- .../_user_assigned_identities_operations.py | 8 +-- .../_managed_service_identity_client.py | 2 +- .../mgmt/msi/v2021_09_30_preview/_version.py | 2 +- .../aio/_managed_service_identity_client.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- .../_user_assigned_identities_operations.py | 8 +-- .../_managed_service_identity_client.py | 2 +- .../mgmt/msi/v2022_01_31_preview/_version.py | 2 +- .../aio/_managed_service_identity_client.py | 2 +- ...derated_identity_credentials_operations.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- ...derated_identity_credentials_operations.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- .../_managed_service_identity_client.py | 2 +- .../azure/mgmt/msi/v2023_01_31/_version.py | 2 +- .../aio/_managed_service_identity_client.py | 2 +- ...derated_identity_credentials_operations.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- ...derated_identity_credentials_operations.py | 2 +- .../_user_assigned_identities_operations.py | 8 +-- .../federated_identity_credential_create.py | 49 +++++++++++++++++++ .../federated_identity_credential_delete.py | 42 ++++++++++++++++ .../federated_identity_credential_get.py | 42 ++++++++++++++++ .../federated_identity_credential_list.py | 42 ++++++++++++++++ .../generated_samples/identity_create.py | 42 ++++++++++++++++ .../generated_samples/identity_delete.py | 41 ++++++++++++++++ .../generated_samples/identity_get.py | 41 ++++++++++++++++ .../identity_list_by_resource_group.py | 41 ++++++++++++++++ .../identity_list_by_subscription.py | 39 +++++++++++++++ .../generated_samples/identity_update.py | 42 ++++++++++++++++ .../generated_samples/msi_operations_list.py | 39 +++++++++++++++ .../system_assigned_identity_get.py | 40 +++++++++++++++ 39 files changed, 559 insertions(+), 52 deletions(-) create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_create.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_delete.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_get.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_list.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_create.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_delete.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_get.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_resource_group.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_subscription.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/identity_update.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/msi_operations_list.py create mode 100644 sdk/resources/azure-mgmt-msi/generated_samples/system_assigned_identity_get.py diff --git a/sdk/resources/azure-mgmt-msi/CHANGELOG.md b/sdk/resources/azure-mgmt-msi/CHANGELOG.md index a28bb1f87050..d40c5d752ea3 100644 --- a/sdk/resources/azure-mgmt-msi/CHANGELOG.md +++ b/sdk/resources/azure-mgmt-msi/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 7.1.0b1 (2023-02-16) + +### Other Changes + + - Added generated samples in github repo + - Drop support for python<3.7.0 + ## 7.0.0 (2023-02-02) ### Features Added diff --git a/sdk/resources/azure-mgmt-msi/_meta.json b/sdk/resources/azure-mgmt-msi/_meta.json index d0c1f24451b8..d0e866245b78 100644 --- a/sdk/resources/azure-mgmt-msi/_meta.json +++ b/sdk/resources/azure-mgmt-msi/_meta.json @@ -1,11 +1,11 @@ { - "commit": "3d7a3848106b831a4a7f46976fe38aa605c4f44d", + "commit": "51d4c24a011e300b9713179e0515fef35bf3f678", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.2.16", + "@autorest/python@6.4.0", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/msi/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.2.16 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/msi/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.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/msi/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_version.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_version.py index 364f3c906cf9..d00e82dfabad 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_version.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "7.1.0b1" diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_managed_service_identity_client.py index 900887024743..b8ce7a54d011 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_managed_service_identity_client.py @@ -97,5 +97,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_version.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_version.py index 364f3c906cf9..d00e82dfabad 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_version.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "7.1.0b1" diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/_managed_service_identity_client.py index e2015a2068c6..91d8c3375b2a 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/_managed_service_identity_client.py @@ -97,5 +97,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/operations/_user_assigned_identities_operations.py index 328ea1bba0b5..d329295cfc5d 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/aio/operations/_user_assigned_identities_operations.py @@ -298,8 +298,8 @@ async def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2018_11_30.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -439,8 +439,8 @@ async def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2018_11_30.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/operations/_user_assigned_identities_operations.py index 70dacc324bf3..4fcbafc9aa71 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2018_11_30/operations/_user_assigned_identities_operations.py @@ -475,8 +475,8 @@ def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2018_11_30.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -616,8 +616,8 @@ def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2018_11_30.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_managed_service_identity_client.py index 73ee67121aff..e3d32bf1c259 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_managed_service_identity_client.py @@ -97,5 +97,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_version.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_version.py index 364f3c906cf9..d00e82dfabad 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_version.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "7.1.0b1" diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/_managed_service_identity_client.py index 11a64d3b649b..0d02776795f1 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/_managed_service_identity_client.py @@ -97,5 +97,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/operations/_user_assigned_identities_operations.py index 0621c2b9a153..23b25ed05f5f 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/aio/operations/_user_assigned_identities_operations.py @@ -424,8 +424,8 @@ async def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -567,8 +567,8 @@ async def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/operations/_user_assigned_identities_operations.py index bc499c39312e..cf1ceb330436 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2021_09_30_preview/operations/_user_assigned_identities_operations.py @@ -661,8 +661,8 @@ def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -804,8 +804,8 @@ def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2021_09_30_preview.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_managed_service_identity_client.py index 362a1ba6d279..20d32ad4e09a 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_managed_service_identity_client.py @@ -108,5 +108,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_version.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_version.py index 364f3c906cf9..d00e82dfabad 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_version.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "7.1.0b1" diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/_managed_service_identity_client.py index fe425cc90822..0b8246d5fe6a 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/_managed_service_identity_client.py @@ -108,5 +108,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_federated_identity_credentials_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_federated_identity_credentials_operations.py index e03b94361ab5..b83d0692e328 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_federated_identity_credentials_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_federated_identity_credentials_operations.py @@ -255,7 +255,7 @@ async def create_or_update( credential resource. Required. :type federated_identity_credential_resource_name: str :param parameters: Parameters to create or update the federated identity credential. Is either - a model type or a IO type. Required. + a FederatedIdentityCredential type or a IO type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.FederatedIdentityCredential or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_user_assigned_identities_operations.py index 921aa2af9882..8d2f7c6791ac 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/aio/operations/_user_assigned_identities_operations.py @@ -424,8 +424,8 @@ async def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -567,8 +567,8 @@ async def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_federated_identity_credentials_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_federated_identity_credentials_operations.py index 477fe7276da9..52bc8e786ad8 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_federated_identity_credentials_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_federated_identity_credentials_operations.py @@ -418,7 +418,7 @@ def create_or_update( credential resource. Required. :type federated_identity_credential_resource_name: str :param parameters: Parameters to create or update the federated identity credential. Is either - a model type or a IO type. Required. + a FederatedIdentityCredential type or a IO type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.FederatedIdentityCredential or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_user_assigned_identities_operations.py index d2b760d63c8e..1845c81b6b99 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2022_01_31_preview/operations/_user_assigned_identities_operations.py @@ -661,8 +661,8 @@ def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -804,8 +804,8 @@ def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2022_01_31_preview.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_managed_service_identity_client.py index dfe5d04ee346..52f8d05b35e0 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_managed_service_identity_client.py @@ -108,5 +108,5 @@ def __enter__(self) -> "ManagedServiceIdentityClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_version.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_version.py index 364f3c906cf9..d00e82dfabad 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_version.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "7.1.0b1" diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/_managed_service_identity_client.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/_managed_service_identity_client.py index 200291d1e8c8..c679f7b0df78 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/_managed_service_identity_client.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/_managed_service_identity_client.py @@ -108,5 +108,5 @@ async def __aenter__(self) -> "ManagedServiceIdentityClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_federated_identity_credentials_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_federated_identity_credentials_operations.py index d81690730ea4..8ffad7efe711 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_federated_identity_credentials_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_federated_identity_credentials_operations.py @@ -253,7 +253,7 @@ async def create_or_update( credential resource. Required. :type federated_identity_credential_resource_name: str :param parameters: Parameters to create or update the federated identity credential. Is either - a model type or a IO type. Required. + a FederatedIdentityCredential type or a IO type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.FederatedIdentityCredential or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_user_assigned_identities_operations.py index c923b5ad9535..09056320a66f 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/aio/operations/_user_assigned_identities_operations.py @@ -298,8 +298,8 @@ async def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -439,8 +439,8 @@ async def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_federated_identity_credentials_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_federated_identity_credentials_operations.py index bc9ce06c48a4..91bbc01876f4 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_federated_identity_credentials_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_federated_identity_credentials_operations.py @@ -425,7 +425,7 @@ def create_or_update( credential resource. Required. :type federated_identity_credential_resource_name: str :param parameters: Parameters to create or update the federated identity credential. Is either - a model type or a IO type. Required. + a FederatedIdentityCredential type or a IO type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.FederatedIdentityCredential or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_user_assigned_identities_operations.py b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_user_assigned_identities_operations.py index 3552fff7c725..7de2659de99a 100644 --- a/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_user_assigned_identities_operations.py +++ b/sdk/resources/azure-mgmt-msi/azure/mgmt/msi/v2023_01_31/operations/_user_assigned_identities_operations.py @@ -475,8 +475,8 @@ def create_or_update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to create or update the identity. Is either a model type or a IO - type. Required. + :param parameters: Parameters to create or update the identity. Is either a Identity type or a + IO type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.Identity or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -616,8 +616,8 @@ def update( :type resource_group_name: str :param resource_name: The name of the identity resource. Required. :type resource_name: str - :param parameters: Parameters to update the identity. Is either a model type or a IO type. - Required. + :param parameters: Parameters to update the identity. Is either a IdentityUpdate type or a IO + type. Required. :type parameters: ~azure.mgmt.msi.v2023_01_31.models.IdentityUpdate or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_create.py b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_create.py new file mode 100644 index 000000000000..d29987c1e946 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_create.py @@ -0,0 +1,49 @@ +# 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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python federated_identity_credential_create.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5", + ) + + response = client.federated_identity_credentials.create_or_update( + resource_group_name="rgName", + resource_name="resourceName", + federated_identity_credential_resource_name="ficResourceName", + parameters={ + "properties": { + "audiences": ["api://AzureADTokenExchange"], + "issuer": "https://oidc.prod-aks.azure.com/TenantGUID/IssuerGUID", + "subject": "system:serviceaccount:ns:svcaccount", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_delete.py b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_delete.py new file mode 100644 index 000000000000..6d58d618c929 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_delete.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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python federated_identity_credential_delete.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5", + ) + + response = client.federated_identity_credentials.delete( + resource_group_name="rgName", + resource_name="resourceName", + federated_identity_credential_resource_name="ficResourceName", + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_get.py b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_get.py new file mode 100644 index 000000000000..6caae283a4ef --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python federated_identity_credential_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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5", + ) + + response = client.federated_identity_credentials.get( + resource_group_name="rgName", + resource_name="resourceName", + federated_identity_credential_resource_name="ficResourceName", + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialGet.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_list.py b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_list.py new file mode 100644 index 000000000000..981cdad844ce --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/federated_identity_credential_list.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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python federated_identity_credential_list.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="c267c0e7-0a73-4789-9e17-d26aeb0904e5", + ) + + response = client.federated_identity_credentials.list( + resource_group_name="rgName", + resource_name="resourceName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/FederatedIdentityCredentialList.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_create.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_create.py new file mode 100644 index 000000000000..2ef50936b846 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_create.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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_create.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.create_or_update( + resource_group_name="rgName", + resource_name="resourceName", + parameters={"location": "eastus", "tags": {"key1": "value1", "key2": "value2"}}, + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_delete.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_delete.py new file mode 100644 index 000000000000..443714cec665 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_delete.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.delete( + resource_group_name="rgName", + resource_name="resourceName", + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_get.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_get.py new file mode 100644 index 000000000000..c84cf6c87cd9 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_get.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.get( + resource_group_name="rgName", + resource_name="resourceName", + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityGet.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_resource_group.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_resource_group.py new file mode 100644 index 000000000000..6c5a965d1479 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_resource_group.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_list_by_resource_group.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.list_by_resource_group( + resource_group_name="rgName", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_subscription.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_subscription.py new file mode 100644 index 000000000000..f63c85b91cf1 --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_list_by_subscription.py @@ -0,0 +1,39 @@ +# 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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_list_by_subscription.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/identity_update.py b/sdk/resources/azure-mgmt-msi/generated_samples/identity_update.py new file mode 100644 index 000000000000..19f4fd2ab2cc --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/identity_update.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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python identity_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.user_assigned_identities.update( + resource_group_name="rgName", + resource_name="resourceName", + parameters={"location": "eastus", "tags": {"key1": "value1", "key2": "value2"}}, + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/IdentityUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/msi_operations_list.py b/sdk/resources/azure-mgmt-msi/generated_samples/msi_operations_list.py new file mode 100644 index 000000000000..89015f5e744a --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/msi_operations_list.py @@ -0,0 +1,39 @@ +# 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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python msi_operations_list.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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/MsiOperationsList.json +if __name__ == "__main__": + main() diff --git a/sdk/resources/azure-mgmt-msi/generated_samples/system_assigned_identity_get.py b/sdk/resources/azure-mgmt-msi/generated_samples/system_assigned_identity_get.py new file mode 100644 index 000000000000..172180ab2abc --- /dev/null +++ b/sdk/resources/azure-mgmt-msi/generated_samples/system_assigned_identity_get.py @@ -0,0 +1,40 @@ +# 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.msi import ManagedServiceIdentityClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-msi +# USAGE + python system_assigned_identity_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 = ManagedServiceIdentityClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.system_assigned_identities.get_by_scope( + scope="scope", + ) + print(response) + + +# x-ms-original-file: specification/msi/resource-manager/Microsoft.ManagedIdentity/stable/2023-01-31/examples/SystemAssignedIdentityGet.json +if __name__ == "__main__": + main()