Skip to content

Commit d6e5ed3

Browse files
author
SDK Automation
committed
Generated from 695e5dab86ca92a63432a62443ab26e4f332fc82
Support UserAssigned MSI for CosmosDB
1 parent b863d07 commit d6e5ed3

File tree

3 files changed

+85
-2
lines changed

3 files changed

+85
-2
lines changed

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
from ._models_py3 import IpAddressOrRange
7373
from ._models_py3 import Location
7474
from ._models_py3 import ManagedServiceIdentity
75+
from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue
7576
from ._models_py3 import Metric
7677
from ._models_py3 import MetricAvailability
7778
from ._models_py3 import MetricDefinition
@@ -214,6 +215,7 @@
214215
from ._models import IpAddressOrRange
215216
from ._models import Location
216217
from ._models import ManagedServiceIdentity
218+
from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue
217219
from ._models import Metric
218220
from ._models import MetricAvailability
219221
from ._models import MetricDefinition
@@ -405,6 +407,7 @@
405407
'IpAddressOrRange',
406408
'Location',
407409
'ManagedServiceIdentity',
410+
'ManagedServiceIdentityUserAssignedIdentitiesValue',
408411
'Metric',
409412
'MetricAvailability',
410413
'MetricDefinition',

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,8 @@ class DatabaseAccountUpdateParameters(Model):
15531553
:param backup_policy: The object representing the policy for taking
15541554
backups on an account.
15551555
:type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy
1556+
:param identity:
1557+
:type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
15561558
"""
15571559

15581560
_attribute_map = {
@@ -1575,6 +1577,7 @@ class DatabaseAccountUpdateParameters(Model):
15751577
'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'},
15761578
'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'},
15771579
'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'},
1580+
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
15781581
}
15791582

15801583
def __init__(self, **kwargs):
@@ -1598,6 +1601,7 @@ def __init__(self, **kwargs):
15981601
self.api_properties = kwargs.get('api_properties', None)
15991602
self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None)
16001603
self.backup_policy = kwargs.get('backup_policy', None)
1604+
self.identity = kwargs.get('identity', None)
16011605

16021606

16031607
class DatabaseRestoreResource(Model):
@@ -2494,6 +2498,12 @@ class ManagedServiceIdentity(Model):
24942498
remove any identities from the service. Possible values include:
24952499
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
24962500
:type type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType
2501+
:param user_assigned_identities: The list of user identities associated
2502+
with resource. The user identity dictionary key references will be ARM
2503+
resource ids in the form:
2504+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
2505+
:type user_assigned_identities: dict[str,
2506+
~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentitiesValue]
24972507
"""
24982508

24992509
_validation = {
@@ -2505,13 +2515,43 @@ class ManagedServiceIdentity(Model):
25052515
'principal_id': {'key': 'principalId', 'type': 'str'},
25062516
'tenant_id': {'key': 'tenantId', 'type': 'str'},
25072517
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
2518+
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'},
25082519
}
25092520

25102521
def __init__(self, **kwargs):
25112522
super(ManagedServiceIdentity, self).__init__(**kwargs)
25122523
self.principal_id = None
25132524
self.tenant_id = None
25142525
self.type = kwargs.get('type', None)
2526+
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
2527+
2528+
2529+
class ManagedServiceIdentityUserAssignedIdentitiesValue(Model):
2530+
"""ManagedServiceIdentityUserAssignedIdentitiesValue.
2531+
2532+
Variables are only populated by the server, and will be ignored when
2533+
sending a request.
2534+
2535+
:ivar principal_id: The principal id of user assigned identity.
2536+
:vartype principal_id: str
2537+
:ivar client_id: The client id of user assigned identity.
2538+
:vartype client_id: str
2539+
"""
2540+
2541+
_validation = {
2542+
'principal_id': {'readonly': True},
2543+
'client_id': {'readonly': True},
2544+
}
2545+
2546+
_attribute_map = {
2547+
'principal_id': {'key': 'principalId', 'type': 'str'},
2548+
'client_id': {'key': 'clientId', 'type': 'str'},
2549+
}
2550+
2551+
def __init__(self, **kwargs):
2552+
super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
2553+
self.principal_id = None
2554+
self.client_id = None
25152555

25162556

25172557
class Metric(Model):

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,8 @@ class DatabaseAccountUpdateParameters(Model):
15531553
:param backup_policy: The object representing the policy for taking
15541554
backups on an account.
15551555
:type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy
1556+
:param identity:
1557+
:type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
15561558
"""
15571559

15581560
_attribute_map = {
@@ -1575,9 +1577,10 @@ class DatabaseAccountUpdateParameters(Model):
15751577
'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'},
15761578
'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'},
15771579
'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'},
1580+
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
15781581
}
15791582

1580-
def __init__(self, *, tags=None, location: str=None, consistency_policy=None, locations=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, **kwargs) -> None:
1583+
def __init__(self, *, tags=None, location: str=None, consistency_policy=None, locations=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, identity=None, **kwargs) -> None:
15811584
super(DatabaseAccountUpdateParameters, self).__init__(**kwargs)
15821585
self.tags = tags
15831586
self.location = location
@@ -1598,6 +1601,7 @@ def __init__(self, *, tags=None, location: str=None, consistency_policy=None, lo
15981601
self.api_properties = api_properties
15991602
self.enable_analytical_storage = enable_analytical_storage
16001603
self.backup_policy = backup_policy
1604+
self.identity = identity
16011605

16021606

16031607
class DatabaseRestoreResource(Model):
@@ -2494,6 +2498,12 @@ class ManagedServiceIdentity(Model):
24942498
remove any identities from the service. Possible values include:
24952499
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
24962500
:type type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType
2501+
:param user_assigned_identities: The list of user identities associated
2502+
with resource. The user identity dictionary key references will be ARM
2503+
resource ids in the form:
2504+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
2505+
:type user_assigned_identities: dict[str,
2506+
~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentitiesValue]
24972507
"""
24982508

24992509
_validation = {
@@ -2505,13 +2515,43 @@ class ManagedServiceIdentity(Model):
25052515
'principal_id': {'key': 'principalId', 'type': 'str'},
25062516
'tenant_id': {'key': 'tenantId', 'type': 'str'},
25072517
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
2518+
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'},
25082519
}
25092520

2510-
def __init__(self, *, type=None, **kwargs) -> None:
2521+
def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None:
25112522
super(ManagedServiceIdentity, self).__init__(**kwargs)
25122523
self.principal_id = None
25132524
self.tenant_id = None
25142525
self.type = type
2526+
self.user_assigned_identities = user_assigned_identities
2527+
2528+
2529+
class ManagedServiceIdentityUserAssignedIdentitiesValue(Model):
2530+
"""ManagedServiceIdentityUserAssignedIdentitiesValue.
2531+
2532+
Variables are only populated by the server, and will be ignored when
2533+
sending a request.
2534+
2535+
:ivar principal_id: The principal id of user assigned identity.
2536+
:vartype principal_id: str
2537+
:ivar client_id: The client id of user assigned identity.
2538+
:vartype client_id: str
2539+
"""
2540+
2541+
_validation = {
2542+
'principal_id': {'readonly': True},
2543+
'client_id': {'readonly': True},
2544+
}
2545+
2546+
_attribute_map = {
2547+
'principal_id': {'key': 'principalId', 'type': 'str'},
2548+
'client_id': {'key': 'clientId', 'type': 'str'},
2549+
}
2550+
2551+
def __init__(self, **kwargs) -> None:
2552+
super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
2553+
self.principal_id = None
2554+
self.client_id = None
25152555

25162556

25172557
class Metric(Model):

0 commit comments

Comments
 (0)