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'}