diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py index e839d483b34d..371410aa5854 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/__init__.py @@ -11,6 +11,7 @@ try: from ._models_py3 import AccountSasParameters + from ._models_py3 import ActiveDirectoryProperties from ._models_py3 import AzureEntityResource from ._models_py3 import AzureFilesIdentityBasedAuthentication from ._models_py3 import BlobContainer @@ -79,6 +80,7 @@ from ._models_py3 import VirtualNetworkRule except (SyntaxError, ImportError): from ._models import AccountSasParameters + from ._models import ActiveDirectoryProperties from ._models import AzureEntityResource from ._models import AzureFilesIdentityBasedAuthentication from ._models import BlobContainer @@ -183,10 +185,12 @@ ImmutabilityPolicyState, ImmutabilityPolicyUpdateType, StorageAccountExpand, + ListKeyExpand, ) __all__ = [ 'AccountSasParameters', + 'ActiveDirectoryProperties', 'AzureEntityResource', 'AzureFilesIdentityBasedAuthentication', 'BlobContainer', @@ -290,4 +294,5 @@ 'ImmutabilityPolicyState', 'ImmutabilityPolicyUpdateType', 'StorageAccountExpand', + 'ListKeyExpand', ] diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py index f9426dd019f1..3992e7696a0d 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models.py @@ -81,6 +81,56 @@ def __init__(self, **kwargs): self.key_to_sign = kwargs.get('key_to_sign', None) +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = kwargs.get('domain_name', None) + self.net_bios_domain_name = kwargs.get('net_bios_domain_name', None) + self.forest_name = kwargs.get('forest_name', None) + self.domain_guid = kwargs.get('domain_guid', None) + self.domain_sid = kwargs.get('domain_sid', None) + self.azure_storage_sid = kwargs.get('azure_storage_sid', None) + + class Resource(Model): """Resource. @@ -160,9 +210,12 @@ class AzureFilesIdentityBasedAuthentication(Model): All required parameters must be populated in order to send to Azure. :param directory_service_options: Required. Indicates the directory - service used. Possible values include: 'None', 'AADDS' + service used. Possible values include: 'None', 'AADDS', 'AD' :type directory_service_options: str or ~azure.mgmt.storage.v2019_04_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2019_04_01.models.ActiveDirectoryProperties """ _validation = { @@ -171,11 +224,13 @@ class AzureFilesIdentityBasedAuthentication(Model): _attribute_map = { 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, } def __init__(self, **kwargs): super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) self.directory_service_options = kwargs.get('directory_service_options', None) + self.active_directory_properties = kwargs.get('active_directory_properties', None) class BlobContainer(AzureEntityResource): @@ -2610,7 +2665,7 @@ class StorageAccountRegenerateKeyParameters(Model): All required parameters must be populated in order to send to Azure. :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. + regenerated, possible values are key1, key2, kerb1, kerb2. :type key_name: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py index f65672651e2a..17659f2bc0ae 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_models_py3.py @@ -81,6 +81,56 @@ def __init__(self, *, services, resource_types, permissions, shared_access_expir self.key_to_sign = key_to_sign +class ActiveDirectoryProperties(Model): + """Settings properties for Active Directory (AD). + + All required parameters must be populated in order to send to Azure. + + :param domain_name: Required. Specifies the primary domain that the AD DNS + server is authoritative for. + :type domain_name: str + :param net_bios_domain_name: Required. Specifies the NetBIOS domain name. + :type net_bios_domain_name: str + :param forest_name: Required. Specifies the Active Directory forest to + get. + :type forest_name: str + :param domain_guid: Required. Specifies the domain GUID. + :type domain_guid: str + :param domain_sid: Required. Specifies the security identifier (SID). + :type domain_sid: str + :param azure_storage_sid: Required. Specifies the security identifier + (SID) for Azure Storage. + :type azure_storage_sid: str + """ + + _validation = { + 'domain_name': {'required': True}, + 'net_bios_domain_name': {'required': True}, + 'forest_name': {'required': True}, + 'domain_guid': {'required': True}, + 'domain_sid': {'required': True}, + 'azure_storage_sid': {'required': True}, + } + + _attribute_map = { + 'domain_name': {'key': 'domainName', 'type': 'str'}, + 'net_bios_domain_name': {'key': 'netBiosDomainName', 'type': 'str'}, + 'forest_name': {'key': 'forestName', 'type': 'str'}, + 'domain_guid': {'key': 'domainGuid', 'type': 'str'}, + 'domain_sid': {'key': 'domainSid', 'type': 'str'}, + 'azure_storage_sid': {'key': 'azureStorageSid', 'type': 'str'}, + } + + def __init__(self, *, domain_name: str, net_bios_domain_name: str, forest_name: str, domain_guid: str, domain_sid: str, azure_storage_sid: str, **kwargs) -> None: + super(ActiveDirectoryProperties, self).__init__(**kwargs) + self.domain_name = domain_name + self.net_bios_domain_name = net_bios_domain_name + self.forest_name = forest_name + self.domain_guid = domain_guid + self.domain_sid = domain_sid + self.azure_storage_sid = azure_storage_sid + + class Resource(Model): """Resource. @@ -160,9 +210,12 @@ class AzureFilesIdentityBasedAuthentication(Model): All required parameters must be populated in order to send to Azure. :param directory_service_options: Required. Indicates the directory - service used. Possible values include: 'None', 'AADDS' + service used. Possible values include: 'None', 'AADDS', 'AD' :type directory_service_options: str or ~azure.mgmt.storage.v2019_04_01.models.DirectoryServiceOptions + :param active_directory_properties: Required if choose AD. + :type active_directory_properties: + ~azure.mgmt.storage.v2019_04_01.models.ActiveDirectoryProperties """ _validation = { @@ -171,11 +224,13 @@ class AzureFilesIdentityBasedAuthentication(Model): _attribute_map = { 'directory_service_options': {'key': 'directoryServiceOptions', 'type': 'str'}, + 'active_directory_properties': {'key': 'activeDirectoryProperties', 'type': 'ActiveDirectoryProperties'}, } - def __init__(self, *, directory_service_options, **kwargs) -> None: + def __init__(self, *, directory_service_options, active_directory_properties=None, **kwargs) -> None: super(AzureFilesIdentityBasedAuthentication, self).__init__(**kwargs) self.directory_service_options = directory_service_options + self.active_directory_properties = active_directory_properties class BlobContainer(AzureEntityResource): @@ -2610,7 +2665,7 @@ class StorageAccountRegenerateKeyParameters(Model): All required parameters must be populated in order to send to Azure. :param key_name: Required. The name of storage keys that want to be - regenerated, possible values are key1, key2. + regenerated, possible values are key1, key2, kerb1, kerb2. :type key_name: str """ diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py index 0ca18f801c42..9217257e5dbc 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/models/_storage_management_client_enums.py @@ -89,6 +89,7 @@ class DirectoryServiceOptions(str, Enum): none = "None" aadds = "AADDS" + ad = "AD" class AccessTier(str, Enum): @@ -224,3 +225,8 @@ class ImmutabilityPolicyUpdateType(str, Enum): class StorageAccountExpand(str, Enum): geo_replication_stats = "geoReplicationStats" + + +class ListKeyExpand(str, Enum): + + kerb = "kerb" diff --git a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py index 0ec6ee010534..f1f651d1c1e0 100644 --- a/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py +++ b/sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2019_04_01/operations/_storage_accounts_operations.py @@ -566,8 +566,9 @@ def internal_paging(next_link=None): list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'} def list_keys( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Lists the access keys for the specified storage account. + self, resource_group_name, account_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists the access keys or Kerberos keys (if active directory enabled) + for the specified storage account. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -576,6 +577,10 @@ def list_keys( specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. :type account_name: str + :param expand: Specifies type of the key to be listed. Possible value + is kerb. Possible values include: 'kerb' + :type expand: str or + ~azure.mgmt.storage.v2019_04_01.models.ListKeyExpand :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -599,6 +604,8 @@ def list_keys( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'ListKeyExpand') # Construct headers header_parameters = {} @@ -632,7 +639,8 @@ def list_keys( def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): - """Regenerates one of the access keys for the specified storage account. + """Regenerates one of the access keys or Kerberos keys for the specified + storage account. :param resource_group_name: The name of the resource group within the user's subscription. The name is case insensitive. @@ -642,7 +650,7 @@ def regenerate_key( 24 characters in length and use numbers and lower-case letters only. :type account_name: str :param key_name: The name of storage keys that want to be regenerated, - possible values are key1, key2. + possible values are key1, key2, kerb1, kerb2. :type key_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the