Skip to content

Commit

Permalink
Generated from f99eb282c2ff4d338081525e31c0951f2a521332 (#3550)
Browse files Browse the repository at this point in the history
Added HDInsight support for MSI
  • Loading branch information
AutorestCI authored Oct 11, 2018
1 parent 7736b8e commit 82c67a5
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 2 deletions.
8 changes: 8 additions & 0 deletions azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
from .storage_account_py3 import StorageAccount
from .storage_profile_py3 import StorageProfile
from .cluster_create_properties_py3 import ClusterCreateProperties
from .cluster_identity_user_assigned_identities_value_py3 import ClusterIdentityUserAssignedIdentitiesValue
from .cluster_identity_py3 import ClusterIdentity
from .cluster_create_parameters_extended_py3 import ClusterCreateParametersExtended
from .cluster_patch_parameters_py3 import ClusterPatchParameters
from .quota_info_py3 import QuotaInfo
Expand Down Expand Up @@ -73,6 +75,8 @@
from .storage_account import StorageAccount
from .storage_profile import StorageProfile
from .cluster_create_properties import ClusterCreateProperties
from .cluster_identity_user_assigned_identities_value import ClusterIdentityUserAssignedIdentitiesValue
from .cluster_identity import ClusterIdentity
from .cluster_create_parameters_extended import ClusterCreateParametersExtended
from .cluster_patch_parameters import ClusterPatchParameters
from .quota_info import QuotaInfo
Expand Down Expand Up @@ -113,6 +117,7 @@
DirectoryType,
OSType,
Tier,
ResourceIdentityType,
HDInsightClusterProvisioningState,
AsyncOperationState,
)
Expand All @@ -133,6 +138,8 @@
'StorageAccount',
'StorageProfile',
'ClusterCreateProperties',
'ClusterIdentityUserAssignedIdentitiesValue',
'ClusterIdentity',
'ClusterCreateParametersExtended',
'ClusterPatchParameters',
'QuotaInfo',
Expand Down Expand Up @@ -172,6 +179,7 @@
'DirectoryType',
'OSType',
'Tier',
'ResourceIdentityType',
'HDInsightClusterProvisioningState',
'AsyncOperationState',
]
4 changes: 4 additions & 0 deletions azure-mgmt-hdinsight/azure/mgmt/hdinsight/models/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Cluster(TrackedResource):
:type etag: str
:param properties: The properties of the cluster.
:type properties: ~azure.mgmt.hdinsight.models.ClusterGetProperties
:param identity: The identity of the cluster, if configured.
:type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity
"""

_validation = {
Expand All @@ -48,9 +50,11 @@ class Cluster(TrackedResource):
'tags': {'key': 'tags', 'type': '{str}'},
'etag': {'key': 'etag', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ClusterGetProperties'},
'identity': {'key': 'identity', 'type': 'ClusterIdentity'},
}

def __init__(self, **kwargs):
super(Cluster, self).__init__(**kwargs)
self.etag = kwargs.get('etag', None)
self.properties = kwargs.get('properties', None)
self.identity = kwargs.get('identity', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ class ClusterCreateParametersExtended(Model):
:type tags: dict[str, str]
:param properties: The cluster create parameters.
:type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties
:param identity: The identity of the cluster, if configured.
:type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity
"""

_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'},
'identity': {'key': 'identity', 'type': 'ClusterIdentity'},
}

def __init__(self, **kwargs):
super(ClusterCreateParametersExtended, self).__init__(**kwargs)
self.location = kwargs.get('location', None)
self.tags = kwargs.get('tags', None)
self.properties = kwargs.get('properties', None)
self.identity = kwargs.get('identity', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ class ClusterCreateParametersExtended(Model):
:type tags: dict[str, str]
:param properties: The cluster create parameters.
:type properties: ~azure.mgmt.hdinsight.models.ClusterCreateProperties
:param identity: The identity of the cluster, if configured.
:type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity
"""

_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'properties': {'key': 'properties', 'type': 'ClusterCreateProperties'},
'identity': {'key': 'identity', 'type': 'ClusterIdentity'},
}

def __init__(self, *, location: str=None, tags=None, properties=None, **kwargs) -> None:
def __init__(self, *, location: str=None, tags=None, properties=None, identity=None, **kwargs) -> None:
super(ClusterCreateParametersExtended, self).__init__(**kwargs)
self.location = location
self.tags = tags
self.properties = properties
self.identity = identity
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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 ClusterIdentity(Model):
"""Identity for the cluster.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of cluster identity. This property
will only be provided for a system assigned identity.
:vartype principal_id: str
:ivar tenant_id: The tenant id associated with the cluster. This property
will only be provided for a system assigned identity.
:vartype tenant_id: str
:param type: The type of identity used for the cluster. The type
'SystemAssigned, UserAssigned' includes both an implicitly created
identity and a set of user assigned identities. Possible values include:
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or ~azure.mgmt.hdinsight.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the cluster. 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.hdinsight.models.ClusterIdentityUserAssignedIdentitiesValue]
"""

_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ClusterIdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, **kwargs):
super(ClusterIdentity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = kwargs.get('type', None)
self.user_assigned_identities = kwargs.get('user_assigned_identities', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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 ClusterIdentity(Model):
"""Identity for the cluster.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of cluster identity. This property
will only be provided for a system assigned identity.
:vartype principal_id: str
:ivar tenant_id: The tenant id associated with the cluster. This property
will only be provided for a system assigned identity.
:vartype tenant_id: str
:param type: The type of identity used for the cluster. The type
'SystemAssigned, UserAssigned' includes both an implicitly created
identity and a set of user assigned identities. Possible values include:
'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'
:type type: str or ~azure.mgmt.hdinsight.models.ResourceIdentityType
:param user_assigned_identities: The list of user identities associated
with the cluster. 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.hdinsight.models.ClusterIdentityUserAssignedIdentitiesValue]
"""

_validation = {
'principal_id': {'readonly': True},
'tenant_id': {'readonly': True},
}

_attribute_map = {
'principal_id': {'key': 'principalId', 'type': 'str'},
'tenant_id': {'key': 'tenantId', 'type': 'str'},
'type': {'key': 'type', 'type': 'ResourceIdentityType'},
'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ClusterIdentityUserAssignedIdentitiesValue}'},
}

def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None:
super(ClusterIdentity, self).__init__(**kwargs)
self.principal_id = None
self.tenant_id = None
self.type = type
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 ClusterIdentityUserAssignedIdentitiesValue(Model):
"""ClusterIdentityUserAssignedIdentitiesValue.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of user assigned identity.
:vartype principal_id: str
:ivar client_id: The 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(ClusterIdentityUserAssignedIdentitiesValue, 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 ClusterIdentityUserAssignedIdentitiesValue(Model):
"""ClusterIdentityUserAssignedIdentitiesValue.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar principal_id: The principal id of user assigned identity.
:vartype principal_id: str
:ivar client_id: The 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(ClusterIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs)
self.principal_id = None
self.client_id = None
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Cluster(TrackedResource):
:type etag: str
:param properties: The properties of the cluster.
:type properties: ~azure.mgmt.hdinsight.models.ClusterGetProperties
:param identity: The identity of the cluster, if configured.
:type identity: ~azure.mgmt.hdinsight.models.ClusterIdentity
"""

_validation = {
Expand All @@ -48,9 +50,11 @@ class Cluster(TrackedResource):
'tags': {'key': 'tags', 'type': '{str}'},
'etag': {'key': 'etag', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ClusterGetProperties'},
'identity': {'key': 'identity', 'type': 'ClusterIdentity'},
}

def __init__(self, *, location: str=None, tags=None, etag: str=None, properties=None, **kwargs) -> None:
def __init__(self, *, location: str=None, tags=None, etag: str=None, properties=None, identity=None, **kwargs) -> None:
super(Cluster, self).__init__(location=location, tags=tags, **kwargs)
self.etag = etag
self.properties = properties
self.identity = identity
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ class Tier(str, Enum):
premium = "Premium"


class ResourceIdentityType(str, Enum):

system_assigned = "SystemAssigned"
user_assigned = "UserAssigned"
system_assigned_user_assigned = "SystemAssigned, UserAssigned"
none = "None"


class HDInsightClusterProvisioningState(str, Enum):

in_progress = "InProgress"
Expand Down

0 comments on commit 82c67a5

Please sign in to comment.