Skip to content

Commit

Permalink
[AutoPR compute/resource-manager] Added the swagger file for the new …
Browse files Browse the repository at this point in the history
…service Gallery. (#2563)

* Generated from b48862551b5e97eb40acb3da63e55522a9db566c

Added the swagger file for the new service Gallery.

* Generated from d2537a58b0496d8860759d47a9c344c19d217995

Gallery Python conf

* Generated from 29d0c5762aad64243a021fac44d65b8610304e4e

Fixed description for 202 response.

* Generated from 29d0c5762aad64243a021fac44d65b8610304e4e

Fixed description for 202 response.

* Generated from b74f3ee0fdca928bf92a7fdd2bcd17994deadca9

Changed the operationId to conform to naming convention.

* Generated from 664c041aeed346e4fdc3a2c8c29c1c59e7505b66

Fixed some typos.

* Generated from e7ab96432e0bfc7c49839ca5d1194ec1be0c23a9

Add default error response. Make provisioningInfo a enum type.

* Generated from c26feda2acff5be97893b6e5db4270e09dbf1c25

Fixed comments according to CR.

* Generated from b757a4ec5fd9e1a35bedefd53fe3d92e111db5eb

Resolved merge conflicts.
  • Loading branch information
AutorestCI authored and lmazuel committed Jun 13, 2018
1 parent 421c0e6 commit acd052a
Show file tree
Hide file tree
Showing 61 changed files with 3,728 additions and 0 deletions.
43 changes: 43 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/compute_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2017-09-01: :mod:`v2017_09_01.models<azure.mgmt.compute.v2017_09_01.models>`
* 2017-12-01: :mod:`v2017_12_01.models<azure.mgmt.compute.v2017_12_01.models>`
* 2018-04-01: :mod:`v2018_04_01.models<azure.mgmt.compute.v2018_04_01.models>`
* 2018-06-01: :mod:`v2018_06_01.models<azure.mgmt.compute.v2018_06_01.models>`
"""
if api_version == '2015-06-15':
from .v2015_06_15 import models
Expand All @@ -143,6 +144,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2018-04-01':
from .v2018_04_01 import models
return models
elif api_version == '2018-06-01':
from .v2018_06_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -189,6 +193,45 @@ def disks(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 galleries(self):
"""Instance depends on the API version:
* 2018-06-01: :class:`GalleriesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleriesOperations>`
"""
api_version = self._get_api_version('galleries')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleriesOperations 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:
* 2018-06-01: :class:`GalleryImageVersionsOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImageVersionsOperations>`
"""
api_version = self._get_api_version('gallery_image_versions')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleryImageVersionsOperations 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_images(self):
"""Instance depends on the API version:
* 2018-06-01: :class:`GalleryImagesOperations<azure.mgmt.compute.v2018_06_01.operations.GalleryImagesOperations>`
"""
api_version = self._get_api_version('gallery_images')
if api_version == '2018-06-01':
from .v2018_06_01.operations import GalleryImagesOperations 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 images(self):
"""Instance depends on the API version:
Expand Down
18 changes: 18 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .compute_management_client import ComputeManagementClient
from .version import VERSION

__all__ = ['ComputeManagementClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.galleries_operations import GalleriesOperations
from .operations.gallery_images_operations import GalleryImagesOperations
from .operations.gallery_image_versions_operations import GalleryImageVersionsOperations
from . import models


class ComputeManagementClientConfiguration(AzureConfiguration):
"""Configuration for ComputeManagementClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ComputeManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-compute/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class ComputeManagementClient(SDKClient):
"""Compute Client
:ivar config: Configuration for client.
:vartype config: ComputeManagementClientConfiguration
:ivar galleries: Galleries operations
:vartype galleries: azure.mgmt.compute.v2018_06_01.operations.GalleriesOperations
:ivar gallery_images: GalleryImages operations
:vartype gallery_images: azure.mgmt.compute.v2018_06_01.operations.GalleryImagesOperations
:ivar gallery_image_versions: GalleryImageVersions operations
:vartype gallery_image_versions: azure.mgmt.compute.v2018_06_01.operations.GalleryImageVersionsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url)
super(ComputeManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2018-06-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.galleries = GalleriesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_images = GalleryImagesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.gallery_image_versions = GalleryImageVersionsOperations(
self._client, self.config, self._serialize, self._deserialize)
108 changes: 108 additions & 0 deletions azure-mgmt-compute/azure/mgmt/compute/v2018_06_01/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from .gallery_identifier_py3 import GalleryIdentifier
from .gallery_py3 import Gallery
from .gallery_image_identifier_py3 import GalleryImageIdentifier
from .resource_range_py3 import ResourceRange
from .recommended_machine_configuration_py3 import RecommendedMachineConfiguration
from .disallowed_py3 import Disallowed
from .image_purchase_plan_py3 import ImagePurchasePlan
from .gallery_image_py3 import GalleryImage
from .gallery_image_version_publishing_profile_py3 import GalleryImageVersionPublishingProfile
from .gallery_os_disk_image_py3 import GalleryOSDiskImage
from .gallery_data_disk_image_py3 import GalleryDataDiskImage
from .gallery_image_version_storage_profile_py3 import GalleryImageVersionStorageProfile
from .regional_replication_status_py3 import RegionalReplicationStatus
from .replication_status_py3 import ReplicationStatus
from .gallery_image_version_py3 import GalleryImageVersion
from .managed_artifact_py3 import ManagedArtifact
from .gallery_artifact_source_py3 import GalleryArtifactSource
from .gallery_artifact_publishing_profile_base_py3 import GalleryArtifactPublishingProfileBase
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 .resource_py3 import Resource
except (SyntaxError, ImportError):
from .gallery_identifier import GalleryIdentifier
from .gallery import Gallery
from .gallery_image_identifier import GalleryImageIdentifier
from .resource_range import ResourceRange
from .recommended_machine_configuration import RecommendedMachineConfiguration
from .disallowed import Disallowed
from .image_purchase_plan import ImagePurchasePlan
from .gallery_image import GalleryImage
from .gallery_image_version_publishing_profile import GalleryImageVersionPublishingProfile
from .gallery_os_disk_image import GalleryOSDiskImage
from .gallery_data_disk_image import GalleryDataDiskImage
from .gallery_image_version_storage_profile import GalleryImageVersionStorageProfile
from .regional_replication_status import RegionalReplicationStatus
from .replication_status import ReplicationStatus
from .gallery_image_version import GalleryImageVersion
from .managed_artifact import ManagedArtifact
from .gallery_artifact_source import GalleryArtifactSource
from .gallery_artifact_publishing_profile_base import GalleryArtifactPublishingProfileBase
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 .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,
AggregatedReplicationState,
ReplicationState,
HostCaching,
ReplicationStatusTypes,
)

__all__ = [
'GalleryIdentifier',
'Gallery',
'GalleryImageIdentifier',
'ResourceRange',
'RecommendedMachineConfiguration',
'Disallowed',
'ImagePurchasePlan',
'GalleryImage',
'GalleryImageVersionPublishingProfile',
'GalleryOSDiskImage',
'GalleryDataDiskImage',
'GalleryImageVersionStorageProfile',
'RegionalReplicationStatus',
'ReplicationStatus',
'GalleryImageVersion',
'ManagedArtifact',
'GalleryArtifactSource',
'GalleryArtifactPublishingProfileBase',
'GalleryDiskImage',
'ApiErrorBase',
'InnerError',
'ApiError',
'OperationStatusResponse',
'Resource',
'GalleryPaged',
'GalleryImagePaged',
'GalleryImageVersionPaged',
'OperatingSystemTypes',
'OperatingSystemStateTypes',
'AggregatedReplicationState',
'ReplicationState',
'HostCaching',
'ReplicationStatusTypes',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ApiError(Model):
"""Api error.
:param details: The Api error details
:type details: list[~azure.mgmt.compute.v2018_06_01.models.ApiErrorBase]
:param innererror: The Api inner error
:type innererror: ~azure.mgmt.compute.v2018_06_01.models.InnerError
:param code: The error code.
:type code: str
:param target: The target of the particular error.
:type target: str
:param message: The error message.
:type message: str
"""

_attribute_map = {
'details': {'key': 'details', 'type': '[ApiErrorBase]'},
'innererror': {'key': 'innererror', 'type': 'InnerError'},
'code': {'key': 'code', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ApiError, self).__init__(**kwargs)
self.details = kwargs.get('details', None)
self.innererror = kwargs.get('innererror', None)
self.code = kwargs.get('code', None)
self.target = kwargs.get('target', None)
self.message = kwargs.get('message', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ApiErrorBase(Model):
"""Api error base.
:param code: The error code.
:type code: str
:param target: The target of the particular error.
:type target: str
:param message: The error message.
:type message: str
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ApiErrorBase, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.target = kwargs.get('target', None)
self.message = kwargs.get('message', None)
Loading

0 comments on commit acd052a

Please sign in to comment.