Skip to content

Commit

Permalink
[AutoPR] imagebuilder/resource-manager (#4447)
Browse files Browse the repository at this point in the history
* [AutoPR imagebuilder/resource-manager] Add private preview API for Azure Image Builder (#4349)

* Generated from b43e59c3015873f2487d2ee245040a30355f52a1

Adding readme files for SDK generation

* Packaging update of azure-mgmt-imagebuilder

* Generated from 9b99e5667a5b536dbe594b7e85d9764c851f5741

PR: rename 'tags' -> 'artifactTags' for distributor

* Generated from adcccdbb26740afe3cbc5a4612909221bc245fe1

Add examples, fix minor issues in swagger

* [AutoPR imagebuilder/resource-manager] [Hub Generated] Review request for Microsoft.VirtualMachineImages to add version 2019-02-01-preview (#4449)

* Generated from 796ebc9f7d0be44caec229a6dccaeafaa80d72e6

Add imagebuilder/2019-02-01-preview

* Generated from 42363c2f9c61172f0ebac88d32cb992d26dc73be

Merge pull request #1 from feiyushi/feshi-imagebuilder-preview2019

operation_id: plural forms

* Packaging update of azure-mgmt-imagebuilder

* Generated from 3f182fa74711ff8772671a27d256e73ddef90085

Fix typo

* Generated from 344f1d705ebc1f9424a78a3d78411437322b72bf (#4733)

Fix bug: "artifactLocation" -> "artifactUri"

* Update HISTORY.rst

* Update sdk_packaging.toml

* Packaging update of azure-mgmt-imagebuilder
  • Loading branch information
AutorestCI authored and lmazuel committed Apr 9, 2019
1 parent 0d2f14f commit c98bf08
Show file tree
Hide file tree
Showing 66 changed files with 3,568 additions and 0 deletions.
9 changes: 9 additions & 0 deletions azure-mgmt-imagebuilder/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:
Release History
===============

0.1.0 (2019-04-09)
++++++++++++++++++

* Initial Release
5 changes: 5 additions & 0 deletions azure-mgmt-imagebuilder/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

33 changes: 33 additions & 0 deletions azure-mgmt-imagebuilder/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Image Builder Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Usage
=====

For code examples, see `Image Builder
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-imagebuilder%2FREADME.png
1 change: 1 addition & 0 deletions azure-mgmt-imagebuilder/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions azure-mgmt-imagebuilder/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
18 changes: 18 additions & 0 deletions azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/__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 .image_builder_client import ImageBuilderClient
from .version import VERSION

__all__ = ['ImageBuilderClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 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.virtual_machine_image_templates_operations import VirtualMachineImageTemplatesOperations
from .operations.operations import Operations
from . import models


class ImageBuilderClientConfiguration(AzureConfiguration):
"""Configuration for ImageBuilderClient
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(ImageBuilderClientConfiguration, self).__init__(base_url)

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

self.credentials = credentials
self.subscription_id = subscription_id


class ImageBuilderClient(SDKClient):
"""Azure Virtual Machine Image Builder Client
:ivar config: Configuration for client.
:vartype config: ImageBuilderClientConfiguration
:ivar virtual_machine_image_templates: VirtualMachineImageTemplates operations
:vartype virtual_machine_image_templates: azure.mgmt.imagebuilder.operations.VirtualMachineImageTemplatesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.imagebuilder.operations.Operations
: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 = ImageBuilderClientConfiguration(credentials, subscription_id, base_url)
super(ImageBuilderClient, 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 = '2019-02-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.virtual_machine_image_templates = VirtualMachineImageTemplatesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
94 changes: 94 additions & 0 deletions azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# 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 .image_template_source_py3 import ImageTemplateSource
from .image_template_customizer_py3 import ImageTemplateCustomizer
from .image_template_distributor_py3 import ImageTemplateDistributor
from .provisioning_error_py3 import ProvisioningError
from .image_template_last_run_status_py3 import ImageTemplateLastRunStatus
from .image_template_py3 import ImageTemplate
from .image_template_iso_source_py3 import ImageTemplateIsoSource
from .image_template_platform_image_source_py3 import ImageTemplatePlatformImageSource
from .image_template_managed_image_source_py3 import ImageTemplateManagedImageSource
from .image_template_shell_customizer_py3 import ImageTemplateShellCustomizer
from .image_template_restart_customizer_py3 import ImageTemplateRestartCustomizer
from .image_template_power_shell_customizer_py3 import ImageTemplatePowerShellCustomizer
from .image_template_managed_image_distributor_py3 import ImageTemplateManagedImageDistributor
from .image_template_shared_image_distributor_py3 import ImageTemplateSharedImageDistributor
from .image_template_vhd_distributor_py3 import ImageTemplateVhdDistributor
from .image_template_update_parameters_py3 import ImageTemplateUpdateParameters
from .run_output_py3 import RunOutput
from .resource_py3 import Resource
from .sub_resource_py3 import SubResource
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .api_error_base_py3 import ApiErrorBase
from .inner_error_py3 import InnerError
from .api_error_py3 import ApiError, ApiErrorException
except (SyntaxError, ImportError):
from .image_template_source import ImageTemplateSource
from .image_template_customizer import ImageTemplateCustomizer
from .image_template_distributor import ImageTemplateDistributor
from .provisioning_error import ProvisioningError
from .image_template_last_run_status import ImageTemplateLastRunStatus
from .image_template import ImageTemplate
from .image_template_iso_source import ImageTemplateIsoSource
from .image_template_platform_image_source import ImageTemplatePlatformImageSource
from .image_template_managed_image_source import ImageTemplateManagedImageSource
from .image_template_shell_customizer import ImageTemplateShellCustomizer
from .image_template_restart_customizer import ImageTemplateRestartCustomizer
from .image_template_power_shell_customizer import ImageTemplatePowerShellCustomizer
from .image_template_managed_image_distributor import ImageTemplateManagedImageDistributor
from .image_template_shared_image_distributor import ImageTemplateSharedImageDistributor
from .image_template_vhd_distributor import ImageTemplateVhdDistributor
from .image_template_update_parameters import ImageTemplateUpdateParameters
from .run_output import RunOutput
from .resource import Resource
from .sub_resource import SubResource
from .operation_display import OperationDisplay
from .operation import Operation
from .api_error_base import ApiErrorBase
from .inner_error import InnerError
from .api_error import ApiError, ApiErrorException
from .image_template_paged import ImageTemplatePaged
from .run_output_paged import RunOutputPaged
from .operation_paged import OperationPaged

__all__ = [
'ImageTemplateSource',
'ImageTemplateCustomizer',
'ImageTemplateDistributor',
'ProvisioningError',
'ImageTemplateLastRunStatus',
'ImageTemplate',
'ImageTemplateIsoSource',
'ImageTemplatePlatformImageSource',
'ImageTemplateManagedImageSource',
'ImageTemplateShellCustomizer',
'ImageTemplateRestartCustomizer',
'ImageTemplatePowerShellCustomizer',
'ImageTemplateManagedImageDistributor',
'ImageTemplateSharedImageDistributor',
'ImageTemplateVhdDistributor',
'ImageTemplateUpdateParameters',
'RunOutput',
'Resource',
'SubResource',
'OperationDisplay',
'Operation',
'ApiErrorBase',
'InnerError',
'ApiError', 'ApiErrorException',
'ImageTemplatePaged',
'RunOutputPaged',
'OperationPaged',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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
from msrest.exceptions import HttpOperationError


class ApiError(Model):
"""Api error.
:param details: The Api error details
:type details: list[~azure.mgmt.imagebuilder.models.ApiErrorBase]
:param inner_error: The Api inner error
:type inner_error: ~azure.mgmt.imagebuilder.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]'},
'inner_error': {'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.inner_error = kwargs.get('inner_error', None)
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
@@ -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)
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, *, code: str=None, target: str=None, message: str=None, **kwargs) -> None:
super(ApiErrorBase, self).__init__(**kwargs)
self.code = code
self.target = target
self.message = message
Loading

0 comments on commit c98bf08

Please sign in to comment.