diff --git a/sdk/compute/azure-mgmt-compute/_meta.json b/sdk/compute/azure-mgmt-compute/_meta.json index 73259758dfb6..3872234bca0f 100644 --- a/sdk/compute/azure-mgmt-compute/_meta.json +++ b/sdk/compute/azure-mgmt-compute/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "d5ad9431bbc19c34090d97209eb497167db32879", + "commit": "a9c7d15ec5a5f2348e4a62650821eaac04328750", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/compute/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/compute/resource-manager/readme.md" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py index fd2951c84dfd..aa7260cb65f4 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_compute_management_client.py @@ -367,6 +367,45 @@ def cloud_services_update_domain(self): raise ValueError("API version {} does not have operation group 'cloud_services_update_domain'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def community_galleries(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleriesOperations` + """ + api_version = self._get_api_version('community_galleries') + if api_version == '2021-07-01': + from .v2021_07_01.operations import CommunityGalleriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_galleries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def community_gallery_image_versions(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleryImageVersionsOperations` + """ + api_version = self._get_api_version('community_gallery_image_versions') + if api_version == '2021-07-01': + from .v2021_07_01.operations import CommunityGalleryImageVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_gallery_image_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def community_gallery_images(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleryImagesOperations` + """ + api_version = self._get_api_version('community_gallery_images') + if api_version == '2021-07-01': + from .v2021_07_01.operations import CommunityGalleryImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_gallery_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def dedicated_host_groups(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py index 63f7966007f7..86b9e584089f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/aio/_compute_management_client.py @@ -365,6 +365,45 @@ def cloud_services_update_domain(self): raise ValueError("API version {} does not have operation group 'cloud_services_update_domain'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def community_galleries(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleriesOperations` + """ + api_version = self._get_api_version('community_galleries') + if api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import CommunityGalleriesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_galleries'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def community_gallery_image_versions(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleryImageVersionsOperations` + """ + api_version = self._get_api_version('community_gallery_image_versions') + if api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import CommunityGalleryImageVersionsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_gallery_image_versions'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def community_gallery_images(self): + """Instance depends on the API version: + + * 2021-07-01: :class:`CommunityGalleryImagesOperations` + """ + api_version = self._get_api_version('community_gallery_images') + if api_version == '2021-07-01': + from ..v2021_07_01.aio.operations import CommunityGalleryImagesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'community_gallery_images'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def dedicated_host_groups(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2015_06_15/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_09_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_11_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_09_30/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_12_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py index 898fdd411115..6f72e91058d9 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_compute_management_client.py @@ -55,6 +55,9 @@ from .operations import SharedGalleriesOperations from .operations import SharedGalleryImagesOperations from .operations import SharedGalleryImageVersionsOperations +from .operations import CommunityGalleriesOperations +from .operations import CommunityGalleryImagesOperations +from .operations import CommunityGalleryImageVersionsOperations from . import models @@ -133,6 +136,12 @@ class ComputeManagementClient(object): :vartype shared_gallery_images: azure.mgmt.compute.v2021_07_01.operations.SharedGalleryImagesOperations :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations :vartype shared_gallery_image_versions: azure.mgmt.compute.v2021_07_01.operations.SharedGalleryImageVersionsOperations + :ivar community_galleries: CommunityGalleriesOperations operations + :vartype community_galleries: azure.mgmt.compute.v2021_07_01.operations.CommunityGalleriesOperations + :ivar community_gallery_images: CommunityGalleryImagesOperations operations + :vartype community_gallery_images: azure.mgmt.compute.v2021_07_01.operations.CommunityGalleryImagesOperations + :ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations + :vartype community_gallery_image_versions: azure.mgmt.compute.v2021_07_01.operations.CommunityGalleryImageVersionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -231,6 +240,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( self._client, self._config, self._serialize, self._deserialize) + self.community_galleries = CommunityGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.community_gallery_images = CommunityGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): # type: (HttpRequest, Any) -> HttpResponse diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json index 4924069df4a9..6fc3958fc14b 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_metadata.json @@ -133,6 +133,9 @@ "gallery_sharing_profile": "GallerySharingProfileOperations", "shared_galleries": "SharedGalleriesOperations", "shared_gallery_images": "SharedGalleryImagesOperations", - "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations" + "shared_gallery_image_versions": "SharedGalleryImageVersionsOperations", + "community_galleries": "CommunityGalleriesOperations", + "community_gallery_images": "CommunityGalleryImagesOperations", + "community_gallery_image_versions": "CommunityGalleryImageVersionsOperations" } } \ No newline at end of file diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py index ef35ba89b90b..e5754a47ce68 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "23.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py index dec712c9afd2..32c2c15af904 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/_compute_management_client.py @@ -53,6 +53,9 @@ from .operations import SharedGalleriesOperations from .operations import SharedGalleryImagesOperations from .operations import SharedGalleryImageVersionsOperations +from .operations import CommunityGalleriesOperations +from .operations import CommunityGalleryImagesOperations +from .operations import CommunityGalleryImageVersionsOperations from .. import models @@ -131,6 +134,12 @@ class ComputeManagementClient(object): :vartype shared_gallery_images: azure.mgmt.compute.v2021_07_01.aio.operations.SharedGalleryImagesOperations :ivar shared_gallery_image_versions: SharedGalleryImageVersionsOperations operations :vartype shared_gallery_image_versions: azure.mgmt.compute.v2021_07_01.aio.operations.SharedGalleryImageVersionsOperations + :ivar community_galleries: CommunityGalleriesOperations operations + :vartype community_galleries: azure.mgmt.compute.v2021_07_01.aio.operations.CommunityGalleriesOperations + :ivar community_gallery_images: CommunityGalleryImagesOperations operations + :vartype community_gallery_images: azure.mgmt.compute.v2021_07_01.aio.operations.CommunityGalleryImagesOperations + :ivar community_gallery_image_versions: CommunityGalleryImageVersionsOperations operations + :vartype community_gallery_image_versions: azure.mgmt.compute.v2021_07_01.aio.operations.CommunityGalleryImageVersionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. @@ -228,6 +237,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.shared_gallery_image_versions = SharedGalleryImageVersionsOperations( self._client, self._config, self._serialize, self._deserialize) + self.community_galleries = CommunityGalleriesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.community_gallery_images = CommunityGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.community_gallery_image_versions = CommunityGalleryImageVersionsOperations( + self._client, self._config, self._serialize, self._deserialize) async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py index af63734f01ef..cca9cf86cf8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/__init__.py @@ -42,6 +42,9 @@ from ._shared_galleries_operations import SharedGalleriesOperations from ._shared_gallery_images_operations import SharedGalleryImagesOperations from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations +from ._community_galleries_operations import CommunityGalleriesOperations +from ._community_gallery_images_operations import CommunityGalleryImagesOperations +from ._community_gallery_image_versions_operations import CommunityGalleryImageVersionsOperations __all__ = [ 'Operations', @@ -80,4 +83,7 @@ 'SharedGalleriesOperations', 'SharedGalleryImagesOperations', 'SharedGalleryImageVersionsOperations', + 'CommunityGalleriesOperations', + 'CommunityGalleryImagesOperations', + 'CommunityGalleryImageVersionsOperations', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py new file mode 100644 index 000000000000..a633b233dcad --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_galleries_operations.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleriesOperations: + """CommunityGalleriesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location: str, + public_gallery_name: str, + **kwargs: Any + ) -> "_models.CommunityGallery": + """Get a community gallery by gallery public name. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py new file mode 100644 index 000000000000..0d0ccc304fba --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_image_versions_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleryImageVersionsOperations: + """CommunityGalleryImageVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location: str, + public_gallery_name: str, + gallery_image_name: str, + gallery_image_version_name: str, + **kwargs: Any + ) -> "_models.CommunityGalleryImageVersion": + """Get a community gallery image version. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :param gallery_image_name: The name of the community gallery image definition. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the community gallery image version. Needs to + follow semantic version name pattern: The allowed characters are digit and period. Digits must + be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py new file mode 100644 index 000000000000..ae314e8f14ff --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/aio/operations/_community_gallery_images_operations.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleryImagesOperations: + """CommunityGalleryImagesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location: str, + public_gallery_name: str, + gallery_image_name: str, + **kwargs: Any + ) -> "_models.CommunityGalleryImage": + """Get a community gallery image. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :param gallery_image_name: The name of the community gallery image definition. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py index 5c63a367acd9..6b70bd5eb824 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/__init__.py @@ -34,6 +34,9 @@ from ._models_py3 import CapacityReservationProfile from ._models_py3 import CapacityReservationUpdate from ._models_py3 import CapacityReservationUtilization + from ._models_py3 import CommunityGallery + from ._models_py3 import CommunityGalleryImage + from ._models_py3 import CommunityGalleryImageVersion from ._models_py3 import ComputeOperationListResult from ._models_py3 import ComputeOperationValue from ._models_py3 import DataDisk @@ -122,6 +125,7 @@ from ._models_py3 import OrchestrationServiceSummary from ._models_py3 import PatchInstallationDetail from ._models_py3 import PatchSettings + from ._models_py3 import PirCommunityGalleryResource from ._models_py3 import PirResource from ._models_py3 import PirSharedGalleryResource from ._models_py3 import Plan @@ -336,6 +340,9 @@ from ._models import CapacityReservationProfile # type: ignore from ._models import CapacityReservationUpdate # type: ignore from ._models import CapacityReservationUtilization # type: ignore + from ._models import CommunityGallery # type: ignore + from ._models import CommunityGalleryImage # type: ignore + from ._models import CommunityGalleryImageVersion # type: ignore from ._models import ComputeOperationListResult # type: ignore from ._models import ComputeOperationValue # type: ignore from ._models import DataDisk # type: ignore @@ -424,6 +431,7 @@ from ._models import OrchestrationServiceSummary # type: ignore from ._models import PatchInstallationDetail # type: ignore from ._models import PatchSettings # type: ignore + from ._models import PirCommunityGalleryResource # type: ignore from ._models import PirResource # type: ignore from ._models import PirSharedGalleryResource # type: ignore from ._models import Plan # type: ignore @@ -727,6 +735,9 @@ 'CapacityReservationProfile', 'CapacityReservationUpdate', 'CapacityReservationUtilization', + 'CommunityGallery', + 'CommunityGalleryImage', + 'CommunityGalleryImageVersion', 'ComputeOperationListResult', 'ComputeOperationValue', 'DataDisk', @@ -815,6 +826,7 @@ 'OrchestrationServiceSummary', 'PatchInstallationDetail', 'PatchSettings', + 'PirCommunityGalleryResource', 'PirResource', 'PirSharedGalleryResource', 'Plan', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py index 9d5f904cd057..67b8d6119e4f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models.py @@ -1085,6 +1085,205 @@ def __init__( self.virtual_machines_allocated = None +class PirCommunityGalleryResource(msrest.serialization.Model): + """Base information about the community gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PirCommunityGalleryResource, self).__init__(**kwargs) + self.name = None + self.location = None + self.type = None + self.unique_id = kwargs.get('unique_id', None) + + +class CommunityGallery(PirCommunityGalleryResource): + """Specifies information about the Community Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunityGallery, self).__init__(**kwargs) + + +class CommunityGalleryImage(PirCommunityGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunityGalleryImage, self).__init__(**kwargs) + self.os_type = kwargs.get('os_type', None) + self.os_state = kwargs.get('os_state', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.identifier = kwargs.get('identifier', None) + self.recommended = kwargs.get('recommended', None) + self.disallowed = kwargs.get('disallowed', None) + self.hyper_v_generation = kwargs.get('hyper_v_generation', None) + self.features = kwargs.get('features', None) + self.purchase_plan = kwargs.get('purchase_plan', None) + + +class CommunityGalleryImageVersion(PirCommunityGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunityGalleryImageVersion, self).__init__(**kwargs) + self.published_date = kwargs.get('published_date', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + + class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py index e550e2f6f69c..9a9e58ab2298 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/models/_models_py3.py @@ -1176,6 +1176,224 @@ def __init__( self.virtual_machines_allocated = None +class PirCommunityGalleryResource(msrest.serialization.Model): + """Base information about the community gallery resource in pir. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(PirCommunityGalleryResource, self).__init__(**kwargs) + self.name = None + self.location = None + self.type = None + self.unique_id = unique_id + + +class CommunityGallery(PirCommunityGalleryResource): + """Specifies information about the Community Gallery that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + **kwargs + ): + super(CommunityGallery, self).__init__(unique_id=unique_id, **kwargs) + + +class CommunityGalleryImage(PirCommunityGalleryResource): + """Specifies information about the gallery image definition that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + :param os_type: This property allows you to specify the type of the OS that is included in the + disk when creating a VM from a managed image. :code:`
`:code:`
` Possible values are: + :code:`
`:code:`
` **Windows** :code:`
`:code:`
` **Linux**. Possible values + include: "Windows", "Linux". + :type os_type: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemTypes + :param os_state: This property allows the user to specify whether the virtual machines created + under this image are 'Generalized' or 'Specialized'. Possible values include: "Generalized", + "Specialized". + :type os_state: str or ~azure.mgmt.compute.v2021_07_01.models.OperatingSystemStateTypes + :param end_of_life_date: The end of life date of the gallery image definition. This property + can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + :param identifier: This is the gallery image definition identifier. + :type identifier: ~azure.mgmt.compute.v2021_07_01.models.GalleryImageIdentifier + :param recommended: The properties describe the recommended machine configuration for this + Image Definition. These properties are updatable. + :type recommended: ~azure.mgmt.compute.v2021_07_01.models.RecommendedMachineConfiguration + :param disallowed: Describes the disallowed disk types. + :type disallowed: ~azure.mgmt.compute.v2021_07_01.models.Disallowed + :param hyper_v_generation: The hypervisor generation of the Virtual Machine. Applicable to OS + disks only. Possible values include: "V1", "V2". + :type hyper_v_generation: str or ~azure.mgmt.compute.v2021_07_01.models.HyperVGeneration + :param features: A list of gallery image features. + :type features: list[~azure.mgmt.compute.v2021_07_01.models.GalleryImageFeature] + :param purchase_plan: Describes the gallery image definition purchase plan. This is used by + marketplace images. + :type purchase_plan: ~azure.mgmt.compute.v2021_07_01.models.ImagePurchasePlan + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'os_type': {'key': 'properties.osType', 'type': 'str'}, + 'os_state': {'key': 'properties.osState', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'}, + 'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'}, + 'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'}, + 'hyper_v_generation': {'key': 'properties.hyperVGeneration', 'type': 'str'}, + 'features': {'key': 'properties.features', 'type': '[GalleryImageFeature]'}, + 'purchase_plan': {'key': 'properties.purchasePlan', 'type': 'ImagePurchasePlan'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + os_type: Optional[Union[str, "OperatingSystemTypes"]] = None, + os_state: Optional[Union[str, "OperatingSystemStateTypes"]] = None, + end_of_life_date: Optional[datetime.datetime] = None, + identifier: Optional["GalleryImageIdentifier"] = None, + recommended: Optional["RecommendedMachineConfiguration"] = None, + disallowed: Optional["Disallowed"] = None, + hyper_v_generation: Optional[Union[str, "HyperVGeneration"]] = None, + features: Optional[List["GalleryImageFeature"]] = None, + purchase_plan: Optional["ImagePurchasePlan"] = None, + **kwargs + ): + super(CommunityGalleryImage, self).__init__(unique_id=unique_id, **kwargs) + self.os_type = os_type + self.os_state = os_state + self.end_of_life_date = end_of_life_date + self.identifier = identifier + self.recommended = recommended + self.disallowed = disallowed + self.hyper_v_generation = hyper_v_generation + self.features = features + self.purchase_plan = purchase_plan + + +class CommunityGalleryImageVersion(PirCommunityGalleryResource): + """Specifies information about the gallery image version that you want to create or update. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Resource name. + :vartype name: str + :ivar location: Resource location. + :vartype location: str + :ivar type: Resource type. + :vartype type: str + :param unique_id: The unique id of this community gallery. + :type unique_id: str + :param published_date: The published date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type published_date: ~datetime.datetime + :param end_of_life_date: The end of life date of the gallery image version Definition. This + property can be used for decommissioning purposes. This property is updatable. + :type end_of_life_date: ~datetime.datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'unique_id': {'key': 'identifier.uniqueId', 'type': 'str'}, + 'published_date': {'key': 'properties.publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + unique_id: Optional[str] = None, + published_date: Optional[datetime.datetime] = None, + end_of_life_date: Optional[datetime.datetime] = None, + **kwargs + ): + super(CommunityGalleryImageVersion, self).__init__(unique_id=unique_id, **kwargs) + self.published_date = published_date + self.end_of_life_date = end_of_life_date + + class ComputeOperationListResult(msrest.serialization.Model): """The List Compute Operation operation response. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py index af63734f01ef..cca9cf86cf8d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/__init__.py @@ -42,6 +42,9 @@ from ._shared_galleries_operations import SharedGalleriesOperations from ._shared_gallery_images_operations import SharedGalleryImagesOperations from ._shared_gallery_image_versions_operations import SharedGalleryImageVersionsOperations +from ._community_galleries_operations import CommunityGalleriesOperations +from ._community_gallery_images_operations import CommunityGalleryImagesOperations +from ._community_gallery_image_versions_operations import CommunityGalleryImageVersionsOperations __all__ = [ 'Operations', @@ -80,4 +83,7 @@ 'SharedGalleriesOperations', 'SharedGalleryImagesOperations', 'SharedGalleryImageVersionsOperations', + 'CommunityGalleriesOperations', + 'CommunityGalleryImagesOperations', + 'CommunityGalleryImageVersionsOperations', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py new file mode 100644 index 000000000000..16a13033a942 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_galleries_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleriesOperations(object): + """CommunityGalleriesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location, # type: str + public_gallery_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CommunityGallery" + """Get a community gallery by gallery public name. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGallery, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGallery + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGallery"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGallery', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py new file mode 100644 index 000000000000..8a076425e5a3 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_image_versions_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleryImageVersionsOperations(object): + """CommunityGalleryImageVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location, # type: str + public_gallery_name, # type: str + gallery_image_name, # type: str + gallery_image_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CommunityGalleryImageVersion" + """Get a community gallery image version. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :param gallery_image_name: The name of the community gallery image definition. + :type gallery_image_name: str + :param gallery_image_version_name: The name of the community gallery image version. Needs to + follow semantic version name pattern: The allowed characters are digit and period. Digits must + be within the range of a 32-bit integer. Format: + :code:``.:code:``.:code:``. + :type gallery_image_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGalleryImageVersion, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGalleryImageVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGalleryImageVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + 'galleryImageVersionName': self._serialize.url("gallery_image_version_name", gallery_image_version_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGalleryImageVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}'} # type: ignore diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py new file mode 100644 index 000000000000..653ad9145742 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_07_01/operations/_community_gallery_images_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class CommunityGalleryImagesOperations(object): + """CommunityGalleryImagesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.compute.v2021_07_01.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location, # type: str + public_gallery_name, # type: str + gallery_image_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CommunityGalleryImage" + """Get a community gallery image. + + :param location: Resource location. + :type location: str + :param public_gallery_name: The public name of the community gallery. + :type public_gallery_name: str + :param gallery_image_name: The name of the community gallery image definition. + :type gallery_image_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CommunityGalleryImage, or the result of cls(response) + :rtype: ~azure.mgmt.compute.v2021_07_01.models.CommunityGalleryImage + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CommunityGalleryImage"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'publicGalleryName': self._serialize.url("public_gallery_name", public_gallery_name, 'str'), + 'galleryImageName': self._serialize.url("gallery_image_name", gallery_image_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CommunityGalleryImage', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}'} # type: ignore