diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/__init__.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/__init__.py new file mode 100644 index 000000000000..efd6adb1a27f --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import BlueprintManagementClientConfiguration +from ._blueprint_management_client import BlueprintManagementClient +__all__ = ['BlueprintManagementClient', 'BlueprintManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_blueprint_management_client.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_blueprint_management_client.py new file mode 100644 index 000000000000..d4061179f386 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_blueprint_management_client.py @@ -0,0 +1,72 @@ +# 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 ._configuration import BlueprintManagementClientConfiguration +from .operations import BlueprintsOperations +from .operations import ArtifactsOperations +from .operations import PublishedBlueprintsOperations +from .operations import PublishedArtifactsOperations +from .operations import AssignmentsOperations +from .operations import AssignmentOperations +from . import models + + +class BlueprintManagementClient(SDKClient): + """Blueprint Client + + :ivar config: Configuration for client. + :vartype config: BlueprintManagementClientConfiguration + + :ivar blueprints: Blueprints operations + :vartype blueprints: azure.mgmt.blueprint.operations.BlueprintsOperations + :ivar artifacts: Artifacts operations + :vartype artifacts: azure.mgmt.blueprint.operations.ArtifactsOperations + :ivar published_blueprints: PublishedBlueprints operations + :vartype published_blueprints: azure.mgmt.blueprint.operations.PublishedBlueprintsOperations + :ivar published_artifacts: PublishedArtifacts operations + :vartype published_artifacts: azure.mgmt.blueprint.operations.PublishedArtifactsOperations + :ivar assignments: Assignments operations + :vartype assignments: azure.mgmt.blueprint.operations.AssignmentsOperations + :ivar assignment_operations: AssignmentOperations operations + :vartype assignment_operations: azure.mgmt.blueprint.operations.AssignmentOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = BlueprintManagementClientConfiguration(credentials, base_url) + super(BlueprintManagementClient, 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-11-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.blueprints = BlueprintsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.artifacts = ArtifactsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.published_blueprints = PublishedBlueprintsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.published_artifacts = PublishedArtifactsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.assignments = AssignmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.assignment_operations = AssignmentOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_configuration.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_configuration.py new file mode 100644 index 000000000000..452521d85576 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/_configuration.py @@ -0,0 +1,43 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class BlueprintManagementClientConfiguration(AzureConfiguration): + """Configuration for BlueprintManagementClient + 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` + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(BlueprintManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-blueprint/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py new file mode 100644 index 000000000000..3193b52a7a95 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py @@ -0,0 +1,136 @@ +# 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 ._models_py3 import Artifact + from ._models_py3 import Assignment + from ._models_py3 import AssignmentDeploymentJob + from ._models_py3 import AssignmentDeploymentJobResult + from ._models_py3 import AssignmentJobCreatedResource + from ._models_py3 import AssignmentLockSettings + from ._models_py3 import AssignmentOperation + from ._models_py3 import AssignmentStatus + from ._models_py3 import AzureResourceBase + from ._models_py3 import AzureResourceManagerError + from ._models_py3 import Blueprint + from ._models_py3 import BlueprintResourceStatusBase + from ._models_py3 import BlueprintStatus + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorResponse + from ._models_py3 import KeyVaultReference + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import ParameterDefinition + from ._models_py3 import ParameterValue + from ._models_py3 import PolicyAssignmentArtifact + from ._models_py3 import PublishedBlueprint + from ._models_py3 import ResourceGroupDefinition + from ._models_py3 import ResourceGroupValue + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import RoleAssignmentArtifact + from ._models_py3 import SecretValueReference + from ._models_py3 import TemplateArtifact + from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import WhoIsBlueprintContract +except (SyntaxError, ImportError): + from ._models import Artifact + from ._models import Assignment + from ._models import AssignmentDeploymentJob + from ._models import AssignmentDeploymentJobResult + from ._models import AssignmentJobCreatedResource + from ._models import AssignmentLockSettings + from ._models import AssignmentOperation + from ._models import AssignmentStatus + from ._models import AzureResourceBase + from ._models import AzureResourceManagerError + from ._models import Blueprint + from ._models import BlueprintResourceStatusBase + from ._models import BlueprintStatus + from ._models import ErrorAdditionalInfo + from ._models import ErrorResponse + from ._models import KeyVaultReference + from ._models import ManagedServiceIdentity + from ._models import ParameterDefinition + from ._models import ParameterValue + from ._models import PolicyAssignmentArtifact + from ._models import PublishedBlueprint + from ._models import ResourceGroupDefinition + from ._models import ResourceGroupValue + from ._models import ResourceProviderOperation + from ._models import ResourceProviderOperationDisplay + from ._models import ResourceProviderOperationList + from ._models import RoleAssignmentArtifact + from ._models import SecretValueReference + from ._models import TemplateArtifact + from ._models import TrackedResource + from ._models import UserAssignedIdentity + from ._models import WhoIsBlueprintContract +from ._paged_models import ArtifactPaged +from ._paged_models import AssignmentOperationPaged +from ._paged_models import AssignmentPaged +from ._paged_models import BlueprintPaged +from ._paged_models import PublishedBlueprintPaged +from ._blueprint_management_client_enums import ( + BlueprintTargetScope, + TemplateParameterType, + ManagedServiceIdentityType, + AssignmentLockMode, + AssignmentProvisioningState, + AssignmentDeleteBehavior, +) + +__all__ = [ + 'Artifact', + 'Assignment', + 'AssignmentDeploymentJob', + 'AssignmentDeploymentJobResult', + 'AssignmentJobCreatedResource', + 'AssignmentLockSettings', + 'AssignmentOperation', + 'AssignmentStatus', + 'AzureResourceBase', + 'AzureResourceManagerError', + 'Blueprint', + 'BlueprintResourceStatusBase', + 'BlueprintStatus', + 'ErrorAdditionalInfo', + 'ErrorResponse', + 'KeyVaultReference', + 'ManagedServiceIdentity', + 'ParameterDefinition', + 'ParameterValue', + 'PolicyAssignmentArtifact', + 'PublishedBlueprint', + 'ResourceGroupDefinition', + 'ResourceGroupValue', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', + 'RoleAssignmentArtifact', + 'SecretValueReference', + 'TemplateArtifact', + 'TrackedResource', + 'UserAssignedIdentity', + 'WhoIsBlueprintContract', + 'BlueprintPaged', + 'ArtifactPaged', + 'PublishedBlueprintPaged', + 'AssignmentPaged', + 'AssignmentOperationPaged', + 'BlueprintTargetScope', + 'TemplateParameterType', + 'ManagedServiceIdentityType', + 'AssignmentLockMode', + 'AssignmentProvisioningState', + 'AssignmentDeleteBehavior', +] diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_blueprint_management_client_enums.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_blueprint_management_client_enums.py new file mode 100644 index 000000000000..269d254feb3f --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_blueprint_management_client_enums.py @@ -0,0 +1,63 @@ +# 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 BlueprintTargetScope(str, Enum): + + subscription = "subscription" #: The blueprint targets a subscription during blueprint assignment. + management_group = "managementGroup" #: The blueprint targets a management group during blueprint assignment. This is reserved for future use. + + +class TemplateParameterType(str, Enum): + + string = "string" + array = "array" + bool_enum = "bool" + int_enum = "int" + object_enum = "object" + secure_object = "secureObject" + secure_string = "secureString" + + +class ManagedServiceIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + + +class AssignmentLockMode(str, Enum): + + none = "None" + all_resources_read_only = "AllResourcesReadOnly" + all_resources_do_not_delete = "AllResourcesDoNotDelete" + + +class AssignmentProvisioningState(str, Enum): + + creating = "creating" + validating = "validating" + waiting = "waiting" + deploying = "deploying" + cancelling = "cancelling" + locking = "locking" + succeeded = "succeeded" + failed = "failed" + canceled = "canceled" + deleting = "deleting" + + +class AssignmentDeleteBehavior(str, Enum): + + none = "none" + all = "all" diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models.py new file mode 100644 index 000000000000..a37e970042be --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models.py @@ -0,0 +1,1402 @@ +# 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 AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + + +class Artifact(AzureResourceBase): + """Represents a blueprint artifact. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: TemplateArtifact, RoleAssignmentArtifact, + PolicyAssignmentArtifact + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'template': 'TemplateArtifact', 'roleAssignment': 'RoleAssignmentArtifact', 'policyAssignment': 'PolicyAssignmentArtifact'} + } + + def __init__(self, **kwargs): + super(Artifact, self).__init__(**kwargs) + self.kind = None + self.kind = 'Artifact' + + +class ArtifactPropertiesBase(Model): + """Common properties shared by different artifacts. + + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ArtifactPropertiesBase, self).__init__(**kwargs) + self.depends_on = kwargs.get('depends_on', None) + + +class TrackedResource(AzureResourceBase): + """Common properties for all Azure tracked resources. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param location: Required. The location of this blueprint assignment. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + + +class Assignment(TrackedResource): + """Represents a blueprint assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param location: Required. The location of this blueprint assignment. + :type location: str + :param identity: Required. Managed identity for this blueprint assignment. + :type identity: ~azure.mgmt.blueprint.models.ManagedServiceIdentity + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param blueprint_id: ID of the published version of a blueprint + definition. + :type blueprint_id: str + :param scope: The target subscription scope of the blueprint assignment + (format: '/subscriptions/{subscriptionId}'). For management group level + assignments, the property is required. + :type scope: str + :param parameters: Required. Blueprint assignment parameter values. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + :param resource_groups: Required. Names and locations of resource group + placeholders. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupValue] + :ivar status: Status of blueprint assignment. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.AssignmentStatus + :param locks: Defines how resources deployed by a blueprint assignment are + locked. + :type locks: ~azure.mgmt.blueprint.models.AssignmentLockSettings + :ivar provisioning_state: State of the blueprint assignment. Possible + values include: 'creating', 'validating', 'waiting', 'deploying', + 'cancelling', 'locking', 'succeeded', 'failed', 'canceled', 'deleting' + :vartype provisioning_state: str or + ~azure.mgmt.blueprint.models.AssignmentProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'identity': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'parameters': {'required': True}, + 'resource_groups': {'required': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'blueprint_id': {'key': 'properties.blueprintId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupValue}'}, + 'status': {'key': 'properties.status', 'type': 'AssignmentStatus'}, + 'locks': {'key': 'properties.locks', 'type': 'AssignmentLockSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Assignment, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.blueprint_id = kwargs.get('blueprint_id', None) + self.scope = kwargs.get('scope', None) + self.parameters = kwargs.get('parameters', None) + self.resource_groups = kwargs.get('resource_groups', None) + self.status = None + self.locks = kwargs.get('locks', None) + self.provisioning_state = None + + +class AssignmentDeploymentJob(Model): + """Represents individual job in given blueprint assignment operation. + + :param kind: Kind of job. + :type kind: str + :param action: Name of the action performed in this job. + :type action: str + :param job_id: Id of this job. + :type job_id: str + :param job_state: State of this job. + :type job_state: str + :param result: Deployment job result. + :type result: ~azure.mgmt.blueprint.models.AssignmentDeploymentJobResult + :param history: Result of this deployment job for each retry. + :type history: + list[~azure.mgmt.blueprint.models.AssignmentDeploymentJobResult] + :param request_uri: Reference to deployment job resource id. + :type request_uri: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'job_state': {'key': 'jobState', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'AssignmentDeploymentJobResult'}, + 'history': {'key': 'history', 'type': '[AssignmentDeploymentJobResult]'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AssignmentDeploymentJob, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.action = kwargs.get('action', None) + self.job_id = kwargs.get('job_id', None) + self.job_state = kwargs.get('job_state', None) + self.result = kwargs.get('result', None) + self.history = kwargs.get('history', None) + self.request_uri = kwargs.get('request_uri', None) + + +class AssignmentDeploymentJobResult(Model): + """Result of each individual deployment in a blueprint assignment. + + :param error: Contains error details if deployment job failed. + :type error: ~azure.mgmt.blueprint.models.AzureResourceManagerError + :param resources: Resources created as result of the deployment job. + :type resources: + list[~azure.mgmt.blueprint.models.AssignmentJobCreatedResource] + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'AzureResourceManagerError'}, + 'resources': {'key': 'resources', 'type': '[AssignmentJobCreatedResource]'}, + } + + def __init__(self, **kwargs): + super(AssignmentDeploymentJobResult, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + self.resources = kwargs.get('resources', None) + + +class AssignmentJobCreatedResource(AzureResourceBase): + """Azure resource created from deployment job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param properties: Additional properties in a dictionary. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(AssignmentJobCreatedResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class AssignmentLockSettings(Model): + """Defines how resources deployed by a blueprint assignment are locked. + + :param mode: Lock mode. Possible values include: 'None', + 'AllResourcesReadOnly', 'AllResourcesDoNotDelete' + :type mode: str or ~azure.mgmt.blueprint.models.AssignmentLockMode + :param excluded_principals: List of AAD principals excluded from blueprint + locks. Up to 5 principals are permitted. + :type excluded_principals: list[str] + :param excluded_actions: List of management operations that are excluded + from blueprint locks. Up to 200 actions are permitted. If the lock mode is + set to 'AllResourcesReadOnly', then the following actions are + automatically appended to 'excludedActions': '*/read', + 'Microsoft.Network/virtualNetworks/subnets/join/action' and + 'Microsoft.Authorization/locks/delete'. If the lock mode is set to + 'AllResourcesDoNotDelete', then the following actions are automatically + appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. + Duplicate actions will get removed. + :type excluded_actions: list[str] + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'excluded_principals': {'key': 'excludedPrincipals', 'type': '[str]'}, + 'excluded_actions': {'key': 'excludedActions', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AssignmentLockSettings, self).__init__(**kwargs) + self.mode = kwargs.get('mode', None) + self.excluded_principals = kwargs.get('excluded_principals', None) + self.excluded_actions = kwargs.get('excluded_actions', None) + + +class AssignmentOperation(AzureResourceBase): + """Represents underlying deployment detail for each update to the blueprint + assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param blueprint_version: The published version of the blueprint + definition used for the blueprint assignment operation. + :type blueprint_version: str + :param assignment_state: State of this blueprint assignment operation. + :type assignment_state: str + :param time_created: Create time of this blueprint assignment operation. + :type time_created: str + :param time_started: Start time of the underlying deployment. + :type time_started: str + :param time_finished: Finish time of the overall underlying deployments. + :type time_finished: str + :param deployments: List of jobs in this blueprint assignment operation. + :type deployments: + list[~azure.mgmt.blueprint.models.AssignmentDeploymentJob] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'blueprint_version': {'key': 'properties.blueprintVersion', 'type': 'str'}, + 'assignment_state': {'key': 'properties.assignmentState', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'str'}, + 'time_started': {'key': 'properties.timeStarted', 'type': 'str'}, + 'time_finished': {'key': 'properties.timeFinished', 'type': 'str'}, + 'deployments': {'key': 'properties.deployments', 'type': '[AssignmentDeploymentJob]'}, + } + + def __init__(self, **kwargs): + super(AssignmentOperation, self).__init__(**kwargs) + self.blueprint_version = kwargs.get('blueprint_version', None) + self.assignment_state = kwargs.get('assignment_state', None) + self.time_created = kwargs.get('time_created', None) + self.time_started = kwargs.get('time_started', None) + self.time_finished = kwargs.get('time_finished', None) + self.deployments = kwargs.get('deployments', None) + + +class BlueprintResourceStatusBase(Model): + """Shared status properties between all blueprint resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(BlueprintResourceStatusBase, self).__init__(**kwargs) + self.time_created = None + self.last_modified = None + + +class AssignmentStatus(BlueprintResourceStatusBase): + """The status of a blueprint assignment. This field is readonly. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + :ivar managed_resources: List of resources that were created by the + blueprint assignment. + :vartype managed_resources: list[str] + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'managed_resources': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'managed_resources': {'key': 'managedResources', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AssignmentStatus, self).__init__(**kwargs) + self.managed_resources = None + + +class AzureResourceManagerError(Model): + """Error code and message. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureResourceManagerError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Blueprint(AzureResourceBase): + """Represents a Blueprint definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + :param versions: Published versions of this blueprint definition. + :type versions: object + :param layout: Layout view of the blueprint definition for UI reference. + :type layout: object + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'properties.targetScope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupDefinition}'}, + 'versions': {'key': 'properties.versions', 'type': 'object'}, + 'layout': {'key': 'properties.layout', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(Blueprint, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.status = None + self.target_scope = kwargs.get('target_scope', None) + self.parameters = kwargs.get('parameters', None) + self.resource_groups = kwargs.get('resource_groups', None) + self.versions = kwargs.get('versions', None) + self.layout = kwargs.get('layout', None) + + +class BlueprintResourcePropertiesBase(Model): + """Shared properties between all blueprint resources. + + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BlueprintResourcePropertiesBase, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + + +class BlueprintStatus(BlueprintResourceStatusBase): + """The status of the blueprint. This field is readonly. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(BlueprintStatus, self).__init__(**kwargs) + + +class CloudError(Model): + """CloudError. + + :param error: + :type error: ~azure.mgmt.blueprint.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.blueprint.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.blueprint.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class KeyVaultReference(Model): + """Specifies the link to a Key Vault. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure resource ID of the Key Vault. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultReference, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class ManagedServiceIdentity(Model): + """Managed identity generic object. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the managed identity. Possible values + include: 'None', 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.blueprint.models.ManagedServiceIdentityType + :param principal_id: Azure Active Directory principal ID associated with + this Identity. + :type principal_id: str + :param tenant_id: ID of the Azure Active Directory. + :type tenant_id: str + :param user_assigned_identities: The list of user-assigned managed + identities associated with the resource. Key is the Azure resource Id of + the managed identity. + :type user_assigned_identities: dict[str, + ~azure.mgmt.blueprint.models.UserAssignedIdentity] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__(self, **kwargs): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ParameterDefinition(Model): + """Represent a parameter with constrains and metadata. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Allowed data types for Resource Manager template + parameters. Possible values include: 'string', 'array', 'bool', 'int', + 'object', 'secureObject', 'secureString' + :type type: str or ~azure.mgmt.blueprint.models.TemplateParameterType + :param display_name: DisplayName of this parameter/resourceGroup. + :type display_name: str + :param description: Description of this parameter/resourceGroup. + :type description: str + :param strong_type: StrongType for UI to render rich experience during + blueprint assignment. Supported strong types are resourceType, principalId + and location. + :type strong_type: str + :param default_value: Default Value for this parameter. + :type default_value: object + :param allowed_values: Array of allowed values for this parameter. + :type allowed_values: list[object] + """ + + _validation = { + 'type': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'strong_type': {'max_length': 64}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'metadata.displayName', 'type': 'str'}, + 'description': {'key': 'metadata.description', 'type': 'str'}, + 'strong_type': {'key': 'metadata.strongType', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'object'}, + 'allowed_values': {'key': 'allowedValues', 'type': '[object]'}, + } + + def __init__(self, **kwargs): + super(ParameterDefinition, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.strong_type = kwargs.get('strong_type', None) + self.default_value = kwargs.get('default_value', None) + self.allowed_values = kwargs.get('allowed_values', None) + + +class ParameterValue(Model): + """Value for the specified parameter. Can be either 'value' or 'reference' but + not both. + + :param value: Parameter value. Any valid JSON value is allowed including + objects, arrays, strings, numbers and booleans. + :type value: object + :param reference: Parameter value as reference type. + :type reference: ~azure.mgmt.blueprint.models.SecretValueReference + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'object'}, + 'reference': {'key': 'reference', 'type': 'SecretValueReference'}, + } + + def __init__(self, **kwargs): + super(ParameterValue, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.reference = kwargs.get('reference', None) + + +class PolicyAssignmentArtifact(Artifact): + """Blueprint artifact that applies a Policy assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param policy_definition_id: Required. Azure resource ID of the policy + definition. + :type policy_definition_id: str + :param parameters: Required. Parameter values for the policy definition. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + :param resource_group: Name of the resource group placeholder to which the + policy will be assigned. + :type resource_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'policy_definition_id': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PolicyAssignmentArtifact, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.depends_on = kwargs.get('depends_on', None) + self.policy_definition_id = kwargs.get('policy_definition_id', None) + self.parameters = kwargs.get('parameters', None) + self.resource_group = kwargs.get('resource_group', None) + self.kind = 'policyAssignment' + + +class PublishedBlueprint(AzureResourceBase): + """Represents a published blueprint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + :param blueprint_name: Name of the published blueprint definition. + :type blueprint_name: str + :param change_notes: Version-specific change notes. + :type change_notes: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + 'change_notes': {'max_length': 500}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'properties.targetScope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupDefinition}'}, + 'blueprint_name': {'key': 'properties.blueprintName', 'type': 'str'}, + 'change_notes': {'key': 'properties.changeNotes', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublishedBlueprint, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.status = None + self.target_scope = kwargs.get('target_scope', None) + self.parameters = kwargs.get('parameters', None) + self.resource_groups = kwargs.get('resource_groups', None) + self.blueprint_name = kwargs.get('blueprint_name', None) + self.change_notes = kwargs.get('change_notes', None) + + +class ResourceGroupDefinition(Model): + """Represents an Azure resource group in a blueprint definition. + + :param name: Name of this resourceGroup. Leave empty if the resource group + name will be specified during the blueprint assignment. + :type name: str + :param location: Location of this resourceGroup. Leave empty if the + resource group location will be specified during the blueprint assignment. + :type location: str + :param display_name: DisplayName of this parameter/resourceGroup. + :type display_name: str + :param description: Description of this parameter/resourceGroup. + :type description: str + :param strong_type: StrongType for UI to render rich experience during + blueprint assignment. Supported strong types are resourceType, principalId + and location. + :type strong_type: str + :param depends_on: Artifacts which need to be deployed before this + resource group. + :type depends_on: list[str] + :param tags: Tags to be assigned to this resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'strong_type': {'max_length': 64}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_name': {'key': 'metadata.displayName', 'type': 'str'}, + 'description': {'key': 'metadata.description', 'type': 'str'}, + 'strong_type': {'key': 'metadata.strongType', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.strong_type = kwargs.get('strong_type', None) + self.depends_on = kwargs.get('depends_on', None) + self.tags = kwargs.get('tags', None) + + +class ResourceGroupValue(Model): + """Represents an Azure resource group. + + :param name: Name of the resource group. + :type name: str + :param location: Location of the resource group. + :type location: str + """ + + _validation = { + 'name': {'max_length': 90, 'min_length': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupValue, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.blueprint.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Blueprint. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ResourceProviderOperationList(Model): + """Results of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: list[~azure.mgmt.blueprint.models.ResourceProviderOperation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class RoleAssignmentArtifact(Artifact): + """Blueprint artifact that applies a Role assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param role_definition_id: Required. Azure resource ID of the + RoleDefinition. + :type role_definition_id: str + :param principal_ids: Required. Array of user or group identities in Azure + Active Directory. The roleDefinition will apply to each identity. + :type principal_ids: object + :param resource_group: RoleAssignment will be scope to this resourceGroup. + If empty, it scopes to the subscription. + :type resource_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'role_definition_id': {'required': True}, + 'principal_ids': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_ids': {'key': 'properties.principalIds', 'type': 'object'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RoleAssignmentArtifact, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.depends_on = kwargs.get('depends_on', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + self.principal_ids = kwargs.get('principal_ids', None) + self.resource_group = kwargs.get('resource_group', None) + self.kind = 'roleAssignment' + + +class SecretValueReference(Model): + """Reference to a Key Vault secret. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. Specifies the reference to a given Azure Key + Vault. + :type key_vault: ~azure.mgmt.blueprint.models.KeyVaultReference + :param secret_name: Required. Name of the secret. + :type secret_name: str + :param secret_version: The version of the secret to use. If left blank, + the latest version of the secret is used. + :type secret_version: str + """ + + _validation = { + 'key_vault': {'required': True}, + 'secret_name': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultReference'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretValueReference, self).__init__(**kwargs) + self.key_vault = kwargs.get('key_vault', None) + self.secret_name = kwargs.get('secret_name', None) + self.secret_version = kwargs.get('secret_version', None) + + +class SharedBlueprintProperties(BlueprintResourcePropertiesBase): + """Shared Schema for both blueprintProperties and + publishedBlueprintProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'targetScope', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'resourceGroups', 'type': '{ResourceGroupDefinition}'}, + } + + def __init__(self, **kwargs): + super(SharedBlueprintProperties, self).__init__(**kwargs) + self.status = None + self.target_scope = kwargs.get('target_scope', None) + self.parameters = kwargs.get('parameters', None) + self.resource_groups = kwargs.get('resource_groups', None) + + +class TemplateArtifact(Artifact): + """Blueprint artifact that deploys a Resource Manager template. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param template: Required. The Resource Manager template blueprint + artifact body. + :type template: object + :param resource_group: If applicable, the name of the resource group + placeholder to which the Resource Manager template blueprint artifact will + be deployed. + :type resource_group: str + :param parameters: Required. Resource Manager template blueprint artifact + parameter values. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'template': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'template': {'key': 'properties.template', 'type': 'object'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + } + + def __init__(self, **kwargs): + super(TemplateArtifact, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.depends_on = kwargs.get('depends_on', None) + self.template = kwargs.get('template', None) + self.resource_group = kwargs.get('resource_group', None) + self.parameters = kwargs.get('parameters', None) + self.kind = 'template' + + +class UserAssignedIdentity(Model): + """User-assigned managed identity. + + :param principal_id: Azure Active Directory principal ID associated with + this Identity. + :type principal_id: str + :param client_id: Client App Id associated with this identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.client_id = kwargs.get('client_id', None) + + +class WhoIsBlueprintContract(Model): + """Response schema for querying the Azure Blueprints service principal in the + tenant. + + :param object_id: AAD object Id of the Azure Blueprints service principal + in the tenant. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WhoIsBlueprintContract, self).__init__(**kwargs) + self.object_id = kwargs.get('object_id', None) diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models_py3.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models_py3.py new file mode 100644 index 000000000000..af968fed9ce7 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_models_py3.py @@ -0,0 +1,1402 @@ +# 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 AzureResourceBase(Model): + """Common properties for all Azure resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureResourceBase, self).__init__(**kwargs) + self.id = None + self.type = None + self.name = None + + +class Artifact(AzureResourceBase): + """Represents a blueprint artifact. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: TemplateArtifact, RoleAssignmentArtifact, + PolicyAssignmentArtifact + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + _subtype_map = { + 'kind': {'template': 'TemplateArtifact', 'roleAssignment': 'RoleAssignmentArtifact', 'policyAssignment': 'PolicyAssignmentArtifact'} + } + + def __init__(self, **kwargs) -> None: + super(Artifact, self).__init__(**kwargs) + self.kind = None + self.kind = 'Artifact' + + +class ArtifactPropertiesBase(Model): + """Common properties shared by different artifacts. + + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + """ + + _attribute_map = { + 'depends_on': {'key': 'dependsOn', 'type': '[str]'}, + } + + def __init__(self, *, depends_on=None, **kwargs) -> None: + super(ArtifactPropertiesBase, self).__init__(**kwargs) + self.depends_on = depends_on + + +class TrackedResource(AzureResourceBase): + """Common properties for all Azure tracked resources. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param location: Required. The location of this blueprint assignment. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + + +class Assignment(TrackedResource): + """Represents a blueprint assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param location: Required. The location of this blueprint assignment. + :type location: str + :param identity: Required. Managed identity for this blueprint assignment. + :type identity: ~azure.mgmt.blueprint.models.ManagedServiceIdentity + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param blueprint_id: ID of the published version of a blueprint + definition. + :type blueprint_id: str + :param scope: The target subscription scope of the blueprint assignment + (format: '/subscriptions/{subscriptionId}'). For management group level + assignments, the property is required. + :type scope: str + :param parameters: Required. Blueprint assignment parameter values. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + :param resource_groups: Required. Names and locations of resource group + placeholders. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupValue] + :ivar status: Status of blueprint assignment. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.AssignmentStatus + :param locks: Defines how resources deployed by a blueprint assignment are + locked. + :type locks: ~azure.mgmt.blueprint.models.AssignmentLockSettings + :ivar provisioning_state: State of the blueprint assignment. Possible + values include: 'creating', 'validating', 'waiting', 'deploying', + 'cancelling', 'locking', 'succeeded', 'failed', 'canceled', 'deleting' + :vartype provisioning_state: str or + ~azure.mgmt.blueprint.models.AssignmentProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'required': True}, + 'identity': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'parameters': {'required': True}, + 'resource_groups': {'required': True}, + 'status': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'blueprint_id': {'key': 'properties.blueprintId', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupValue}'}, + 'status': {'key': 'properties.status', 'type': 'AssignmentStatus'}, + 'locks': {'key': 'properties.locks', 'type': 'AssignmentLockSettings'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, location: str, identity, parameters, resource_groups, display_name: str=None, description: str=None, blueprint_id: str=None, scope: str=None, locks=None, **kwargs) -> None: + super(Assignment, self).__init__(location=location, **kwargs) + self.identity = identity + self.display_name = display_name + self.description = description + self.blueprint_id = blueprint_id + self.scope = scope + self.parameters = parameters + self.resource_groups = resource_groups + self.status = None + self.locks = locks + self.provisioning_state = None + + +class AssignmentDeploymentJob(Model): + """Represents individual job in given blueprint assignment operation. + + :param kind: Kind of job. + :type kind: str + :param action: Name of the action performed in this job. + :type action: str + :param job_id: Id of this job. + :type job_id: str + :param job_state: State of this job. + :type job_state: str + :param result: Deployment job result. + :type result: ~azure.mgmt.blueprint.models.AssignmentDeploymentJobResult + :param history: Result of this deployment job for each retry. + :type history: + list[~azure.mgmt.blueprint.models.AssignmentDeploymentJobResult] + :param request_uri: Reference to deployment job resource id. + :type request_uri: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'action': {'key': 'action', 'type': 'str'}, + 'job_id': {'key': 'jobId', 'type': 'str'}, + 'job_state': {'key': 'jobState', 'type': 'str'}, + 'result': {'key': 'result', 'type': 'AssignmentDeploymentJobResult'}, + 'history': {'key': 'history', 'type': '[AssignmentDeploymentJobResult]'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + } + + def __init__(self, *, kind: str=None, action: str=None, job_id: str=None, job_state: str=None, result=None, history=None, request_uri: str=None, **kwargs) -> None: + super(AssignmentDeploymentJob, self).__init__(**kwargs) + self.kind = kind + self.action = action + self.job_id = job_id + self.job_state = job_state + self.result = result + self.history = history + self.request_uri = request_uri + + +class AssignmentDeploymentJobResult(Model): + """Result of each individual deployment in a blueprint assignment. + + :param error: Contains error details if deployment job failed. + :type error: ~azure.mgmt.blueprint.models.AzureResourceManagerError + :param resources: Resources created as result of the deployment job. + :type resources: + list[~azure.mgmt.blueprint.models.AssignmentJobCreatedResource] + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'AzureResourceManagerError'}, + 'resources': {'key': 'resources', 'type': '[AssignmentJobCreatedResource]'}, + } + + def __init__(self, *, error=None, resources=None, **kwargs) -> None: + super(AssignmentDeploymentJobResult, self).__init__(**kwargs) + self.error = error + self.resources = resources + + +class AssignmentJobCreatedResource(AzureResourceBase): + """Azure resource created from deployment job. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param properties: Additional properties in a dictionary. + :type properties: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(AssignmentJobCreatedResource, self).__init__(**kwargs) + self.properties = properties + + +class AssignmentLockSettings(Model): + """Defines how resources deployed by a blueprint assignment are locked. + + :param mode: Lock mode. Possible values include: 'None', + 'AllResourcesReadOnly', 'AllResourcesDoNotDelete' + :type mode: str or ~azure.mgmt.blueprint.models.AssignmentLockMode + :param excluded_principals: List of AAD principals excluded from blueprint + locks. Up to 5 principals are permitted. + :type excluded_principals: list[str] + :param excluded_actions: List of management operations that are excluded + from blueprint locks. Up to 200 actions are permitted. If the lock mode is + set to 'AllResourcesReadOnly', then the following actions are + automatically appended to 'excludedActions': '*/read', + 'Microsoft.Network/virtualNetworks/subnets/join/action' and + 'Microsoft.Authorization/locks/delete'. If the lock mode is set to + 'AllResourcesDoNotDelete', then the following actions are automatically + appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. + Duplicate actions will get removed. + :type excluded_actions: list[str] + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'excluded_principals': {'key': 'excludedPrincipals', 'type': '[str]'}, + 'excluded_actions': {'key': 'excludedActions', 'type': '[str]'}, + } + + def __init__(self, *, mode=None, excluded_principals=None, excluded_actions=None, **kwargs) -> None: + super(AssignmentLockSettings, self).__init__(**kwargs) + self.mode = mode + self.excluded_principals = excluded_principals + self.excluded_actions = excluded_actions + + +class AssignmentOperation(AzureResourceBase): + """Represents underlying deployment detail for each update to the blueprint + assignment. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param blueprint_version: The published version of the blueprint + definition used for the blueprint assignment operation. + :type blueprint_version: str + :param assignment_state: State of this blueprint assignment operation. + :type assignment_state: str + :param time_created: Create time of this blueprint assignment operation. + :type time_created: str + :param time_started: Start time of the underlying deployment. + :type time_started: str + :param time_finished: Finish time of the overall underlying deployments. + :type time_finished: str + :param deployments: List of jobs in this blueprint assignment operation. + :type deployments: + list[~azure.mgmt.blueprint.models.AssignmentDeploymentJob] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'blueprint_version': {'key': 'properties.blueprintVersion', 'type': 'str'}, + 'assignment_state': {'key': 'properties.assignmentState', 'type': 'str'}, + 'time_created': {'key': 'properties.timeCreated', 'type': 'str'}, + 'time_started': {'key': 'properties.timeStarted', 'type': 'str'}, + 'time_finished': {'key': 'properties.timeFinished', 'type': 'str'}, + 'deployments': {'key': 'properties.deployments', 'type': '[AssignmentDeploymentJob]'}, + } + + def __init__(self, *, blueprint_version: str=None, assignment_state: str=None, time_created: str=None, time_started: str=None, time_finished: str=None, deployments=None, **kwargs) -> None: + super(AssignmentOperation, self).__init__(**kwargs) + self.blueprint_version = blueprint_version + self.assignment_state = assignment_state + self.time_created = time_created + self.time_started = time_started + self.time_finished = time_finished + self.deployments = deployments + + +class BlueprintResourceStatusBase(Model): + """Shared status properties between all blueprint resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(BlueprintResourceStatusBase, self).__init__(**kwargs) + self.time_created = None + self.last_modified = None + + +class AssignmentStatus(BlueprintResourceStatusBase): + """The status of a blueprint assignment. This field is readonly. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + :ivar managed_resources: List of resources that were created by the + blueprint assignment. + :vartype managed_resources: list[str] + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + 'managed_resources': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + 'managed_resources': {'key': 'managedResources', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(AssignmentStatus, self).__init__(**kwargs) + self.managed_resources = None + + +class AzureResourceManagerError(Model): + """Error code and message. + + :param code: Error code. + :type code: str + :param message: Error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(AzureResourceManagerError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class Blueprint(AzureResourceBase): + """Represents a Blueprint definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + :param versions: Published versions of this blueprint definition. + :type versions: object + :param layout: Layout view of the blueprint definition for UI reference. + :type layout: object + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'properties.targetScope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupDefinition}'}, + 'versions': {'key': 'properties.versions', 'type': 'object'}, + 'layout': {'key': 'properties.layout', 'type': 'object'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, target_scope=None, parameters=None, resource_groups=None, versions=None, layout=None, **kwargs) -> None: + super(Blueprint, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.status = None + self.target_scope = target_scope + self.parameters = parameters + self.resource_groups = resource_groups + self.versions = versions + self.layout = layout + + +class BlueprintResourcePropertiesBase(Model): + """Shared properties between all blueprint resources. + + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, **kwargs) -> None: + super(BlueprintResourcePropertiesBase, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + + +class BlueprintStatus(BlueprintResourceStatusBase): + """The status of the blueprint. This field is readonly. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar time_created: Creation time of this blueprint definition. + :vartype time_created: datetime + :ivar last_modified: Last modified time of this blueprint definition. + :vartype last_modified: datetime + """ + + _validation = { + 'time_created': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'time_created': {'key': 'timeCreated', 'type': 'iso-8601'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(BlueprintStatus, self).__init__(**kwargs) + + +class CloudError(Model): + """CloudError. + + :param error: + :type error: ~azure.mgmt.blueprint.models.ErrorResponse + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponse'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class ErrorAdditionalInfo(Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorResponse(Model): + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.blueprint.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.blueprint.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class KeyVaultReference(Model): + """Specifies the link to a Key Vault. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Azure resource ID of the Key Vault. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(KeyVaultReference, self).__init__(**kwargs) + self.id = id + + +class ManagedServiceIdentity(Model): + """Managed identity generic object. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Type of the managed identity. Possible values + include: 'None', 'SystemAssigned', 'UserAssigned' + :type type: str or ~azure.mgmt.blueprint.models.ManagedServiceIdentityType + :param principal_id: Azure Active Directory principal ID associated with + this Identity. + :type principal_id: str + :param tenant_id: ID of the Azure Active Directory. + :type tenant_id: str + :param user_assigned_identities: The list of user-assigned managed + identities associated with the resource. Key is the Azure resource Id of + the managed identity. + :type user_assigned_identities: dict[str, + ~azure.mgmt.blueprint.models.UserAssignedIdentity] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__(self, *, type, principal_id: str=None, tenant_id: str=None, user_assigned_identities=None, **kwargs) -> None: + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + self.user_assigned_identities = user_assigned_identities + + +class ParameterDefinition(Model): + """Represent a parameter with constrains and metadata. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Allowed data types for Resource Manager template + parameters. Possible values include: 'string', 'array', 'bool', 'int', + 'object', 'secureObject', 'secureString' + :type type: str or ~azure.mgmt.blueprint.models.TemplateParameterType + :param display_name: DisplayName of this parameter/resourceGroup. + :type display_name: str + :param description: Description of this parameter/resourceGroup. + :type description: str + :param strong_type: StrongType for UI to render rich experience during + blueprint assignment. Supported strong types are resourceType, principalId + and location. + :type strong_type: str + :param default_value: Default Value for this parameter. + :type default_value: object + :param allowed_values: Array of allowed values for this parameter. + :type allowed_values: list[object] + """ + + _validation = { + 'type': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'strong_type': {'max_length': 64}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'metadata.displayName', 'type': 'str'}, + 'description': {'key': 'metadata.description', 'type': 'str'}, + 'strong_type': {'key': 'metadata.strongType', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'object'}, + 'allowed_values': {'key': 'allowedValues', 'type': '[object]'}, + } + + def __init__(self, *, type, display_name: str=None, description: str=None, strong_type: str=None, default_value=None, allowed_values=None, **kwargs) -> None: + super(ParameterDefinition, self).__init__(**kwargs) + self.type = type + self.display_name = display_name + self.description = description + self.strong_type = strong_type + self.default_value = default_value + self.allowed_values = allowed_values + + +class ParameterValue(Model): + """Value for the specified parameter. Can be either 'value' or 'reference' but + not both. + + :param value: Parameter value. Any valid JSON value is allowed including + objects, arrays, strings, numbers and booleans. + :type value: object + :param reference: Parameter value as reference type. + :type reference: ~azure.mgmt.blueprint.models.SecretValueReference + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'object'}, + 'reference': {'key': 'reference', 'type': 'SecretValueReference'}, + } + + def __init__(self, *, value=None, reference=None, **kwargs) -> None: + super(ParameterValue, self).__init__(**kwargs) + self.value = value + self.reference = reference + + +class PolicyAssignmentArtifact(Artifact): + """Blueprint artifact that applies a Policy assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param policy_definition_id: Required. Azure resource ID of the policy + definition. + :type policy_definition_id: str + :param parameters: Required. Parameter values for the policy definition. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + :param resource_group: Name of the resource group placeholder to which the + policy will be assigned. + :type resource_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'policy_definition_id': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'policy_definition_id': {'key': 'properties.policyDefinitionId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, policy_definition_id: str, parameters, display_name: str=None, description: str=None, depends_on=None, resource_group: str=None, **kwargs) -> None: + super(PolicyAssignmentArtifact, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.depends_on = depends_on + self.policy_definition_id = policy_definition_id + self.parameters = parameters + self.resource_group = resource_group + self.kind = 'policyAssignment' + + +class PublishedBlueprint(AzureResourceBase): + """Represents a published blueprint. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + :param blueprint_name: Name of the published blueprint definition. + :type blueprint_name: str + :param change_notes: Version-specific change notes. + :type change_notes: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + 'change_notes': {'max_length': 500}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'properties.targetScope', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'properties.resourceGroups', 'type': '{ResourceGroupDefinition}'}, + 'blueprint_name': {'key': 'properties.blueprintName', 'type': 'str'}, + 'change_notes': {'key': 'properties.changeNotes', 'type': 'str'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, target_scope=None, parameters=None, resource_groups=None, blueprint_name: str=None, change_notes: str=None, **kwargs) -> None: + super(PublishedBlueprint, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.status = None + self.target_scope = target_scope + self.parameters = parameters + self.resource_groups = resource_groups + self.blueprint_name = blueprint_name + self.change_notes = change_notes + + +class ResourceGroupDefinition(Model): + """Represents an Azure resource group in a blueprint definition. + + :param name: Name of this resourceGroup. Leave empty if the resource group + name will be specified during the blueprint assignment. + :type name: str + :param location: Location of this resourceGroup. Leave empty if the + resource group location will be specified during the blueprint assignment. + :type location: str + :param display_name: DisplayName of this parameter/resourceGroup. + :type display_name: str + :param description: Description of this parameter/resourceGroup. + :type description: str + :param strong_type: StrongType for UI to render rich experience during + blueprint assignment. Supported strong types are resourceType, principalId + and location. + :type strong_type: str + :param depends_on: Artifacts which need to be deployed before this + resource group. + :type depends_on: list[str] + :param tags: Tags to be assigned to this resource group. + :type tags: dict[str, str] + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'strong_type': {'max_length': 64}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'display_name': {'key': 'metadata.displayName', 'type': 'str'}, + 'description': {'key': 'metadata.description', 'type': 'str'}, + 'strong_type': {'key': 'metadata.strongType', 'type': 'str'}, + 'depends_on': {'key': 'dependsOn', 'type': '[str]'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, name: str=None, location: str=None, display_name: str=None, description: str=None, strong_type: str=None, depends_on=None, tags=None, **kwargs) -> None: + super(ResourceGroupDefinition, self).__init__(**kwargs) + self.name = name + self.location = location + self.display_name = display_name + self.description = description + self.strong_type = strong_type + self.depends_on = depends_on + self.tags = tags + + +class ResourceGroupValue(Model): + """Represents an Azure resource group. + + :param name: Name of the resource group. + :type name: str + :param location: Location of the resource group. + :type location: str + """ + + _validation = { + 'name': {'max_length': 90, 'min_length': 1}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, location: str=None, **kwargs) -> None: + super(ResourceGroupValue, self).__init__(**kwargs) + self.name = name + self.location = location + + +class ResourceProviderOperation(Model): + """Supported operations of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.blueprint.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Blueprint. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ResourceProviderOperationList(Model): + """Results of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: list[~azure.mgmt.blueprint.models.ResourceProviderOperation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + + +class RoleAssignmentArtifact(Artifact): + """Blueprint artifact that applies a Role assignment. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param role_definition_id: Required. Azure resource ID of the + RoleDefinition. + :type role_definition_id: str + :param principal_ids: Required. Array of user or group identities in Azure + Active Directory. The roleDefinition will apply to each identity. + :type principal_ids: object + :param resource_group: RoleAssignment will be scope to this resourceGroup. + If empty, it scopes to the subscription. + :type resource_group: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'role_definition_id': {'required': True}, + 'principal_ids': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, + 'principal_ids': {'key': 'properties.principalIds', 'type': 'object'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + } + + def __init__(self, *, role_definition_id: str, principal_ids, display_name: str=None, description: str=None, depends_on=None, resource_group: str=None, **kwargs) -> None: + super(RoleAssignmentArtifact, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.depends_on = depends_on + self.role_definition_id = role_definition_id + self.principal_ids = principal_ids + self.resource_group = resource_group + self.kind = 'roleAssignment' + + +class SecretValueReference(Model): + """Reference to a Key Vault secret. + + All required parameters must be populated in order to send to Azure. + + :param key_vault: Required. Specifies the reference to a given Azure Key + Vault. + :type key_vault: ~azure.mgmt.blueprint.models.KeyVaultReference + :param secret_name: Required. Name of the secret. + :type secret_name: str + :param secret_version: The version of the secret to use. If left blank, + the latest version of the secret is used. + :type secret_version: str + """ + + _validation = { + 'key_vault': {'required': True}, + 'secret_name': {'required': True}, + } + + _attribute_map = { + 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultReference'}, + 'secret_name': {'key': 'secretName', 'type': 'str'}, + 'secret_version': {'key': 'secretVersion', 'type': 'str'}, + } + + def __init__(self, *, key_vault, secret_name: str, secret_version: str=None, **kwargs) -> None: + super(SecretValueReference, self).__init__(**kwargs) + self.key_vault = key_vault + self.secret_name = secret_name + self.secret_version = secret_version + + +class SharedBlueprintProperties(BlueprintResourcePropertiesBase): + """Shared Schema for both blueprintProperties and + publishedBlueprintProperties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :ivar status: Status of the blueprint. This field is readonly. + :vartype status: ~azure.mgmt.blueprint.models.BlueprintStatus + :param target_scope: The scope where this blueprint definition can be + assigned. Possible values include: 'subscription', 'managementGroup' + :type target_scope: str or + ~azure.mgmt.blueprint.models.BlueprintTargetScope + :param parameters: Parameters required by this blueprint definition. + :type parameters: dict[str, + ~azure.mgmt.blueprint.models.ParameterDefinition] + :param resource_groups: Resource group placeholders defined by this + blueprint definition. + :type resource_groups: dict[str, + ~azure.mgmt.blueprint.models.ResourceGroupDefinition] + """ + + _validation = { + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'BlueprintStatus'}, + 'target_scope': {'key': 'targetScope', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '{ParameterDefinition}'}, + 'resource_groups': {'key': 'resourceGroups', 'type': '{ResourceGroupDefinition}'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, target_scope=None, parameters=None, resource_groups=None, **kwargs) -> None: + super(SharedBlueprintProperties, self).__init__(display_name=display_name, description=description, **kwargs) + self.status = None + self.target_scope = target_scope + self.parameters = parameters + self.resource_groups = resource_groups + + +class TemplateArtifact(Artifact): + """Blueprint artifact that deploys a Resource Manager template. + + 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: String Id used to locate any resource on Azure. + :vartype id: str + :ivar type: Type of this resource. + :vartype type: str + :ivar name: Name of this resource. + :vartype name: str + :param kind: Required. Constant filled by server. + :type kind: str + :param display_name: One-liner string explain this resource. + :type display_name: str + :param description: Multi-line explain this resource. + :type description: str + :param depends_on: Artifacts which need to be deployed before the + specified artifact. + :type depends_on: list[str] + :param template: Required. The Resource Manager template blueprint + artifact body. + :type template: object + :param resource_group: If applicable, the name of the resource group + placeholder to which the Resource Manager template blueprint artifact will + be deployed. + :type resource_group: str + :param parameters: Required. Resource Manager template blueprint artifact + parameter values. + :type parameters: dict[str, ~azure.mgmt.blueprint.models.ParameterValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'required': True}, + 'display_name': {'max_length': 256}, + 'description': {'max_length': 500}, + 'template': {'required': True}, + 'parameters': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'depends_on': {'key': 'properties.dependsOn', 'type': '[str]'}, + 'template': {'key': 'properties.template', 'type': 'object'}, + 'resource_group': {'key': 'properties.resourceGroup', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '{ParameterValue}'}, + } + + def __init__(self, *, template, parameters, display_name: str=None, description: str=None, depends_on=None, resource_group: str=None, **kwargs) -> None: + super(TemplateArtifact, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.depends_on = depends_on + self.template = template + self.resource_group = resource_group + self.parameters = parameters + self.kind = 'template' + + +class UserAssignedIdentity(Model): + """User-assigned managed identity. + + :param principal_id: Azure Active Directory principal ID associated with + this Identity. + :type principal_id: str + :param client_id: Client App Id associated with this identity. + :type client_id: str + """ + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str=None, client_id: str=None, **kwargs) -> None: + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = principal_id + self.client_id = client_id + + +class WhoIsBlueprintContract(Model): + """Response schema for querying the Azure Blueprints service principal in the + tenant. + + :param object_id: AAD object Id of the Azure Blueprints service principal + in the tenant. + :type object_id: str + """ + + _attribute_map = { + 'object_id': {'key': 'objectId', 'type': 'str'}, + } + + def __init__(self, *, object_id: str=None, **kwargs) -> None: + super(WhoIsBlueprintContract, self).__init__(**kwargs) + self.object_id = object_id diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_paged_models.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_paged_models.py new file mode 100644 index 000000000000..06ffdc6d7b24 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/models/_paged_models.py @@ -0,0 +1,79 @@ +# 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.paging import Paged + + +class BlueprintPaged(Paged): + """ + A paging container for iterating over a list of :class:`Blueprint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Blueprint]'} + } + + def __init__(self, *args, **kwargs): + + super(BlueprintPaged, self).__init__(*args, **kwargs) +class ArtifactPaged(Paged): + """ + A paging container for iterating over a list of :class:`Artifact ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Artifact]'} + } + + def __init__(self, *args, **kwargs): + + super(ArtifactPaged, self).__init__(*args, **kwargs) +class PublishedBlueprintPaged(Paged): + """ + A paging container for iterating over a list of :class:`PublishedBlueprint ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PublishedBlueprint]'} + } + + def __init__(self, *args, **kwargs): + + super(PublishedBlueprintPaged, self).__init__(*args, **kwargs) +class AssignmentPaged(Paged): + """ + A paging container for iterating over a list of :class:`Assignment ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Assignment]'} + } + + def __init__(self, *args, **kwargs): + + super(AssignmentPaged, self).__init__(*args, **kwargs) +class AssignmentOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`AssignmentOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AssignmentOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(AssignmentOperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py new file mode 100644 index 000000000000..d610f4eba1dd --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 ._blueprints_operations import BlueprintsOperations +from ._artifacts_operations import ArtifactsOperations +from ._published_blueprints_operations import PublishedBlueprintsOperations +from ._published_artifacts_operations import PublishedArtifactsOperations +from ._assignments_operations import AssignmentsOperations +from ._assignment_operations import AssignmentOperations + +__all__ = [ + 'BlueprintsOperations', + 'ArtifactsOperations', + 'PublishedBlueprintsOperations', + 'PublishedArtifactsOperations', + 'AssignmentsOperations', + 'AssignmentOperations', +] diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_artifacts_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_artifacts_operations.py new file mode 100644 index 000000000000..5ef2c826c722 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_artifacts_operations.py @@ -0,0 +1,318 @@ +# 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 .. import models + + +class ArtifactsOperations(object): + """ArtifactsOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def create_or_update( + self, resource_scope, blueprint_name, artifact_name, artifact, custom_headers=None, raw=False, **operation_config): + """Create or update blueprint artifact. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param artifact_name: Name of the blueprint artifact. + :type artifact_name: str + :param artifact: Blueprint artifact to create or update. + :type artifact: ~azure.mgmt.blueprint.models.Artifact + :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: Artifact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Artifact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'artifactName': self._serialize.url("artifact_name", artifact_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(artifact, 'Artifact') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('Artifact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'} + + def get( + self, resource_scope, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config): + """Get a blueprint artifact. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param artifact_name: Name of the blueprint artifact. + :type artifact_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: Artifact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Artifact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'artifactName': self._serialize.url("artifact_name", artifact_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('Artifact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'} + + def delete( + self, resource_scope, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config): + """Delete a blueprint artifact. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param artifact_name: Name of the blueprint artifact. + :type artifact_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: Artifact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Artifact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'artifactName': self._serialize.url("artifact_name", artifact_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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + 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('Artifact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'} + + def list( + self, resource_scope, blueprint_name, custom_headers=None, raw=False, **operation_config): + """List artifacts for a given blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_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 Artifact + :rtype: + ~azure.mgmt.blueprint.models.ArtifactPaged[~azure.mgmt.blueprint.models.Artifact] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_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.ArtifactPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignment_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignment_operations.py new file mode 100644 index 000000000000..3c6cc29c9063 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignment_operations.py @@ -0,0 +1,182 @@ +# 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 .. import models + + +class AssignmentOperations(object): + """AssignmentOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def list( + self, resource_scope, assignment_name, custom_headers=None, raw=False, **operation_config): + """List operations for given blueprint assignment within a subscription or + a management group. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_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 AssignmentOperation + :rtype: + ~azure.mgmt.blueprint.models.AssignmentOperationPaged[~azure.mgmt.blueprint.models.AssignmentOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_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.AssignmentOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/assignmentOperations'} + + def get( + self, resource_scope, assignment_name, assignment_operation_name, custom_headers=None, raw=False, **operation_config): + """Get a blueprint assignment operation. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_name: str + :param assignment_operation_name: Name of the blueprint assignment + operation. + :type assignment_operation_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: AssignmentOperation or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.AssignmentOperation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_name, 'str'), + 'assignmentOperationName': self._serialize.url("assignment_operation_name", assignment_operation_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('AssignmentOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/assignmentOperations/{assignmentOperationName}'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignments_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignments_operations.py new file mode 100644 index 000000000000..8c8489c7da43 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_assignments_operations.py @@ -0,0 +1,376 @@ +# 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 .. import models + + +class AssignmentsOperations(object): + """AssignmentsOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def create_or_update( + self, resource_scope, assignment_name, assignment, custom_headers=None, raw=False, **operation_config): + """Create or update a blueprint assignment. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_name: str + :param assignment: Blueprint assignment object to save. + :type assignment: ~azure.mgmt.blueprint.models.Assignment + :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: Assignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Assignment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_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(assignment, 'Assignment') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('Assignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + + def get( + self, resource_scope, assignment_name, custom_headers=None, raw=False, **operation_config): + """Get a blueprint assignment. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_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: Assignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Assignment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_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('Assignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + + def delete( + self, resource_scope, assignment_name, delete_behavior=None, custom_headers=None, raw=False, **operation_config): + """Delete a blueprint assignment. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_name: str + :param delete_behavior: When deleteBehavior=all, the resources that + were created by the blueprint assignment will be deleted. Possible + values include: 'none', 'all' + :type delete_behavior: str or + ~azure.mgmt.blueprint.models.AssignmentDeleteBehavior + :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: Assignment or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Assignment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_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') + if delete_behavior is not None: + query_parameters['deleteBehavior'] = self._serialize.query("delete_behavior", delete_behavior, '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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 202: + deserialized = self._deserialize('Assignment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + + def who_is_blueprint( + self, resource_scope, assignment_name, custom_headers=None, raw=False, **operation_config): + """Get Blueprints service SPN objectId. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param assignment_name: Name of the blueprint assignment. + :type assignment_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: WhoIsBlueprintContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.WhoIsBlueprintContract or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.who_is_blueprint.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'assignmentName': self._serialize.url("assignment_name", assignment_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.post(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('WhoIsBlueprintContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + who_is_blueprint.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}/whoIsBlueprint'} + + def list( + self, resource_scope, custom_headers=None, raw=False, **operation_config): + """List blueprint assignments within a subscription or a management group. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: 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 Assignment + :rtype: + ~azure.mgmt.blueprint.models.AssignmentPaged[~azure.mgmt.blueprint.models.Assignment] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True) + } + 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.AssignmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprintAssignments'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_blueprints_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_blueprints_operations.py new file mode 100644 index 000000000000..7be28f33fae3 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_blueprints_operations.py @@ -0,0 +1,306 @@ +# 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 .. import models + + +class BlueprintsOperations(object): + """BlueprintsOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def create_or_update( + self, resource_scope, blueprint_name, blueprint, custom_headers=None, raw=False, **operation_config): + """Create or update a blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param blueprint: Blueprint definition. + :type blueprint: ~azure.mgmt.blueprint.models.Blueprint + :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: Blueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Blueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_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(blueprint, 'Blueprint') + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('Blueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} + + def get( + self, resource_scope, blueprint_name, custom_headers=None, raw=False, **operation_config): + """Get a blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_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: Blueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Blueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_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('Blueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} + + def delete( + self, resource_scope, blueprint_name, custom_headers=None, raw=False, **operation_config): + """Delete a blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_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: Blueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Blueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + 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('Blueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} + + def list( + self, resource_scope, custom_headers=None, raw=False, **operation_config): + """List blueprint definitions. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: 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 Blueprint + :rtype: + ~azure.mgmt.blueprint.models.BlueprintPaged[~azure.mgmt.blueprint.models.Blueprint] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True) + } + 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.BlueprintPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_artifacts_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_artifacts_operations.py new file mode 100644 index 000000000000..d5f4abf38a87 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_artifacts_operations.py @@ -0,0 +1,186 @@ +# 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 .. import models + + +class PublishedArtifactsOperations(object): + """PublishedArtifactsOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def get( + self, resource_scope, blueprint_name, version_id, artifact_name, custom_headers=None, raw=False, **operation_config): + """Get an artifact for a published blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param version_id: Version of the published blueprint definition. + :type version_id: str + :param artifact_name: Name of the blueprint artifact. + :type artifact_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: Artifact or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.Artifact or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, 'str'), + 'artifactName': self._serialize.url("artifact_name", artifact_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('Artifact', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts/{artifactName}'} + + def list( + self, resource_scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + """List artifacts for a version of a published blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param version_id: Version of the published blueprint definition. + :type version_id: 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 Artifact + :rtype: + ~azure.mgmt.blueprint.models.ArtifactPaged[~azure.mgmt.blueprint.models.Artifact] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, '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.ArtifactPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_blueprints_operations.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_blueprints_operations.py new file mode 100644 index 000000000000..d79398992db4 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/_published_blueprints_operations.py @@ -0,0 +1,323 @@ +# 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 .. import models + + +class PublishedBlueprintsOperations(object): + """PublishedBlueprintsOperations 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: "2018-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-11-01-preview" + + self.config = config + + def create( + self, resource_scope, blueprint_name, version_id, published_blueprint=None, custom_headers=None, raw=False, **operation_config): + """Publish a new version of the blueprint definition with the latest + artifacts. Published blueprint definitions are immutable. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param version_id: Version of the published blueprint definition. + :type version_id: str + :param published_blueprint: Published Blueprint to create or update. + :type published_blueprint: + ~azure.mgmt.blueprint.models.PublishedBlueprint + :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: PublishedBlueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.PublishedBlueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, '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 + if published_blueprint is not None: + body_content = self._serialize.body(published_blueprint, 'PublishedBlueprint') + else: + body_content = None + + # 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 [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 201: + deserialized = self._deserialize('PublishedBlueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + + def get( + self, resource_scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + """Get a published version of a blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param version_id: Version of the published blueprint definition. + :type version_id: 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: PublishedBlueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.PublishedBlueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, '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('PublishedBlueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + + def delete( + self, resource_scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + """Delete a published version of a blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_name: str + :param version_id: Version of the published blueprint definition. + :type version_id: 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: PublishedBlueprint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.blueprint.models.PublishedBlueprint or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'), + 'versionId': self._serialize.url("version_id", version_id, '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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + 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('PublishedBlueprint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + + def list( + self, resource_scope, blueprint_name, custom_headers=None, raw=False, **operation_config): + """List published versions of given blueprint definition. + + :param resource_scope: The scope of the resource. Valid scopes are: + management group (format: + '/providers/Microsoft.Management/managementGroups/{managementGroup}'), + subscription (format: '/subscriptions/{subscriptionId}'). + :type resource_scope: str + :param blueprint_name: Name of the blueprint definition. + :type blueprint_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 PublishedBlueprint + :rtype: + ~azure.mgmt.blueprint.models.PublishedBlueprintPaged[~azure.mgmt.blueprint.models.PublishedBlueprint] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceScope': self._serialize.url("resource_scope", resource_scope, 'str', skip_quote=True), + 'blueprintName': self._serialize.url("blueprint_name", blueprint_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.PublishedBlueprintPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/{resourceScope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions'} diff --git a/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py new file mode 100644 index 000000000000..97fb20f656a5 --- /dev/null +++ b/sdk/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2018-11-01-preview" +