Skip to content

Commit

Permalink
[AutoPR] imagebuilder/resource-manager (#4846)
Browse files Browse the repository at this point in the history
* Generated from d097ecaaa7e9e76be9d2edf40052fd25b8a3e300 (#4845)

ImageBuilder May preview for Python

* 0.2.0
  • Loading branch information
AutorestCI authored and lmazuel committed Apr 13, 2019
1 parent 15b4c25 commit c839e53
Show file tree
Hide file tree
Showing 33 changed files with 515 additions and 77 deletions.
5 changes: 5 additions & 0 deletions azure-mgmt-imagebuilder/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

0.2.0 (2019-04-12)
++++++++++++++++++

* New API version 2019-05-01-preview

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
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.api_version = '2019-05-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
16 changes: 16 additions & 0 deletions azure-mgmt-imagebuilder/azure/mgmt/imagebuilder/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
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_identity_user_assigned_identities_value_py3 import ImageTemplateIdentityUserAssignedIdentitiesValue
from .image_template_identity_py3 import ImageTemplateIdentity
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_shared_image_version_source_py3 import ImageTemplateSharedImageVersionSource
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_file_customizer_py3 import ImageTemplateFileCustomizer
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
Expand All @@ -40,13 +44,17 @@
from .image_template_distributor import ImageTemplateDistributor
from .provisioning_error import ProvisioningError
from .image_template_last_run_status import ImageTemplateLastRunStatus
from .image_template_identity_user_assigned_identities_value import ImageTemplateIdentityUserAssignedIdentitiesValue
from .image_template_identity import ImageTemplateIdentity
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_shared_image_version_source import ImageTemplateSharedImageVersionSource
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_file_customizer import ImageTemplateFileCustomizer
from .image_template_managed_image_distributor import ImageTemplateManagedImageDistributor
from .image_template_shared_image_distributor import ImageTemplateSharedImageDistributor
from .image_template_vhd_distributor import ImageTemplateVhdDistributor
Expand All @@ -62,20 +70,27 @@
from .image_template_paged import ImageTemplatePaged
from .run_output_paged import RunOutputPaged
from .operation_paged import OperationPaged
from .image_builder_client_enums import (
ResourceIdentityType,
)

__all__ = [
'ImageTemplateSource',
'ImageTemplateCustomizer',
'ImageTemplateDistributor',
'ProvisioningError',
'ImageTemplateLastRunStatus',
'ImageTemplateIdentityUserAssignedIdentitiesValue',
'ImageTemplateIdentity',
'ImageTemplate',
'ImageTemplateIsoSource',
'ImageTemplatePlatformImageSource',
'ImageTemplateManagedImageSource',
'ImageTemplateSharedImageVersionSource',
'ImageTemplateShellCustomizer',
'ImageTemplateRestartCustomizer',
'ImageTemplatePowerShellCustomizer',
'ImageTemplateFileCustomizer',
'ImageTemplateManagedImageDistributor',
'ImageTemplateSharedImageDistributor',
'ImageTemplateVhdDistributor',
Expand All @@ -91,4 +106,5 @@
'ImageTemplatePaged',
'RunOutputPaged',
'OperationPaged',
'ResourceIdentityType',
]
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 enum import Enum


class ResourceIdentityType(str, Enum):

user_assigned = "UserAssigned"
none = "None"
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ImageTemplate(Resource):
:type distribute:
list[~azure.mgmt.imagebuilder.models.ImageTemplateDistributor]
:ivar provisioning_state: Provisioning state of the resource. Possible
values include: 'Creating', 'Succeeded', 'Failed', 'Deleting'
values include: 'Creating', 'Updating', 'Succeeded', 'Failed', 'Deleting'
:vartype provisioning_state: str or ~azure.mgmt.imagebuilder.models.enum
:ivar provisioning_error: Provisioning error, if any
:vartype provisioning_error:
Expand All @@ -51,6 +51,11 @@ class ImageTemplate(Resource):
last executed.
:vartype last_run_status:
~azure.mgmt.imagebuilder.models.ImageTemplateLastRunStatus
:param build_timeout_in_minutes: Maximum duration to wait while building
the image template. Default is 60 minutes.
:type build_timeout_in_minutes: int
:param identity: The identity of the image template, if configured.
:type identity: ~azure.mgmt.imagebuilder.models.ImageTemplateIdentity
"""

_validation = {
Expand All @@ -77,6 +82,8 @@ class ImageTemplate(Resource):
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'provisioning_error': {'key': 'properties.provisioningError', 'type': 'ProvisioningError'},
'last_run_status': {'key': 'properties.lastRunStatus', 'type': 'ImageTemplateLastRunStatus'},
'build_timeout_in_minutes': {'key': 'properties.buildTimeoutInMinutes', 'type': 'int'},
'identity': {'key': 'identity', 'type': 'ImageTemplateIdentity'},
}

def __init__(self, **kwargs):
Expand All @@ -87,3 +94,5 @@ def __init__(self, **kwargs):
self.provisioning_state = None
self.provisioning_error = None
self.last_run_status = None
self.build_timeout_in_minutes = kwargs.get('build_timeout_in_minutes', None)
self.identity = kwargs.get('identity', None)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class ImageTemplateCustomizer(Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ImageTemplateShellCustomizer,
ImageTemplateRestartCustomizer, ImageTemplatePowerShellCustomizer
ImageTemplateRestartCustomizer, ImageTemplatePowerShellCustomizer,
ImageTemplateFileCustomizer
All required parameters must be populated in order to send to Azure.
Expand All @@ -38,7 +39,7 @@ class ImageTemplateCustomizer(Model):
}

_subtype_map = {
'type': {'Shell': 'ImageTemplateShellCustomizer', 'WindowsRestart': 'ImageTemplateRestartCustomizer', 'PowerShell': 'ImageTemplatePowerShellCustomizer'}
'type': {'Shell': 'ImageTemplateShellCustomizer', 'WindowsRestart': 'ImageTemplateRestartCustomizer', 'PowerShell': 'ImageTemplatePowerShellCustomizer', 'File': 'ImageTemplateFileCustomizer'}
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class ImageTemplateCustomizer(Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ImageTemplateShellCustomizer,
ImageTemplateRestartCustomizer, ImageTemplatePowerShellCustomizer
ImageTemplateRestartCustomizer, ImageTemplatePowerShellCustomizer,
ImageTemplateFileCustomizer
All required parameters must be populated in order to send to Azure.
Expand All @@ -38,7 +39,7 @@ class ImageTemplateCustomizer(Model):
}

_subtype_map = {
'type': {'Shell': 'ImageTemplateShellCustomizer', 'WindowsRestart': 'ImageTemplateRestartCustomizer', 'PowerShell': 'ImageTemplatePowerShellCustomizer'}
'type': {'Shell': 'ImageTemplateShellCustomizer', 'WindowsRestart': 'ImageTemplateRestartCustomizer', 'PowerShell': 'ImageTemplatePowerShellCustomizer', 'File': 'ImageTemplateFileCustomizer'}
}

def __init__(self, *, name: str=None, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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_template_customizer import ImageTemplateCustomizer


class ImageTemplateFileCustomizer(ImageTemplateCustomizer):
"""Uploads files to VMs (Linux, Windows). Corresponds to Packer file
provisioner.
All required parameters must be populated in order to send to Azure.
:param name: Friendly Name to provide context on what this customization
step does
:type name: str
:param type: Required. Constant filled by server.
:type type: str
:param source_uri: The URI of the file to be uploaded for customizing the
VM. It can be a github link, SAS URI for Azure Storage, etc
:type source_uri: str
:param destination: The absolute path (with existing directory structure)
where the file will be uploaded to in the VM
:type destination: str
"""

_validation = {
'type': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'source_uri': {'key': 'sourceUri', 'type': 'str'},
'destination': {'key': 'destination', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ImageTemplateFileCustomizer, self).__init__(**kwargs)
self.source_uri = kwargs.get('source_uri', None)
self.destination = kwargs.get('destination', None)
self.type = 'File'
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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_template_customizer_py3 import ImageTemplateCustomizer


class ImageTemplateFileCustomizer(ImageTemplateCustomizer):
"""Uploads files to VMs (Linux, Windows). Corresponds to Packer file
provisioner.
All required parameters must be populated in order to send to Azure.
:param name: Friendly Name to provide context on what this customization
step does
:type name: str
:param type: Required. Constant filled by server.
:type type: str
:param source_uri: The URI of the file to be uploaded for customizing the
VM. It can be a github link, SAS URI for Azure Storage, etc
:type source_uri: str
:param destination: The absolute path (with existing directory structure)
where the file will be uploaded to in the VM
:type destination: str
"""

_validation = {
'type': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'source_uri': {'key': 'sourceUri', 'type': 'str'},
'destination': {'key': 'destination', 'type': 'str'},
}

def __init__(self, *, name: str=None, source_uri: str=None, destination: str=None, **kwargs) -> None:
super(ImageTemplateFileCustomizer, self).__init__(name=name, **kwargs)
self.source_uri = source_uri
self.destination = destination
self.type = 'File'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 ImageTemplateIdentity(Model):
"""Identity for the image template.
:param type: The type of identity used for the image template. The type
'None' will remove any identities from the image template. Possible values
include: 'UserAssigned', 'None'
:type type: str or ~azure.mgmt.imagebuilder.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the image template. The user identity dictionary key references will
be ARM resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.imagebuilder.models.ImageTemplateIdentityUserAssignedIdentitiesValue]
"""

_attribute_map = {
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ImageTemplateIdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, **kwargs):
super(ImageTemplateIdentity, self).__init__(**kwargs)
self.type = kwargs.get('type', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 ImageTemplateIdentity(Model):
"""Identity for the image template.
:param type: The type of identity used for the image template. The type
'None' will remove any identities from the image template. Possible values
include: 'UserAssigned', 'None'
:type type: str or ~azure.mgmt.imagebuilder.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the image template. The user identity dictionary key references will
be ARM resource ids in the form:
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
:type user_assigned_identities: dict[str,
~azure.mgmt.imagebuilder.models.ImageTemplateIdentityUserAssignedIdentitiesValue]
"""

_attribute_map = {
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ImageTemplateIdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None:
super(ImageTemplateIdentity, self).__init__(**kwargs)
self.type = type
self.user_assigned_identities = user_assigned_identities
Loading

0 comments on commit c839e53

Please sign in to comment.