From bc02ef2abcef82c691d4af0f5bb0c37333a82daf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 9 Jul 2019 19:00:59 +0000 Subject: [PATCH 1/2] Generated from 46c41c8144620cf4589763fc14b57b3eef555edf Make hyperVGeneration field same as DiskRPs --- .../compute/_compute_management_client.py | 28 ++ .../v2019_03_01/_compute_management_client.py | 10 + .../compute/v2019_03_01/models/__init__.py | 20 +- .../_compute_management_client_enums.py | 12 +- .../compute/v2019_03_01/models/_models.py | 274 +++++++++++- .../compute/v2019_03_01/models/_models_py3.py | 278 +++++++++++- .../v2019_03_01/models/_paged_models.py | 26 ++ .../v2019_03_01/operations/__init__.py | 4 + ...gallery_application_versions_operations.py | 408 ++++++++++++++++++ .../_gallery_applications_operations.py | 380 ++++++++++++++++ 10 files changed, 1404 insertions(+), 36 deletions(-) create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py create mode 100644 sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py 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 8c511c8e9d8f..d7b57295c524 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 @@ -56,6 +56,8 @@ class ComputeManagementClient(MultiApiClientMixin, SDKClient): 'dedicated_hosts': '2019-03-01', 'disks': '2018-09-30', 'galleries': '2019-03-01', + 'gallery_application_versions': '2019-03-01', + 'gallery_applications': '2019-03-01', 'gallery_image_versions': '2019-03-01', 'gallery_images': '2019-03-01', 'images': '2019-03-01', @@ -250,6 +252,32 @@ def galleries(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def gallery_application_versions(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`GalleryApplicationVersionsOperations` + """ + api_version = self._get_api_version('gallery_application_versions') + if api_version == '2019-03-01': + from .v2019_03_01.operations import GalleryApplicationVersionsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def gallery_applications(self): + """Instance depends on the API version: + + * 2019-03-01: :class:`GalleryApplicationsOperations` + """ + api_version = self._get_api_version('gallery_applications') + if api_version == '2019-03-01': + from .v2019_03_01.operations import GalleryApplicationsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def gallery_image_versions(self): """Instance depends on the API version: diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py index 4475b04fd8b7..ebbe6a2aeeab 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/_compute_management_client.py @@ -34,6 +34,8 @@ from .operations import GalleriesOperations from .operations import GalleryImagesOperations from .operations import GalleryImageVersionsOperations +from .operations import GalleryApplicationsOperations +from .operations import GalleryApplicationVersionsOperations from . import models @@ -85,6 +87,10 @@ class ComputeManagementClient(SDKClient): :vartype gallery_images: azure.mgmt.compute.v2019_03_01.operations.GalleryImagesOperations :ivar gallery_image_versions: GalleryImageVersions operations :vartype gallery_image_versions: azure.mgmt.compute.v2019_03_01.operations.GalleryImageVersionsOperations + :ivar gallery_applications: GalleryApplications operations + :vartype gallery_applications: azure.mgmt.compute.v2019_03_01.operations.GalleryApplicationsOperations + :ivar gallery_application_versions: GalleryApplicationVersions operations + :vartype gallery_application_versions: azure.mgmt.compute.v2019_03_01.operations.GalleryApplicationVersionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -149,3 +155,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.gallery_image_versions = GalleryImageVersionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.gallery_applications = GalleryApplicationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.gallery_application_versions = GalleryApplicationVersionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index 0bce11e698dd..d055c2c8e54a 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -38,6 +38,9 @@ from ._models_py3 import DiskEncryptionSettings from ._models_py3 import DiskInstanceView from ._models_py3 import Gallery + from ._models_py3 import GalleryApplication + from ._models_py3 import GalleryApplicationVersion + from ._models_py3 import GalleryApplicationVersionPublishingProfile from ._models_py3 import GalleryArtifactPublishingProfileBase from ._models_py3 import GalleryArtifactSource from ._models_py3 import GalleryDataDiskImage @@ -110,6 +113,7 @@ from ._models_py3 import UpgradePolicy from ._models_py3 import Usage from ._models_py3 import UsageName + from ._models_py3 import UserArtifactSource from ._models_py3 import VaultCertificate from ._models_py3 import VaultSecretGroup from ._models_py3 import VirtualHardDisk @@ -206,6 +210,9 @@ from ._models import DiskEncryptionSettings from ._models import DiskInstanceView from ._models import Gallery + from ._models import GalleryApplication + from ._models import GalleryApplicationVersion + from ._models import GalleryApplicationVersionPublishingProfile from ._models import GalleryArtifactPublishingProfileBase from ._models import GalleryArtifactSource from ._models import GalleryDataDiskImage @@ -278,6 +285,7 @@ from ._models import UpgradePolicy from ._models import Usage from ._models import UsageName + from ._models import UserArtifactSource from ._models import VaultCertificate from ._models import VaultSecretGroup from ._models import VirtualHardDisk @@ -349,6 +357,8 @@ from ._paged_models import ComputeOperationValuePaged from ._paged_models import DedicatedHostGroupPaged from ._paged_models import DedicatedHostPaged +from ._paged_models import GalleryApplicationPaged +from ._paged_models import GalleryApplicationVersionPaged from ._paged_models import GalleryImagePaged from ._paged_models import GalleryImageVersionPaged from ._paged_models import GalleryPaged @@ -393,9 +403,9 @@ RollingUpgradeStatusCode, RollingUpgradeActionType, IntervalInMins, - StorageAccountType, AggregatedReplicationState, ReplicationState, + StorageAccountType, HostCaching, InstanceViewTypes, ReplicationStatusTypes, @@ -430,6 +440,9 @@ 'DiskEncryptionSettings', 'DiskInstanceView', 'Gallery', + 'GalleryApplication', + 'GalleryApplicationVersion', + 'GalleryApplicationVersionPublishingProfile', 'GalleryArtifactPublishingProfileBase', 'GalleryArtifactSource', 'GalleryDataDiskImage', @@ -502,6 +515,7 @@ 'UpgradePolicy', 'Usage', 'UsageName', + 'UserArtifactSource', 'VaultCertificate', 'VaultSecretGroup', 'VirtualHardDisk', @@ -587,6 +601,8 @@ 'GalleryPaged', 'GalleryImagePaged', 'GalleryImageVersionPaged', + 'GalleryApplicationPaged', + 'GalleryApplicationVersionPaged', 'HyperVGenerationTypes', 'StatusLevelTypes', 'AvailabilitySetSkuTypes', @@ -616,9 +632,9 @@ 'RollingUpgradeStatusCode', 'RollingUpgradeActionType', 'IntervalInMins', - 'StorageAccountType', 'AggregatedReplicationState', 'ReplicationState', + 'StorageAccountType', 'HostCaching', 'InstanceViewTypes', 'ReplicationStatusTypes', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py index 5f392df31f9c..37b80e93be0f 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_compute_management_client_enums.py @@ -365,12 +365,6 @@ class IntervalInMins(str, Enum): sixty_mins = "SixtyMins" -class StorageAccountType(str, Enum): - - standard_lrs = "Standard_LRS" - standard_zrs = "Standard_ZRS" - - class AggregatedReplicationState(str, Enum): unknown = "Unknown" @@ -387,6 +381,12 @@ class ReplicationState(str, Enum): failed = "Failed" +class StorageAccountType(str, Enum): + + standard_lrs = "Standard_LRS" + standard_zrs = "Standard_ZRS" + + class HostCaching(str, Enum): none = "None" diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index 6241e93d03fc..b0e0d1665230 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -1178,32 +1178,256 @@ def __init__(self, **kwargs): self.provisioning_state = None +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you + want to create or update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition + resource. This property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application + Definition. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param supported_os_type: Required. This property allows you to specify + the supported type of the OS that application is built for.

+ Possible values are:

**Windows**

**Linux**. Possible + values include: 'Windows', 'Linux' + :type supported_os_type: str or + ~azure.mgmt.compute.v2019_03_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'supported_os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, **kwargs): + super(GalleryApplication, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.eula = kwargs.get('eula', None) + self.privacy_statement_uri = kwargs.get('privacy_statement_uri', None) + self.release_note_uri = kwargs.get('release_note_uri', None) + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.supported_os_type = kwargs.get('supported_os_type', None) + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want + to create or update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param publishing_profile: Required. + :type publishing_profile: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The current state of the gallery Application + Version. The provisioning state, which only appears in the response. + Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + 'Deleting', 'Migrating' + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2019_03_01.models.enum + :ivar replication_status: + :vartype replication_status: + ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'publishing_profile': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__(self, **kwargs): + super(GalleryApplicationVersion, self).__init__(**kwargs) + self.publishing_profile = kwargs.get('publishing_profile', None) + self.provisioning_state = None + self.replication_status = None + + class GalleryArtifactPublishingProfileBase(Model): """Describes the basic gallery artifact publishing profile. + Variables are only populated by the server, and will be ignored when + sending a request. + + :param target_regions: The target regions where the Image Version is going + to be replicated to. This property is updatable. + :type target_regions: + list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be + created per region. This property would take effect for a region when + regionalReplicaCount is not specified. This property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from + the latest version of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery Image Version is + published. + :vartype published_date: datetime + :param end_of_life_date: The end of life date of the gallery Image + Version. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param storage_account_type: Specifies the storage account type to be used + to store the image. This property is not updatable. Possible values + include: 'Standard_LRS', 'Standard_ZRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = kwargs.get('target_regions', None) + self.replica_count = kwargs.get('replica_count', None) + self.exclude_from_latest = kwargs.get('exclude_from_latest', None) + self.published_date = None + self.end_of_life_date = kwargs.get('end_of_life_date', None) + self.storage_account_type = kwargs.get('storage_account_type', None) + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery Image Version. + + Variables are only populated by the server, and will be ignored when + sending a request. + All required parameters must be populated in order to send to Azure. :param target_regions: The target regions where the Image Version is going to be replicated to. This property is updatable. :type target_regions: list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be + created per region. This property would take effect for a region when + regionalReplicaCount is not specified. This property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from + the latest version of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery Image Version is + published. + :vartype published_date: datetime + :param end_of_life_date: The end of life date of the gallery Image + Version. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param storage_account_type: Specifies the storage account type to be used + to store the image. This property is not updatable. Possible values + include: 'Standard_LRS', 'Standard_ZRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType :param source: Required. - :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource + :type source: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactSource + :param content_type: Optional. May be used to help process this file. The + type of file contained in the source, e.g. zip, json, etc. + :type content_type: str + :param enable_health_check: Optional. Whether or not this application + reports health. + :type enable_health_check: bool """ _validation = { + 'published_date': {'readonly': True}, 'source': {'required': True}, } _attribute_map = { 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } def __init__(self, **kwargs): - super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) - self.target_regions = kwargs.get('target_regions', None) + super(GalleryApplicationVersionPublishingProfile, self).__init__(**kwargs) self.source = kwargs.get('source', None) + self.content_type = kwargs.get('content_type', None) + self.enable_health_check = kwargs.get('enable_health_check', None) class GalleryArtifactSource(Model): @@ -1543,8 +1767,6 @@ class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase) to be replicated to. This property is updatable. :type target_regions: list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] - :param source: Required. - :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource :param replica_count: The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. @@ -1564,30 +1786,28 @@ class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase) include: 'Standard_LRS', 'Standard_ZRS' :type storage_account_type: str or ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType + :param source: Required. + :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource """ _validation = { - 'source': {'required': True}, 'published_date': {'readonly': True}, + 'source': {'required': True}, } _attribute_map = { 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, 'replica_count': {'key': 'replicaCount', 'type': 'int'}, 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, } def __init__(self, **kwargs): super(GalleryImageVersionPublishingProfile, self).__init__(**kwargs) - self.replica_count = kwargs.get('replica_count', None) - self.exclude_from_latest = kwargs.get('exclude_from_latest', None) - self.published_date = None - self.end_of_life_date = kwargs.get('end_of_life_date', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.source = kwargs.get('source', None) class GalleryImageVersionStorageProfile(Model): @@ -3855,6 +4075,34 @@ def __init__(self, **kwargs): self.localized_value = kwargs.get('localized_value', None) +class UserArtifactSource(Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param file_name: Required. Required. The fileName of the artifact. + :type file_name: str + :param media_link: Required. Required. The mediaLink of the artifact, must + be a readable storage blob. + :type media_link: str + """ + + _validation = { + 'file_name': {'required': True}, + 'media_link': {'required': True}, + } + + _attribute_map = { + 'file_name': {'key': 'fileName', 'type': 'str'}, + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserArtifactSource, self).__init__(**kwargs) + self.file_name = kwargs.get('file_name', None) + self.media_link = kwargs.get('media_link', None) + + class VaultCertificate(Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index ae0a36286ed9..75f0cf27ed2d 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -1178,32 +1178,256 @@ def __init__(self, *, location: str, tags=None, description: str=None, identifie self.provisioning_state = None +class GalleryApplication(Resource): + """Specifies information about the gallery Application Definition that you + want to create or update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param description: The description of this gallery Application Definition + resource. This property is updatable. + :type description: str + :param eula: The Eula agreement for the gallery Application Definition. + :type eula: str + :param privacy_statement_uri: The privacy statement uri. + :type privacy_statement_uri: str + :param release_note_uri: The release note uri. + :type release_note_uri: str + :param end_of_life_date: The end of life date of the gallery Application + Definition. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param supported_os_type: Required. This property allows you to specify + the supported type of the OS that application is built for.

+ Possible values are:

**Windows**

**Linux**. Possible + values include: 'Windows', 'Linux' + :type supported_os_type: str or + ~azure.mgmt.compute.v2019_03_01.models.OperatingSystemTypes + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'supported_os_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'eula': {'key': 'properties.eula', 'type': 'str'}, + 'privacy_statement_uri': {'key': 'properties.privacyStatementUri', 'type': 'str'}, + 'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'}, + 'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'}, + 'supported_os_type': {'key': 'properties.supportedOSType', 'type': 'OperatingSystemTypes'}, + } + + def __init__(self, *, location: str, supported_os_type, tags=None, description: str=None, eula: str=None, privacy_statement_uri: str=None, release_note_uri: str=None, end_of_life_date=None, **kwargs) -> None: + super(GalleryApplication, self).__init__(location=location, tags=tags, **kwargs) + self.description = description + self.eula = eula + self.privacy_statement_uri = privacy_statement_uri + self.release_note_uri = release_note_uri + self.end_of_life_date = end_of_life_date + self.supported_os_type = supported_os_type + + +class GalleryApplicationVersion(Resource): + """Specifies information about the gallery Application Version that you want + to create or update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource Id + :vartype id: str + :ivar name: Resource name + :vartype name: str + :ivar type: Resource type + :vartype type: str + :param location: Required. Resource location + :type location: str + :param tags: Resource tags + :type tags: dict[str, str] + :param publishing_profile: Required. + :type publishing_profile: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionPublishingProfile + :ivar provisioning_state: The current state of the gallery Application + Version. The provisioning state, which only appears in the response. + Possible values include: 'Creating', 'Updating', 'Failed', 'Succeeded', + 'Deleting', 'Migrating' + :vartype provisioning_state: str or + ~azure.mgmt.compute.v2019_03_01.models.enum + :ivar replication_status: + :vartype replication_status: + ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatus + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'publishing_profile': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'replication_status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'publishing_profile': {'key': 'properties.publishingProfile', 'type': 'GalleryApplicationVersionPublishingProfile'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'replication_status': {'key': 'properties.replicationStatus', 'type': 'ReplicationStatus'}, + } + + def __init__(self, *, location: str, publishing_profile, tags=None, **kwargs) -> None: + super(GalleryApplicationVersion, self).__init__(location=location, tags=tags, **kwargs) + self.publishing_profile = publishing_profile + self.provisioning_state = None + self.replication_status = None + + class GalleryArtifactPublishingProfileBase(Model): """Describes the basic gallery artifact publishing profile. + Variables are only populated by the server, and will be ignored when + sending a request. + + :param target_regions: The target regions where the Image Version is going + to be replicated to. This property is updatable. + :type target_regions: + list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be + created per region. This property would take effect for a region when + regionalReplicaCount is not specified. This property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from + the latest version of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery Image Version is + published. + :vartype published_date: datetime + :param end_of_life_date: The end of life date of the gallery Image + Version. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param storage_account_type: Specifies the storage account type to be used + to store the image. This property is not updatable. Possible values + include: 'Standard_LRS', 'Standard_ZRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType + """ + + _validation = { + 'published_date': {'readonly': True}, + } + + _attribute_map = { + 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + } + + def __init__(self, *, target_regions=None, replica_count: int=None, exclude_from_latest: bool=None, end_of_life_date=None, storage_account_type=None, **kwargs) -> None: + super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) + self.target_regions = target_regions + self.replica_count = replica_count + self.exclude_from_latest = exclude_from_latest + self.published_date = None + self.end_of_life_date = end_of_life_date + self.storage_account_type = storage_account_type + + +class GalleryApplicationVersionPublishingProfile(GalleryArtifactPublishingProfileBase): + """The publishing profile of a gallery Image Version. + + Variables are only populated by the server, and will be ignored when + sending a request. + All required parameters must be populated in order to send to Azure. :param target_regions: The target regions where the Image Version is going to be replicated to. This property is updatable. :type target_regions: list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] + :param replica_count: The number of replicas of the Image Version to be + created per region. This property would take effect for a region when + regionalReplicaCount is not specified. This property is updatable. + :type replica_count: int + :param exclude_from_latest: If set to true, Virtual Machines deployed from + the latest version of the Image Definition won't use this Image Version. + :type exclude_from_latest: bool + :ivar published_date: The timestamp for when the gallery Image Version is + published. + :vartype published_date: datetime + :param end_of_life_date: The end of life date of the gallery Image + Version. This property can be used for decommissioning purposes. This + property is updatable. + :type end_of_life_date: datetime + :param storage_account_type: Specifies the storage account type to be used + to store the image. This property is not updatable. Possible values + include: 'Standard_LRS', 'Standard_ZRS' + :type storage_account_type: str or + ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType :param source: Required. - :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource + :type source: ~azure.mgmt.compute.v2019_03_01.models.UserArtifactSource + :param content_type: Optional. May be used to help process this file. The + type of file contained in the source, e.g. zip, json, etc. + :type content_type: str + :param enable_health_check: Optional. Whether or not this application + reports health. + :type enable_health_check: bool """ _validation = { + 'published_date': {'readonly': True}, 'source': {'required': True}, } _attribute_map = { 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, + 'replica_count': {'key': 'replicaCount', 'type': 'int'}, + 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, + 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, + 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, + 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'UserArtifactSource'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'enable_health_check': {'key': 'enableHealthCheck', 'type': 'bool'}, } - def __init__(self, *, source, target_regions=None, **kwargs) -> None: - super(GalleryArtifactPublishingProfileBase, self).__init__(**kwargs) - self.target_regions = target_regions + def __init__(self, *, source, target_regions=None, replica_count: int=None, exclude_from_latest: bool=None, end_of_life_date=None, storage_account_type=None, content_type: str=None, enable_health_check: bool=None, **kwargs) -> None: + super(GalleryApplicationVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) self.source = source + self.content_type = content_type + self.enable_health_check = enable_health_check class GalleryArtifactSource(Model): @@ -1543,8 +1767,6 @@ class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase) to be replicated to. This property is updatable. :type target_regions: list[~azure.mgmt.compute.v2019_03_01.models.TargetRegion] - :param source: Required. - :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource :param replica_count: The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. @@ -1564,30 +1786,28 @@ class GalleryImageVersionPublishingProfile(GalleryArtifactPublishingProfileBase) include: 'Standard_LRS', 'Standard_ZRS' :type storage_account_type: str or ~azure.mgmt.compute.v2019_03_01.models.StorageAccountType + :param source: Required. + :type source: ~azure.mgmt.compute.v2019_03_01.models.GalleryArtifactSource """ _validation = { - 'source': {'required': True}, 'published_date': {'readonly': True}, + 'source': {'required': True}, } _attribute_map = { 'target_regions': {'key': 'targetRegions', 'type': '[TargetRegion]'}, - 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, 'replica_count': {'key': 'replicaCount', 'type': 'int'}, 'exclude_from_latest': {'key': 'excludeFromLatest', 'type': 'bool'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'end_of_life_date': {'key': 'endOfLifeDate', 'type': 'iso-8601'}, 'storage_account_type': {'key': 'storageAccountType', 'type': 'str'}, + 'source': {'key': 'source', 'type': 'GalleryArtifactSource'}, } def __init__(self, *, source, target_regions=None, replica_count: int=None, exclude_from_latest: bool=None, end_of_life_date=None, storage_account_type=None, **kwargs) -> None: - super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, source=source, **kwargs) - self.replica_count = replica_count - self.exclude_from_latest = exclude_from_latest - self.published_date = None - self.end_of_life_date = end_of_life_date - self.storage_account_type = storage_account_type + super(GalleryImageVersionPublishingProfile, self).__init__(target_regions=target_regions, replica_count=replica_count, exclude_from_latest=exclude_from_latest, end_of_life_date=end_of_life_date, storage_account_type=storage_account_type, **kwargs) + self.source = source class GalleryImageVersionStorageProfile(Model): @@ -3855,6 +4075,34 @@ def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> N self.localized_value = localized_value +class UserArtifactSource(Model): + """The source image from which the Image Version is going to be created. + + All required parameters must be populated in order to send to Azure. + + :param file_name: Required. Required. The fileName of the artifact. + :type file_name: str + :param media_link: Required. Required. The mediaLink of the artifact, must + be a readable storage blob. + :type media_link: str + """ + + _validation = { + 'file_name': {'required': True}, + 'media_link': {'required': True}, + } + + _attribute_map = { + 'file_name': {'key': 'fileName', 'type': 'str'}, + 'media_link': {'key': 'mediaLink', 'type': 'str'}, + } + + def __init__(self, *, file_name: str, media_link: str, **kwargs) -> None: + super(UserArtifactSource, self).__init__(**kwargs) + self.file_name = file_name + self.media_link = media_link + + class VaultCertificate(Model): """Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM. diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py index d271039fee93..b02dee87e189 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_paged_models.py @@ -246,3 +246,29 @@ class GalleryImageVersionPaged(Paged): def __init__(self, *args, **kwargs): super(GalleryImageVersionPaged, self).__init__(*args, **kwargs) +class GalleryApplicationPaged(Paged): + """ + A paging container for iterating over a list of :class:`GalleryApplication ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GalleryApplication]'} + } + + def __init__(self, *args, **kwargs): + + super(GalleryApplicationPaged, self).__init__(*args, **kwargs) +class GalleryApplicationVersionPaged(Paged): + """ + A paging container for iterating over a list of :class:`GalleryApplicationVersion ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GalleryApplicationVersion]'} + } + + def __init__(self, *args, **kwargs): + + super(GalleryApplicationVersionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py index bf3e9ddb67f9..11fed6cb8382 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/__init__.py @@ -30,6 +30,8 @@ from ._galleries_operations import GalleriesOperations from ._gallery_images_operations import GalleryImagesOperations from ._gallery_image_versions_operations import GalleryImageVersionsOperations +from ._gallery_applications_operations import GalleryApplicationsOperations +from ._gallery_application_versions_operations import GalleryApplicationVersionsOperations __all__ = [ 'Operations', @@ -53,4 +55,6 @@ 'GalleriesOperations', 'GalleryImagesOperations', 'GalleryImageVersionsOperations', + 'GalleryApplicationsOperations', + 'GalleryApplicationVersionsOperations', ] diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py new file mode 100644 index 000000000000..ec615df20fb8 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_application_versions_operations.py @@ -0,0 +1,408 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GalleryApplicationVersionsOperations(object): + """GalleryApplicationVersionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application_version_name, gallery_application_version, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gallery_application_version, 'GalleryApplicationVersion') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplicationVersion', response) + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplicationVersion', response) + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplicationVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application_version_name, gallery_application_version, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition in which the Application Version is to be created. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery + Application Version to be created. 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: + .. + :type gallery_application_version_name: str + :param gallery_application_version: Parameters supplied to the create + or update gallery Application Version operation. + :type gallery_application_version: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + GalleryApplicationVersion or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + gallery_application_version=gallery_application_version, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GalleryApplicationVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} + + def get( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application_version_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition in which the Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery + Application Version to be retrieved. + :type gallery_application_version_name: str + :param expand: The expand expression to apply on the operation. + Possible values include: 'ReplicationStatus' + :type expand: str or + ~azure.mgmt.compute.v2019_03_01.models.ReplicationStatusTypes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GalleryApplicationVersion or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplicationVersion', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} + + + def _delete_initial( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application_version_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str'), + 'galleryApplicationVersionName': self._serialize.url("gallery_application_version_name", gallery_application_version_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application_version_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a gallery Application Version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition in which the Application Version resides. + :type gallery_application_name: str + :param gallery_application_version_name: The name of the gallery + Application Version to be deleted. + :type gallery_application_version_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application_version_name=gallery_application_version_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}'} + + def list_by_gallery_application( + self, resource_group_name, gallery_name, gallery_application_name, custom_headers=None, raw=False, **operation_config): + """List gallery Application Versions in a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition resides. + :type gallery_name: str + :param gallery_application_name: The name of the Shared Application + Gallery Application Definition from which the Application Versions are + to be listed. + :type gallery_application_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GalleryApplicationVersion + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersionPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationVersion] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_gallery_application.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GalleryApplicationVersionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_gallery_application.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions'} diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py new file mode 100644 index 000000000000..c161ea1bc997 --- /dev/null +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_gallery_applications_operations.py @@ -0,0 +1,380 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class GalleryApplicationsOperations(object): + """GalleryApplicationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-03-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-03-01" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(gallery_application, 'GalleryApplication') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplication', response) + if response.status_code == 201: + deserialized = self._deserialize('GalleryApplication', response) + if response.status_code == 202: + deserialized = self._deserialize('GalleryApplication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, gallery_name, gallery_application_name, gallery_application, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition is to be created. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition to be created or updated. The allowed characters are + alphabets and numbers with dots, dashes, and periods allowed in the + middle. The maximum length is 80 characters. + :type gallery_application_name: str + :param gallery_application: Parameters supplied to the create or + update gallery Application operation. + :type gallery_application: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns GalleryApplication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.compute.v2019_03_01.models.GalleryApplication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.compute.v2019_03_01.models.GalleryApplication]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + gallery_application=gallery_application, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('GalleryApplication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} + + def get( + self, resource_group_name, gallery_name, gallery_application_name, custom_headers=None, raw=False, **operation_config): + """Retrieves information about a gallery Application Definition. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from + which the Application Definitions are to be retrieved. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition to be retrieved. + :type gallery_application_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GalleryApplication or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.compute.v2019_03_01.models.GalleryApplication or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GalleryApplication', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} + + + def _delete_initial( + self, resource_group_name, gallery_name, gallery_application_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str'), + 'galleryApplicationName': self._serialize.url("gallery_application_name", gallery_application_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, gallery_name, gallery_application_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a gallery Application. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery in + which the Application Definition is to be deleted. + :type gallery_name: str + :param gallery_application_name: The name of the gallery Application + Definition to be deleted. + :type gallery_application_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + gallery_name=gallery_name, + gallery_application_name=gallery_application_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}'} + + def list_by_gallery( + self, resource_group_name, gallery_name, custom_headers=None, raw=False, **operation_config): + """List gallery Application Definitions in a gallery. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param gallery_name: The name of the Shared Application Gallery from + which Application Definitions are to be listed. + :type gallery_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GalleryApplication + :rtype: + ~azure.mgmt.compute.v2019_03_01.models.GalleryApplicationPaged[~azure.mgmt.compute.v2019_03_01.models.GalleryApplication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_gallery.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'galleryName': self._serialize.url("gallery_name", gallery_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GalleryApplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_gallery.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications'} From 35886d8986a20a58fd35084229ef1f8bd61af32b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 17 Jul 2019 22:49:51 +0000 Subject: [PATCH 2/2] Generated from 46c41c8144620cf4589763fc14b57b3eef555edf Make hyperVGeneration field same as DiskRPs --- .../compute/v2019_03_01/models/__init__.py | 3 - .../compute/v2019_03_01/models/_models.py | 98 +++++++--------- .../compute/v2019_03_01/models/_models_py3.py | 108 +++++++----------- .../operations/_dedicated_hosts_operations.py | 2 +- 4 files changed, 84 insertions(+), 127 deletions(-) diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py index d055c2c8e54a..f12266d5ba5e 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/__init__.py @@ -27,7 +27,6 @@ from ._models_py3 import DedicatedHost from ._models_py3 import DedicatedHostAllocatableVM from ._models_py3 import DedicatedHostAvailableCapacity - from ._models_py3 import DedicatedHostCapacity from ._models_py3 import DedicatedHostGroup from ._models_py3 import DedicatedHostGroupUpdate from ._models_py3 import DedicatedHostInstanceView @@ -199,7 +198,6 @@ from ._models import DedicatedHost from ._models import DedicatedHostAllocatableVM from ._models import DedicatedHostAvailableCapacity - from ._models import DedicatedHostCapacity from ._models import DedicatedHostGroup from ._models import DedicatedHostGroupUpdate from ._models import DedicatedHostInstanceView @@ -429,7 +427,6 @@ 'DedicatedHost', 'DedicatedHostAllocatableVM', 'DedicatedHostAvailableCapacity', - 'DedicatedHostCapacity', 'DedicatedHostGroup', 'DedicatedHostGroupUpdate', 'DedicatedHostInstanceView', diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py index b0e0d1665230..96dc4655ae34 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models.py @@ -651,15 +651,16 @@ class DedicatedHost(Resource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain: Fault domain of the host within a group. - Supported values 0,1,2. + :param platform_fault_domain: Fault domain of the dedicated host within a + dedicated host group. :type platform_fault_domain: int - :param auto_replace_on_failure: Whether the host should be replaced - automatically in case of a failure. The value is defaulted to true when - not provided. + :param auto_replace_on_failure: Specifies whether the dedicated host + should be replaced automatically in case of a failure. The value is + defaulted to 'true' when not provided. :type auto_replace_on_failure: bool :ivar host_id: A unique id generated and assigned to the dedicated host by - the platform. + the platform.

Does not change throughout the lifetime of the + host. :vartype host_id: str :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. @@ -672,7 +673,7 @@ class DedicatedHost(Resource): include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' :type license_type: str or ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes - :ivar provisioning_time: The date when the host was first created. + :ivar provisioning_time: The date when the host was first provisioned. :vartype provisioning_time: datetime :ivar provisioning_state: The provisioning state, which only appears in the response. @@ -680,9 +681,9 @@ class DedicatedHost(Resource): :ivar instance_view: The dedicated host instance view. :vartype instance_view: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView - :param sku: Sku of the dedicated host for Hardware Generation and VM - family, The only name is required to be set. See DedicatedHostSkuTypes for - possible set of values. + :param sku: Required. SKU of the dedicated host for Hardware Generation + and VM family. Only name is required to be set. List Microsoft.Compute + SKUs for a list of possible values. :type sku: ~azure.mgmt.compute.v2019_03_01.models.Sku """ @@ -691,11 +692,13 @@ class DedicatedHost(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'instance_view': {'readonly': True}, + 'sku': {'required': True}, } _attribute_map = { @@ -754,8 +757,6 @@ def __init__(self, **kwargs): class DedicatedHostAvailableCapacity(Model): """Dedicated host unutilized capacity. - :param available_vcpus: The total number of CPUs. - :type available_vcpus: float :param allocatable_vms: The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. @@ -764,41 +765,19 @@ class DedicatedHostAvailableCapacity(Model): """ _attribute_map = { - 'available_vcpus': {'key': 'availableVCpus', 'type': 'float'}, 'allocatable_vms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, } def __init__(self, **kwargs): super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) - self.available_vcpus = kwargs.get('available_vcpus', None) self.allocatable_vms = kwargs.get('allocatable_vms', None) -class DedicatedHostCapacity(Model): - """Dedicated host total capacity. - - :param total_cores: The total number of cores. - :type total_cores: float - :param total_vcpus: The total number of CPUs. - :type total_vcpus: float - """ - - _attribute_map = { - 'total_cores': {'key': 'totalCores', 'type': 'float'}, - 'total_vcpus': {'key': 'totalVCpus', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(DedicatedHostCapacity, self).__init__(**kwargs) - self.total_cores = kwargs.get('total_cores', None) - self.total_vcpus = kwargs.get('total_vcpus', None) - - class DedicatedHostGroup(Resource): """Specifies information about the dedicated host group that the dedicated - hosts should be assigned to.

Currently, a Dedicated host can only - be added to Dedicated Host Group at creation time. An existing Dedicated - Host cannot be added to a dedicated host group. + hosts should be assigned to.

Currently, a dedicated host can only + be added to a dedicated host group at creation time. An existing dedicated + host cannot be added to another dedicated host group. Variables are only populated by the server, and will be ignored when sending a request. @@ -815,8 +794,8 @@ class DedicatedHostGroup(Resource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain_count: Number of fault domains that the host - group can span. Supported values 1,2,3. + :param platform_fault_domain_count: Required. Number of fault domains that + the host group can span. :type platform_fault_domain_count: int :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. @@ -824,8 +803,8 @@ class DedicatedHostGroup(Resource): list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] :param zones: Availability Zone to use for this host group � only single zone is supported. The zone can be assigned only during creation. If not - provided, the group supports all zones in the region. If provided, enforce - each host in the group is in the same zone. + provided, the group supports all zones in the region. If provided, + enforces each host in the group to be in the same zone. :type zones: list[str] """ @@ -834,6 +813,7 @@ class DedicatedHostGroup(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'platform_fault_domain_count': {'required': True, 'maximum': 3, 'minimum': 1}, 'hosts': {'readonly': True}, } @@ -862,10 +842,12 @@ class DedicatedHostGroupUpdate(UpdateResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain_count: Number of fault domains that the host - group can span. Supported values 1,2,3. + :param platform_fault_domain_count: Required. Number of fault domains that + the host group can span. :type platform_fault_domain_count: int :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. @@ -873,12 +855,13 @@ class DedicatedHostGroupUpdate(UpdateResource): list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] :param zones: Availability Zone to use for this host group � only single zone is supported. The zone can be assigned only during creation. If not - provided, the group supports all zones in the region. If provided, enforce - each host in the group is in the same zone. + provided, the group supports all zones in the region. If provided, + enforces each host in the group to be in the same zone. :type zones: list[str] """ _validation = { + 'platform_fault_domain_count': {'required': True, 'maximum': 3, 'minimum': 1}, 'hosts': {'readonly': True}, } @@ -902,12 +885,9 @@ class DedicatedHostInstanceView(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar asset_id: Specifies the unique of the dedicated physical machine on - which the dedicated host resides. + :ivar asset_id: Specifies the unique id of the dedicated physical machine + on which the dedicated host resides. :vartype asset_id: str - :param capacity: The total capacity of the dedicated host. - :type capacity: - ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostCapacity :param available_capacity: Unutilized capacity of the dedicated host. :type available_capacity: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAvailableCapacity @@ -922,7 +902,6 @@ class DedicatedHostInstanceView(Model): _attribute_map = { 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'DedicatedHostCapacity'}, 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } @@ -930,7 +909,6 @@ class DedicatedHostInstanceView(Model): def __init__(self, **kwargs): super(DedicatedHostInstanceView, self).__init__(**kwargs) self.asset_id = None - self.capacity = kwargs.get('capacity', None) self.available_capacity = kwargs.get('available_capacity', None) self.statuses = kwargs.get('statuses', None) @@ -944,15 +922,16 @@ class DedicatedHostUpdate(UpdateResource): :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain: Fault domain of the host within a group. - Supported values 0,1,2. + :param platform_fault_domain: Fault domain of the dedicated host within a + dedicated host group. :type platform_fault_domain: int - :param auto_replace_on_failure: Whether the host should be replaced - automatically in case of a failure. The value is defaulted to true when - not provided. + :param auto_replace_on_failure: Specifies whether the dedicated host + should be replaced automatically in case of a failure. The value is + defaulted to 'true' when not provided. :type auto_replace_on_failure: bool :ivar host_id: A unique id generated and assigned to the dedicated host by - the platform. + the platform.

Does not change throughout the lifetime of the + host. :vartype host_id: str :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. @@ -965,7 +944,7 @@ class DedicatedHostUpdate(UpdateResource): include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' :type license_type: str or ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes - :ivar provisioning_time: The date when the host was first created. + :ivar provisioning_time: The date when the host was first provisioned. :vartype provisioning_time: datetime :ivar provisioning_state: The provisioning state, which only appears in the response. @@ -976,6 +955,7 @@ class DedicatedHostUpdate(UpdateResource): """ _validation = { + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py index 75f0cf27ed2d..8a6625117983 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/_models_py3.py @@ -651,15 +651,16 @@ class DedicatedHost(Resource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain: Fault domain of the host within a group. - Supported values 0,1,2. + :param platform_fault_domain: Fault domain of the dedicated host within a + dedicated host group. :type platform_fault_domain: int - :param auto_replace_on_failure: Whether the host should be replaced - automatically in case of a failure. The value is defaulted to true when - not provided. + :param auto_replace_on_failure: Specifies whether the dedicated host + should be replaced automatically in case of a failure. The value is + defaulted to 'true' when not provided. :type auto_replace_on_failure: bool :ivar host_id: A unique id generated and assigned to the dedicated host by - the platform. + the platform.

Does not change throughout the lifetime of the + host. :vartype host_id: str :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. @@ -672,7 +673,7 @@ class DedicatedHost(Resource): include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' :type license_type: str or ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes - :ivar provisioning_time: The date when the host was first created. + :ivar provisioning_time: The date when the host was first provisioned. :vartype provisioning_time: datetime :ivar provisioning_state: The provisioning state, which only appears in the response. @@ -680,9 +681,9 @@ class DedicatedHost(Resource): :ivar instance_view: The dedicated host instance view. :vartype instance_view: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostInstanceView - :param sku: Sku of the dedicated host for Hardware Generation and VM - family, The only name is required to be set. See DedicatedHostSkuTypes for - possible set of values. + :param sku: Required. SKU of the dedicated host for Hardware Generation + and VM family. Only name is required to be set. List Microsoft.Compute + SKUs for a list of possible values. :type sku: ~azure.mgmt.compute.v2019_03_01.models.Sku """ @@ -691,11 +692,13 @@ class DedicatedHost(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'instance_view': {'readonly': True}, + 'sku': {'required': True}, } _attribute_map = { @@ -715,7 +718,7 @@ class DedicatedHost(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, *, location: str, tags=None, platform_fault_domain: int=None, auto_replace_on_failure: bool=None, license_type=None, sku=None, **kwargs) -> None: + def __init__(self, *, location: str, sku, tags=None, platform_fault_domain: int=None, auto_replace_on_failure: bool=None, license_type=None, **kwargs) -> None: super(DedicatedHost, self).__init__(location=location, tags=tags, **kwargs) self.platform_fault_domain = platform_fault_domain self.auto_replace_on_failure = auto_replace_on_failure @@ -754,8 +757,6 @@ def __init__(self, *, vm_size: str=None, count: float=None, **kwargs) -> None: class DedicatedHostAvailableCapacity(Model): """Dedicated host unutilized capacity. - :param available_vcpus: The total number of CPUs. - :type available_vcpus: float :param allocatable_vms: The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. @@ -764,41 +765,19 @@ class DedicatedHostAvailableCapacity(Model): """ _attribute_map = { - 'available_vcpus': {'key': 'availableVCpus', 'type': 'float'}, 'allocatable_vms': {'key': 'allocatableVMs', 'type': '[DedicatedHostAllocatableVM]'}, } - def __init__(self, *, available_vcpus: float=None, allocatable_vms=None, **kwargs) -> None: + def __init__(self, *, allocatable_vms=None, **kwargs) -> None: super(DedicatedHostAvailableCapacity, self).__init__(**kwargs) - self.available_vcpus = available_vcpus self.allocatable_vms = allocatable_vms -class DedicatedHostCapacity(Model): - """Dedicated host total capacity. - - :param total_cores: The total number of cores. - :type total_cores: float - :param total_vcpus: The total number of CPUs. - :type total_vcpus: float - """ - - _attribute_map = { - 'total_cores': {'key': 'totalCores', 'type': 'float'}, - 'total_vcpus': {'key': 'totalVCpus', 'type': 'float'}, - } - - def __init__(self, *, total_cores: float=None, total_vcpus: float=None, **kwargs) -> None: - super(DedicatedHostCapacity, self).__init__(**kwargs) - self.total_cores = total_cores - self.total_vcpus = total_vcpus - - class DedicatedHostGroup(Resource): """Specifies information about the dedicated host group that the dedicated - hosts should be assigned to.

Currently, a Dedicated host can only - be added to Dedicated Host Group at creation time. An existing Dedicated - Host cannot be added to a dedicated host group. + hosts should be assigned to.

Currently, a dedicated host can only + be added to a dedicated host group at creation time. An existing dedicated + host cannot be added to another dedicated host group. Variables are only populated by the server, and will be ignored when sending a request. @@ -815,8 +794,8 @@ class DedicatedHostGroup(Resource): :type location: str :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain_count: Number of fault domains that the host - group can span. Supported values 1,2,3. + :param platform_fault_domain_count: Required. Number of fault domains that + the host group can span. :type platform_fault_domain_count: int :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. @@ -824,8 +803,8 @@ class DedicatedHostGroup(Resource): list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] :param zones: Availability Zone to use for this host group � only single zone is supported. The zone can be assigned only during creation. If not - provided, the group supports all zones in the region. If provided, enforce - each host in the group is in the same zone. + provided, the group supports all zones in the region. If provided, + enforces each host in the group to be in the same zone. :type zones: list[str] """ @@ -834,6 +813,7 @@ class DedicatedHostGroup(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'platform_fault_domain_count': {'required': True, 'maximum': 3, 'minimum': 1}, 'hosts': {'readonly': True}, } @@ -848,7 +828,7 @@ class DedicatedHostGroup(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, location: str, tags=None, platform_fault_domain_count: int=None, zones=None, **kwargs) -> None: + def __init__(self, *, location: str, platform_fault_domain_count: int, tags=None, zones=None, **kwargs) -> None: super(DedicatedHostGroup, self).__init__(location=location, tags=tags, **kwargs) self.platform_fault_domain_count = platform_fault_domain_count self.hosts = None @@ -862,10 +842,12 @@ class DedicatedHostGroupUpdate(UpdateResource): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain_count: Number of fault domains that the host - group can span. Supported values 1,2,3. + :param platform_fault_domain_count: Required. Number of fault domains that + the host group can span. :type platform_fault_domain_count: int :ivar hosts: A list of references to all dedicated hosts in the dedicated host group. @@ -873,12 +855,13 @@ class DedicatedHostGroupUpdate(UpdateResource): list[~azure.mgmt.compute.v2019_03_01.models.SubResourceReadOnly] :param zones: Availability Zone to use for this host group � only single zone is supported. The zone can be assigned only during creation. If not - provided, the group supports all zones in the region. If provided, enforce - each host in the group is in the same zone. + provided, the group supports all zones in the region. If provided, + enforces each host in the group to be in the same zone. :type zones: list[str] """ _validation = { + 'platform_fault_domain_count': {'required': True, 'maximum': 3, 'minimum': 1}, 'hosts': {'readonly': True}, } @@ -889,7 +872,7 @@ class DedicatedHostGroupUpdate(UpdateResource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, tags=None, platform_fault_domain_count: int=None, zones=None, **kwargs) -> None: + def __init__(self, *, platform_fault_domain_count: int, tags=None, zones=None, **kwargs) -> None: super(DedicatedHostGroupUpdate, self).__init__(tags=tags, **kwargs) self.platform_fault_domain_count = platform_fault_domain_count self.hosts = None @@ -902,12 +885,9 @@ class DedicatedHostInstanceView(Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar asset_id: Specifies the unique of the dedicated physical machine on - which the dedicated host resides. + :ivar asset_id: Specifies the unique id of the dedicated physical machine + on which the dedicated host resides. :vartype asset_id: str - :param capacity: The total capacity of the dedicated host. - :type capacity: - ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostCapacity :param available_capacity: Unutilized capacity of the dedicated host. :type available_capacity: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostAvailableCapacity @@ -922,15 +902,13 @@ class DedicatedHostInstanceView(Model): _attribute_map = { 'asset_id': {'key': 'assetId', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'DedicatedHostCapacity'}, 'available_capacity': {'key': 'availableCapacity', 'type': 'DedicatedHostAvailableCapacity'}, 'statuses': {'key': 'statuses', 'type': '[InstanceViewStatus]'}, } - def __init__(self, *, capacity=None, available_capacity=None, statuses=None, **kwargs) -> None: + def __init__(self, *, available_capacity=None, statuses=None, **kwargs) -> None: super(DedicatedHostInstanceView, self).__init__(**kwargs) self.asset_id = None - self.capacity = capacity self.available_capacity = available_capacity self.statuses = statuses @@ -944,15 +922,16 @@ class DedicatedHostUpdate(UpdateResource): :param tags: Resource tags :type tags: dict[str, str] - :param platform_fault_domain: Fault domain of the host within a group. - Supported values 0,1,2. + :param platform_fault_domain: Fault domain of the dedicated host within a + dedicated host group. :type platform_fault_domain: int - :param auto_replace_on_failure: Whether the host should be replaced - automatically in case of a failure. The value is defaulted to true when - not provided. + :param auto_replace_on_failure: Specifies whether the dedicated host + should be replaced automatically in case of a failure. The value is + defaulted to 'true' when not provided. :type auto_replace_on_failure: bool :ivar host_id: A unique id generated and assigned to the dedicated host by - the platform. + the platform.

Does not change throughout the lifetime of the + host. :vartype host_id: str :ivar virtual_machines: A list of references to all virtual machines in the Dedicated Host. @@ -965,7 +944,7 @@ class DedicatedHostUpdate(UpdateResource): include: 'None', 'Windows_Server_Hybrid', 'Windows_Server_Perpetual' :type license_type: str or ~azure.mgmt.compute.v2019_03_01.models.DedicatedHostLicenseTypes - :ivar provisioning_time: The date when the host was first created. + :ivar provisioning_time: The date when the host was first provisioned. :vartype provisioning_time: datetime :ivar provisioning_state: The provisioning state, which only appears in the response. @@ -976,6 +955,7 @@ class DedicatedHostUpdate(UpdateResource): """ _validation = { + 'platform_fault_domain': {'maximum': 2, 'minimum': 0}, 'host_id': {'readonly': True}, 'virtual_machines': {'readonly': True}, 'provisioning_time': {'readonly': True}, diff --git a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py index 11f38331ff79..5321620b0af8 100644 --- a/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py +++ b/sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/operations/_dedicated_hosts_operations.py @@ -104,7 +104,7 @@ def create_or_update( :type host_group_name: str :param host_name: The name of the dedicated host . :type host_name: str - :param parameters: Parameters supplied to the Create Dedicated Host . + :param parameters: Parameters supplied to the Create Dedicated Host. :type parameters: ~azure.mgmt.compute.v2019_03_01.models.DedicatedHost :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the