Skip to content

Commit

Permalink
Generated from c2d7ae74564edf027d2baa5d39864ba26a4f593a (#4448)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AutorestCI authored Mar 4, 2019
1 parent 60727bd commit 8124af5
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 9 deletions.
3 changes: 3 additions & 0 deletions azure-mgmt-web/azure/mgmt/web/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -603,6 +605,7 @@
'HybridConnection',
'DeletedSite',
'ProxyOnlyResource',
'ManagedServiceIdentityUserAssignedIdentitiesValue',
'ManagedServiceIdentity',
'GeoDistribution',
'SlotSwapStatus',
Expand Down
12 changes: 8 additions & 4 deletions azure-mgmt-web/azure/mgmt/web/models/managed_service_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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, **kwargs):
super(ManagedServiceIdentity, self).__init__(**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)
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8124af5

Please sign in to comment.