diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/blueprint_management_client.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/blueprint_management_client.py index 3bbbbdaa58c5..91dc12c8d61c 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/blueprint_management_client.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/blueprint_management_client.py @@ -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 @@ -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 @@ -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) @@ -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( diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py index 1c32bcaad7ec..02ec4859f679 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/__init__.py @@ -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 @@ -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 @@ -105,6 +107,7 @@ 'ResourceGroupValue', 'AzureResourceBase', 'BlueprintResourceStatusBase', + 'UserAssignedIdentity', 'ManagedServiceIdentity', 'AssignmentStatus', 'AssignmentLockSettings', diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity.py index c802ecf3316e..a8903c3b73ce 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity.py @@ -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 = { @@ -35,6 +39,7 @@ 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): @@ -42,3 +47,4 @@ def __init__(self, **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) diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity_py3.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity_py3.py index 190f320880c8..258e2f57ecab 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity_py3.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/managed_service_identity_py3.py @@ -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 = { @@ -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 diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity.py new file mode 100644 index 000000000000..d37e8c347f05 --- /dev/null +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity.py @@ -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) diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity_py3.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity_py3.py new file mode 100644 index 000000000000..0ff238f39ecf --- /dev/null +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/models/user_assigned_identity_py3.py @@ -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 diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py index dd925cac4148..3b0d83da962b 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/__init__.py @@ -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 @@ -22,7 +21,6 @@ 'ArtifactsOperations', 'PublishedBlueprintsOperations', 'PublishedArtifactsOperations', - 'Operations', 'AssignmentsOperations', 'AssignmentOperations', ] diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/artifacts_operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/artifacts_operations.py index 6d6524ac9ddf..6ecd35ea7b51 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/artifacts_operations.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/artifacts_operations.py @@ -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 @@ -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. @@ -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') } @@ -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. @@ -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') } @@ -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. @@ -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') } @@ -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 @@ -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) @@ -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'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/assignments_operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/assignments_operations.py index bd5c72f1e8a9..44984b002703 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/assignments_operations.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/assignments_operations.py @@ -23,7 +23,7 @@ class AssignmentsOperations(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 @@ -33,17 +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, subscription_id, assignment_name, assignment, custom_headers=None, raw=False, **operation_config): + self, scope, assignment_name, assignment, custom_headers=None, raw=False, **operation_config): """Create or update a Blueprint assignment. - :param subscription_id: azure subscriptionId, which we assign the - blueprint to. - :type subscription_id: 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 assignment_name: name of the assignment. :type assignment_name: str :param assignment: assignment object to save. @@ -61,7 +63,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'assignmentName': self._serialize.url("assignment_name", assignment_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -103,15 +105,17 @@ def create_or_update( return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} def get( - self, subscription_id, assignment_name, custom_headers=None, raw=False, **operation_config): + self, scope, assignment_name, custom_headers=None, raw=False, **operation_config): """Get a Blueprint assignment. - :param subscription_id: azure subscriptionId, which we assign the - blueprint to. - :type subscription_id: 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 assignment_name: name of the assignment. :type assignment_name: str :param dict custom_headers: headers that will be added to the request @@ -127,7 +131,7 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'assignmentName': self._serialize.url("assignment_name", assignment_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -165,15 +169,17 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} def delete( - self, subscription_id, assignment_name, custom_headers=None, raw=False, **operation_config): + self, scope, assignment_name, custom_headers=None, raw=False, **operation_config): """Delete a Blueprint assignment. - :param subscription_id: azure subscriptionId, which we assign the - blueprint to. - :type subscription_id: 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 assignment_name: name of the assignment. :type assignment_name: str :param dict custom_headers: headers that will be added to the request @@ -189,7 +195,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str'), + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), 'assignmentName': self._serialize.url("assignment_name", assignment_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -227,15 +233,17 @@ def delete( return client_raw_response return deserialized - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} + delete.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprintAssignments/{assignmentName}'} def list( - self, subscription_id, custom_headers=None, raw=False, **operation_config): + self, scope, custom_headers=None, raw=False, **operation_config): """List Blueprint assignments within a subscription. - :param subscription_id: azure subscriptionId, which we assign the - blueprint to. - :type subscription_id: 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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -252,7 +260,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str') + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) @@ -294,4 +302,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Blueprint/blueprintAssignments'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprintAssignments'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/blueprints_operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/blueprints_operations.py index 88812bbf7ffd..545a2cbc7831 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/blueprints_operations.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/blueprints_operations.py @@ -23,7 +23,7 @@ class BlueprintsOperations(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 @@ -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, blueprint, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, blueprint, custom_headers=None, raw=False, **operation_config): """Create or update Blueprint definition. - :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 blueprint: Blueprint definition. @@ -60,7 +63,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') } url = self._client.format_url(url, **path_format_arguments) @@ -102,14 +105,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}'} + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} def get( - self, management_group_name, blueprint_name, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, custom_headers=None, raw=False, **operation_config): """Get a blueprint definition. - :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 @@ -125,7 +131,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') } url = self._client.format_url(url, **path_format_arguments) @@ -163,14 +169,17 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} def delete( - self, management_group_name, blueprint_name, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, custom_headers=None, raw=False, **operation_config): """Delete a blueprint definition. - :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 @@ -186,7 +195,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') } url = self._client.format_url(url, **path_format_arguments) @@ -224,14 +233,17 @@ def delete( return client_raw_response return deserialized - delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} + delete.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}'} def list( - self, management_group_name, custom_headers=None, raw=False, **operation_config): - """List Blueprint definitions within a Management Group. - - :param management_group_name: ManagementGroup where blueprint stores. - :type management_group_name: str + self, scope, custom_headers=None, raw=False, **operation_config): + """Create or update blueprint definition. + + :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -248,7 +260,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) } url = self._client.format_url(url, **path_format_arguments) @@ -290,4 +302,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'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/operations.py deleted file mode 100644 index 459550383605..000000000000 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/operations.py +++ /dev/null @@ -1,92 +0,0 @@ -# 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 Operations(object): - """Operations operations. - - :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: "2017-11-11-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-11-11-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """List all of the available operations the Blueprint resource provider - supports. - - :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: ResourceProviderOperationList or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.blueprint.models.ResourceProviderOperationList or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.list.metadata['url'] - - # 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('ResourceProviderOperationList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/providers/Microsoft.Blueprint/operations'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_artifacts_operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_artifacts_operations.py index 314e488ee312..1cb2a88b7460 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_artifacts_operations.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_artifacts_operations.py @@ -23,7 +23,7 @@ class PublishedArtifactsOperations(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 @@ -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 get( - self, management_group_name, blueprint_name, version_id, artifact_name, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, version_id, artifact_name, custom_headers=None, raw=False, **operation_config): """Get an artifact for a published 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 version_id: version of the published blueprint. @@ -62,7 +65,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'), 'versionId': self._serialize.url("version_id", version_id, 'str'), 'artifactName': self._serialize.url("artifact_name", artifact_name, 'str') @@ -102,14 +105,17 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts/{artifactName}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts/{artifactName}'} def list( - self, management_group_name, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): """List artifacts for a published 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 version_id: version of the published blueprint. @@ -130,7 +136,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'), 'versionId': self._serialize.url("version_id", version_id, 'str') } @@ -174,4 +180,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}/versions/{versionId}/artifacts'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}/artifacts'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_blueprints_operations.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_blueprints_operations.py index 1c3c19918e9c..e9b014067762 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_blueprints_operations.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/operations/published_blueprints_operations.py @@ -23,7 +23,7 @@ class PublishedBlueprintsOperations(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 @@ -33,17 +33,20 @@ 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( - self, management_group_name, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): """Publish a new version of the Blueprint with the latest artifacts. Published Blueprints are immutable. - :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 version_id: version of the published blueprint. @@ -61,7 +64,7 @@ def create( # Construct URL url = self.create.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'), 'versionId': self._serialize.url("version_id", version_id, 'str') } @@ -100,14 +103,17 @@ def create( return client_raw_response return deserialized - create.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + create.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} def get( - self, management_group_name, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): """Get a published 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 version_id: version of the published blueprint. @@ -125,7 +131,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'), 'versionId': self._serialize.url("version_id", version_id, 'str') } @@ -164,14 +170,17 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + get.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} def delete( - self, management_group_name, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): + self, scope, blueprint_name, version_id, custom_headers=None, raw=False, **operation_config): """Delete a published 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 version_id: version of the published blueprint. @@ -189,7 +198,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'), 'versionId': self._serialize.url("version_id", version_id, 'str') } @@ -228,14 +237,17 @@ def delete( return client_raw_response return deserialized - delete.metadata = {'url': '/providers/Microsoft.Management/managementGroups/{managementGroupName}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} + delete.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions/{versionId}'} 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 published versions of 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 @@ -254,7 +266,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) @@ -297,4 +309,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}/versions'} + list.metadata = {'url': '/{scope}/providers/Microsoft.Blueprint/blueprints/{blueprintName}/versions'} diff --git a/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py b/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py index 53a203f32aaf..97fb20f656a5 100644 --- a/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py +++ b/azure-mgmt-blueprint/azure/mgmt/blueprint/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "" +VERSION = "2018-11-01-preview"