From 8124af5ff7119b78be5f5650cf6ecfa285261305 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 4 Mar 2019 08:10:41 -0800 Subject: [PATCH] Generated from c2d7ae74564edf027d2baa5d39864ba26a4f593a (#4448) Update UserAssignedIdentities spec in Web Microsoft.Web recently added support for UserAssigned managed service identities (in preview), but the swagger spec is incorrect for the identity payload as it follows the old construct of sending an array of identityIds as opposed to the updated spec which instead sends a dictionary object called userAssignedIdentities. Spec + history outlined here: http://sharepoint/sites/AzureUX/Sparta/_layouts/15/WopiFrame2.aspx?sourcedoc=%7b633632B4-02E4-4DE2-92A9-EDCAF9BE73D4%7d&file=ARM%2BMSI.docx&action=default Our swagger contains identityids[] because of previous work to future support UserAssigned identities, but never released the feature in that state, rather we opted to wait for the new spec to be supported and then integrated with that on our end. Our MSI implementation reflects Microsoft.Compute's spec for user assigned. https://github.com/Azure/azure-rest-api-specs/blob/78e1feab142c605839aa3cec23442ca26b8ef04d/specification/compute/resource-manager/Microsoft.Compute/stable/2018-06-01/compute.json --- .../azure/mgmt/web/models/__init__.py | 3 ++ .../web/models/managed_service_identity.py | 12 ++++-- .../models/managed_service_identity_py3.py | 14 ++++--- ...identity_user_assigned_identities_value.py | 40 +++++++++++++++++++ ...tity_user_assigned_identities_value_py3.py | 40 +++++++++++++++++++ 5 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value.py create mode 100644 azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value_py3.py diff --git a/azure-mgmt-web/azure/mgmt/web/models/__init__.py b/azure-mgmt-web/azure/mgmt/web/models/__init__.py index 45200dfe9a17..1e710fc83529 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/__init__.py +++ b/azure-mgmt-web/azure/mgmt/web/models/__init__.py @@ -35,6 +35,7 @@ from .hybrid_connection_py3 import HybridConnection from .deleted_site_py3 import DeletedSite from .proxy_only_resource_py3 import ProxyOnlyResource + from .managed_service_identity_user_assigned_identities_value_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue from .managed_service_identity_py3 import ManagedServiceIdentity from .geo_distribution_py3 import GeoDistribution from .slot_swap_status_py3 import SlotSwapStatus @@ -259,6 +260,7 @@ from .hybrid_connection import HybridConnection from .deleted_site import DeletedSite from .proxy_only_resource import ProxyOnlyResource + from .managed_service_identity_user_assigned_identities_value import ManagedServiceIdentityUserAssignedIdentitiesValue from .managed_service_identity import ManagedServiceIdentity from .geo_distribution import GeoDistribution from .slot_swap_status import SlotSwapStatus @@ -603,6 +605,7 @@ 'HybridConnection', 'DeletedSite', 'ProxyOnlyResource', + 'ManagedServiceIdentityUserAssignedIdentitiesValue', 'ManagedServiceIdentity', 'GeoDistribution', 'SlotSwapStatus', diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py index d9f06eedc9e5..0118c423b258 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py @@ -25,8 +25,12 @@ class ManagedServiceIdentity(Model): :vartype tenant_id: str :ivar principal_id: Principal Id of managed service identity. :vartype principal_id: str - :param identity_ids: Array of UserAssigned managed service identities. - :type identity_ids: list[str] + :param user_assigned_identities: The list of user assigned identities + associated with the resource. The user identity dictionary key references + will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -38,7 +42,7 @@ class ManagedServiceIdentity(Model): 'type': {'key': 'type', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, } def __init__(self, **kwargs): @@ -46,4 +50,4 @@ def __init__(self, **kwargs): self.type = kwargs.get('type', None) self.tenant_id = None self.principal_id = None - self.identity_ids = kwargs.get('identity_ids', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py index ae59c0b21029..5d2da67ae7d1 100644 --- a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_py3.py @@ -25,8 +25,12 @@ class ManagedServiceIdentity(Model): :vartype tenant_id: str :ivar principal_id: Principal Id of managed service identity. :vartype principal_id: str - :param identity_ids: Array of UserAssigned managed service identities. - :type identity_ids: list[str] + :param user_assigned_identities: The list of user assigned identities + associated with the resource. The user identity dictionary key references + will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + :type user_assigned_identities: dict[str, + ~azure.mgmt.web.models.ManagedServiceIdentityUserAssignedIdentitiesValue] """ _validation = { @@ -38,12 +42,12 @@ class ManagedServiceIdentity(Model): 'type': {'key': 'type', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, } - def __init__(self, *, type=None, identity_ids=None, **kwargs) -> None: + def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: super(ManagedServiceIdentity, self).__init__(**kwargs) self.type = type self.tenant_id = None self.principal_id = None - self.identity_ids = identity_ids + self.user_assigned_identities = user_assigned_identities diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value.py new file mode 100644 index 000000000000..8c408a4598b3 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value.py @@ -0,0 +1,40 @@ +# 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 ManagedServiceIdentityUserAssignedIdentitiesValue(Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Principal Id of user assigned identity + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None diff --git a/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value_py3.py b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value_py3.py new file mode 100644 index 000000000000..bc71a3561765 --- /dev/null +++ b/azure-mgmt-web/azure/mgmt/web/models/managed_service_identity_user_assigned_identities_value_py3.py @@ -0,0 +1,40 @@ +# 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 ManagedServiceIdentityUserAssignedIdentitiesValue(Model): + """ManagedServiceIdentityUserAssignedIdentitiesValue. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar principal_id: Principal Id of user assigned identity + :vartype principal_id: str + :ivar client_id: Client Id of user assigned identity + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None