Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Generated from 6d07ea58eb10ffed1e0083c72d69e2b54bd88a41
Fixed the readme.md
  • Loading branch information
AutorestCI committed Jun 4, 2018
commit a6054e162d2e756a481f1fc4a6d10af060d71b55
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
from .gallery_disk_image_py3 import GalleryDiskImage
from .api_error_base_py3 import ApiErrorBase
from .inner_error_py3 import InnerError
from .api_error_py3 import ApiError
from .operation_status_response_py3 import OperationStatusResponse
from .api_error_py3 import ApiError, ApiErrorException
from .resource_py3 import Resource
except (SyntaxError, ImportError):
from .gallery_identifier import GalleryIdentifier
Expand All @@ -56,15 +55,15 @@
from .gallery_disk_image import GalleryDiskImage
from .api_error_base import ApiErrorBase
from .inner_error import InnerError
from .api_error import ApiError
from .operation_status_response import OperationStatusResponse
from .api_error import ApiError, ApiErrorException
from .resource import Resource
from .gallery_paged import GalleryPaged
from .gallery_image_paged import GalleryImagePaged
from .gallery_image_version_paged import GalleryImageVersionPaged
from .compute_management_client_enums import (
OperatingSystemTypes,
OperatingSystemStateTypes,
ScaleTier,
AggregatedReplicationState,
ReplicationState,
HostCaching,
Expand Down Expand Up @@ -93,14 +92,14 @@
'GalleryDiskImage',
'ApiErrorBase',
'InnerError',
'ApiError',
'OperationStatusResponse',
'ApiError', 'ApiErrorException',
'Resource',
'GalleryPaged',
'GalleryImagePaged',
'GalleryImageVersionPaged',
'OperatingSystemTypes',
'OperatingSystemStateTypes',
'ScaleTier',
'AggregatedReplicationState',
'ReplicationState',
'HostCaching',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ApiError(Model):
Expand Down Expand Up @@ -42,3 +43,15 @@ def __init__(self, **kwargs):
self.code = kwargs.get('code', None)
self.target = kwargs.get('target', None)
self.message = kwargs.get('message', None)


class ApiErrorException(HttpOperationError):
"""Server responsed with exception of type: 'ApiError'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ApiErrorException, self).__init__(deserialize, response, 'ApiError', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ApiError(Model):
Expand Down Expand Up @@ -42,3 +43,15 @@ def __init__(self, *, details=None, innererror=None, code: str=None, target: str
self.code = code
self.target = target
self.message = message


class ApiErrorException(HttpOperationError):
"""Server responsed with exception of type: 'ApiError'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ApiErrorException, self).__init__(deserialize, response, 'ApiError', *args)
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class OperatingSystemStateTypes(str, Enum):
specialized = "Specialized"


class ScaleTier(str, Enum):

s30 = "S30"
s100 = "S100"


class AggregatedReplicationState(str, Enum):

unknown = "Unknown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,34 @@
class GalleryDataDiskImage(GalleryDiskImage):
"""This is the data disk image.

:param sized_in_gb: It indicates the size of the VHD to create.
:type sized_in_gb: int
:param host_caching: The host caching of the disk. Valid values are
'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None',
'ReadOnly', 'ReadWrite'
:type host_caching: str or
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar size_in_gb: It indicates the size of the VHD to create.
:vartype size_in_gb: int
:ivar host_caching: The host caching of the disk. Valid values are 'None',
'ReadOnly', and 'ReadWrite'. Possible values include: 'None', 'ReadOnly',
'ReadWrite'
:vartype host_caching: str or
~azure.mgmt.compute.v2018_06_01.models.HostCaching
:param lun: Specifies the logical unit number of the data disk. This value
:ivar lun: Specifies the logical unit number of the data disk. This value
is used to identify data disks within the VM and therefore must be unique
for each data disk attached to a VM.
:type lun: int
:vartype lun: int
"""

_validation = {
'size_in_gb': {'readonly': True},
'host_caching': {'readonly': True},
'lun': {'readonly': True},
}

_attribute_map = {
'sized_in_gb': {'key': 'sizedInGB', 'type': 'int'},
'size_in_gb': {'key': 'sizeInGB', 'type': 'int'},
'host_caching': {'key': 'hostCaching', 'type': 'HostCaching'},
'lun': {'key': 'lun', 'type': 'int'},
}

def __init__(self, **kwargs):
super(GalleryDataDiskImage, self).__init__(**kwargs)
self.lun = kwargs.get('lun', None)
self.lun = None
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,34 @@
class GalleryDataDiskImage(GalleryDiskImage):
"""This is the data disk image.

:param sized_in_gb: It indicates the size of the VHD to create.
:type sized_in_gb: int
:param host_caching: The host caching of the disk. Valid values are
'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None',
'ReadOnly', 'ReadWrite'
:type host_caching: str or
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar size_in_gb: It indicates the size of the VHD to create.
:vartype size_in_gb: int
:ivar host_caching: The host caching of the disk. Valid values are 'None',
'ReadOnly', and 'ReadWrite'. Possible values include: 'None', 'ReadOnly',
'ReadWrite'
:vartype host_caching: str or
~azure.mgmt.compute.v2018_06_01.models.HostCaching
:param lun: Specifies the logical unit number of the data disk. This value
:ivar lun: Specifies the logical unit number of the data disk. This value
is used to identify data disks within the VM and therefore must be unique
for each data disk attached to a VM.
:type lun: int
:vartype lun: int
"""

_validation = {
'size_in_gb': {'readonly': True},
'host_caching': {'readonly': True},
'lun': {'readonly': True},
}

_attribute_map = {
'sized_in_gb': {'key': 'sizedInGB', 'type': 'int'},
'size_in_gb': {'key': 'sizeInGB', 'type': 'int'},
'host_caching': {'key': 'hostCaching', 'type': 'HostCaching'},
'lun': {'key': 'lun', 'type': 'int'},
}

def __init__(self, *, sized_in_gb: int=None, host_caching=None, lun: int=None, **kwargs) -> None:
super(GalleryDataDiskImage, self).__init__(sized_in_gb=sized_in_gb, host_caching=host_caching, **kwargs)
self.lun = lun
def __init__(self, **kwargs) -> None:
super(GalleryDataDiskImage, self).__init__(**kwargs)
self.lun = None
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,29 @@
class GalleryDiskImage(Model):
"""This is the disk image base class.

:param sized_in_gb: It indicates the size of the VHD to create.
:type sized_in_gb: int
:param host_caching: The host caching of the disk. Valid values are
'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None',
'ReadOnly', 'ReadWrite'
:type host_caching: str or
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar size_in_gb: It indicates the size of the VHD to create.
:vartype size_in_gb: int
:ivar host_caching: The host caching of the disk. Valid values are 'None',
'ReadOnly', and 'ReadWrite'. Possible values include: 'None', 'ReadOnly',
'ReadWrite'
:vartype host_caching: str or
~azure.mgmt.compute.v2018_06_01.models.HostCaching
"""

_validation = {
'size_in_gb': {'readonly': True},
'host_caching': {'readonly': True},
}

_attribute_map = {
'sized_in_gb': {'key': 'sizedInGB', 'type': 'int'},
'size_in_gb': {'key': 'sizeInGB', 'type': 'int'},
'host_caching': {'key': 'hostCaching', 'type': 'HostCaching'},
}

def __init__(self, **kwargs):
super(GalleryDiskImage, self).__init__(**kwargs)
self.sized_in_gb = kwargs.get('sized_in_gb', None)
self.host_caching = kwargs.get('host_caching', None)
self.size_in_gb = None
self.host_caching = None
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,29 @@
class GalleryDiskImage(Model):
"""This is the disk image base class.

:param sized_in_gb: It indicates the size of the VHD to create.
:type sized_in_gb: int
:param host_caching: The host caching of the disk. Valid values are
'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'None',
'ReadOnly', 'ReadWrite'
:type host_caching: str or
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar size_in_gb: It indicates the size of the VHD to create.
:vartype size_in_gb: int
:ivar host_caching: The host caching of the disk. Valid values are 'None',
'ReadOnly', and 'ReadWrite'. Possible values include: 'None', 'ReadOnly',
'ReadWrite'
:vartype host_caching: str or
~azure.mgmt.compute.v2018_06_01.models.HostCaching
"""

_validation = {
'size_in_gb': {'readonly': True},
'host_caching': {'readonly': True},
}

_attribute_map = {
'sized_in_gb': {'key': 'sizedInGB', 'type': 'int'},
'size_in_gb': {'key': 'sizeInGB', 'type': 'int'},
'host_caching': {'key': 'hostCaching', 'type': 'HostCaching'},
}

def __init__(self, *, sized_in_gb: int=None, host_caching=None, **kwargs) -> None:
def __init__(self, **kwargs) -> None:
super(GalleryDiskImage, self).__init__(**kwargs)
self.sized_in_gb = sized_in_gb
self.host_caching = host_caching
self.size_in_gb = None
self.host_caching = None
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class GalleryIdentifier(Model):
"""GalleryIdentifier.
"""Describes the gallery unique name.

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class GalleryIdentifier(Model):
"""GalleryIdentifier.
"""Describes the gallery unique name.

Variables are only populated by the server, and will be ignored when
sending a request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GalleryImage(Resource):
:type os_state: str or
~azure.mgmt.compute.v2018_06_01.models.OperatingSystemStateTypes
:param end_of_life_date: The end of life of this gallery image.
:type end_of_life_date: date
:type end_of_life_date: datetime
:param identifier:
:type identifier:
~azure.mgmt.compute.v2018_06_01.models.GalleryImageIdentifier
Expand Down Expand Up @@ -90,7 +90,7 @@ class GalleryImage(Resource):
'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'},
'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'},
'os_state': {'key': 'properties.osState', 'type': 'OperatingSystemStateTypes'},
'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'date'},
'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'},
'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'},
'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'},
'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class GalleryImage(Resource):
:type os_state: str or
~azure.mgmt.compute.v2018_06_01.models.OperatingSystemStateTypes
:param end_of_life_date: The end of life of this gallery image.
:type end_of_life_date: date
:type end_of_life_date: datetime
:param identifier:
:type identifier:
~azure.mgmt.compute.v2018_06_01.models.GalleryImageIdentifier
Expand Down Expand Up @@ -90,7 +90,7 @@ class GalleryImage(Resource):
'release_note_uri': {'key': 'properties.releaseNoteUri', 'type': 'str'},
'os_type': {'key': 'properties.osType', 'type': 'OperatingSystemTypes'},
'os_state': {'key': 'properties.osState', 'type': 'OperatingSystemStateTypes'},
'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'date'},
'end_of_life_date': {'key': 'properties.endOfLifeDate', 'type': 'iso-8601'},
'identifier': {'key': 'properties.identifier', 'type': 'GalleryImageIdentifier'},
'recommended': {'key': 'properties.recommended', 'type': 'RecommendedMachineConfiguration'},
'disallowed': {'key': 'properties.disallowed', 'type': 'Disallowed'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ class GalleryImageVersion(Resource):
'Migrating'
:vartype provisioning_state: str or
~azure.mgmt.compute.v2018_06_01.models.enum
:param storage_profile:
:type storage_profile:
:ivar storage_profile:
:vartype storage_profile:
~azure.mgmt.compute.v2018_06_01.models.GalleryImageVersionStorageProfile
:param replication_status:
:type replication_status:
:ivar replication_status:
:vartype replication_status:
~azure.mgmt.compute.v2018_06_01.models.ReplicationStatus
"""

Expand All @@ -54,6 +54,8 @@ class GalleryImageVersion(Resource):
'type': {'readonly': True},
'location': {'required': True},
'provisioning_state': {'readonly': True},
'storage_profile': {'readonly': True},
'replication_status': {'readonly': True},
}

_attribute_map = {
Expand All @@ -72,5 +74,5 @@ def __init__(self, **kwargs):
super(GalleryImageVersion, self).__init__(**kwargs)
self.publishing_profile = kwargs.get('publishing_profile', None)
self.provisioning_state = None
self.storage_profile = kwargs.get('storage_profile', None)
self.replication_status = kwargs.get('replication_status', None)
self.storage_profile = None
self.replication_status = None
Loading