Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from .operations.artifacts_operations import ArtifactsOperations
from .operations.published_blueprints_operations import PublishedBlueprintsOperations
from .operations.published_artifacts_operations import PublishedArtifactsOperations
from .operations.operations import Operations
from .operations.assignments_operations import AssignmentsOperations
from .operations.assignment_operations import AssignmentOperations
from . import models
Expand Down Expand Up @@ -64,8 +63,6 @@ class BlueprintManagementClient(SDKClient):
:vartype published_blueprints: azure.mgmt.blueprint.operations.PublishedBlueprintsOperations
:ivar published_artifacts: PublishedArtifacts operations
:vartype published_artifacts: azure.mgmt.blueprint.operations.PublishedArtifactsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.blueprint.operations.Operations
:ivar assignments: Assignments operations
:vartype assignments: azure.mgmt.blueprint.operations.AssignmentsOperations
:ivar assignment_operations: AssignmentOperations operations
Expand All @@ -84,6 +81,7 @@ def __init__(
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)

Expand All @@ -95,8 +93,6 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.published_artifacts = PublishedArtifactsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.assignments = AssignmentsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.assignment_operations = AssignmentOperations(
Expand Down
3 changes: 3 additions & 0 deletions azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from .resource_group_value_py3 import ResourceGroupValue
from .azure_resource_base_py3 import AzureResourceBase
from .blueprint_resource_status_base_py3 import BlueprintResourceStatusBase
from .user_assigned_identity_py3 import UserAssignedIdentity
from .managed_service_identity_py3 import ManagedServiceIdentity
from .assignment_status_py3 import AssignmentStatus
from .assignment_lock_settings_py3 import AssignmentLockSettings
Expand Down Expand Up @@ -61,6 +62,7 @@
from .resource_group_value import ResourceGroupValue
from .azure_resource_base import AzureResourceBase
from .blueprint_resource_status_base import BlueprintResourceStatusBase
from .user_assigned_identity import UserAssignedIdentity
from .managed_service_identity import ManagedServiceIdentity
from .assignment_status import AssignmentStatus
from .assignment_lock_settings import AssignmentLockSettings
Expand Down Expand Up @@ -105,6 +107,7 @@
'ResourceGroupValue',
'AzureResourceBase',
'BlueprintResourceStatusBase',
'UserAssignedIdentity',
'ManagedServiceIdentity',
'AssignmentStatus',
'AssignmentLockSettings',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class ManagedServiceIdentity(Model):
: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 identities associated
with the resource, key will be Azure resource Id of the ManagedIdentity.
:type user_assigned_identities: dict[str,
~azure.mgmt.blueprint.models.UserAssignedIdentity]
"""

_validation = {
Expand All @@ -35,10 +39,12 @@ class ManagedServiceIdentity(Model):
'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)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class ManagedServiceIdentity(Model):
: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 identities associated
with the resource, key will be Azure resource Id of the ManagedIdentity.
:type user_assigned_identities: dict[str,
~azure.mgmt.blueprint.models.UserAssignedIdentity]
"""

_validation = {
Expand All @@ -35,10 +39,12 @@ class ManagedServiceIdentity(Model):
'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, **kwargs) -> None:
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class UserAssignedIdentity(Model):
"""User assigned 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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class UserAssignedIdentity(Model):
"""User assigned 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from .artifacts_operations import ArtifactsOperations
from .published_blueprints_operations import PublishedBlueprintsOperations
from .published_artifacts_operations import PublishedArtifactsOperations
from .operations import Operations
from .assignments_operations import AssignmentsOperations
from .assignment_operations import AssignmentOperations

Expand All @@ -22,7 +21,6 @@
'ArtifactsOperations',
'PublishedBlueprintsOperations',
'PublishedArtifactsOperations',
'Operations',
'AssignmentsOperations',
'AssignmentOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ArtifactsOperations(object):
: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: "2017-11-11-preview".
:ivar api_version: Client Api Version. Constant value: "2018-11-01-preview".
"""

models = models
Expand All @@ -33,16 +33,19 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2017-11-11-preview"
self.api_version = "2018-11-01-preview"

self.config = config

def create_or_update(
self, management_group_name, blueprint_name, artifact_name, artifact, custom_headers=None, raw=False, **operation_config):
self, scope, blueprint_name, artifact_name, artifact, custom_headers=None, raw=False, **operation_config):
"""Create or update Blueprint artifact.

:param management_group_name: ManagementGroup where blueprint stores.
:type management_group_name: str
:param scope: The scope of the resource. Valid scopes are: management
group (format:
'/providers/Microsoft.Management/managementGroups/{managementGroup}'),
subscription (format: '/subscriptions/{subscriptionId}').
:type scope: str
:param blueprint_name: name of the blueprint.
:type blueprint_name: str
:param artifact_name: name of the artifact.
Expand All @@ -62,7 +65,7 @@ def create_or_update(
# Construct URL
url = self.create_or_update.metadata['url']
path_format_arguments = {
'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str'),
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'),
'artifactName': self._serialize.url("artifact_name", artifact_name, 'str')
}
Expand Down Expand Up @@ -105,14 +108,17 @@ def create_or_update(
return client_raw_response

return deserialized
create_or_update.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}
create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}

def get(
self, management_group_name, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config):
self, scope, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config):
"""Get a Blueprint artifact.

:param management_group_name: ManagementGroup where blueprint stores.
:type management_group_name: str
:param scope: The scope of the resource. Valid scopes are: management
group (format:
'/providers/Microsoft.Management/managementGroups/{managementGroup}'),
subscription (format: '/subscriptions/{subscriptionId}').
:type scope: str
:param blueprint_name: name of the blueprint.
:type blueprint_name: str
:param artifact_name: name of the artifact.
Expand All @@ -130,7 +136,7 @@ def get(
# Construct URL
url = self.get.metadata['url']
path_format_arguments = {
'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str'),
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'),
'artifactName': self._serialize.url("artifact_name", artifact_name, 'str')
}
Expand Down Expand Up @@ -169,14 +175,17 @@ def get(
return client_raw_response

return deserialized
get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}
get.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}

def delete(
self, management_group_name, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config):
self, scope, blueprint_name, artifact_name, custom_headers=None, raw=False, **operation_config):
"""Delete a Blueprint artifact.

:param management_group_name: ManagementGroup where blueprint stores.
:type management_group_name: str
:param scope: The scope of the resource. Valid scopes are: management
group (format:
'/providers/Microsoft.Management/managementGroups/{managementGroup}'),
subscription (format: '/subscriptions/{subscriptionId}').
:type scope: str
:param blueprint_name: name of the blueprint.
:type blueprint_name: str
:param artifact_name: name of the artifact.
Expand All @@ -194,7 +203,7 @@ def delete(
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str'),
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str'),
'artifactName': self._serialize.url("artifact_name", artifact_name, 'str')
}
Expand Down Expand Up @@ -233,14 +242,17 @@ def delete(
return client_raw_response

return deserialized
delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}
delete.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts/{artifactName}'}

def list(
self, management_group_name, blueprint_name, custom_headers=None, raw=False, **operation_config):
self, scope, blueprint_name, custom_headers=None, raw=False, **operation_config):
"""List artifacts for a given Blueprint.

:param management_group_name: ManagementGroup where blueprint stores.
:type management_group_name: str
:param scope: The scope of the resource. Valid scopes are: management
group (format:
'/providers/Microsoft.Management/managementGroups/{managementGroup}'),
subscription (format: '/subscriptions/{subscriptionId}').
:type scope: str
:param blueprint_name: name of the blueprint.
:type blueprint_name: str
:param dict custom_headers: headers that will be added to the request
Expand All @@ -259,7 +271,7 @@ def internal_paging(next_link=None, raw=False):
# Construct URL
url = self.list.metadata['url']
path_format_arguments = {
'managementGroupName': self._serialize.url("management_group_name", management_group_name, 'str'),
'scope': self._serialize.url("scope", scope, 'str', skip_quote=True),
'blueprintName': self._serialize.url("blueprint_name", blueprint_name, 'str')
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -302,4 +314,4 @@ def internal_paging(next_link=None, raw=False):
return client_raw_response

return deserialized
list.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts'}
list.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/artifacts'}
Loading