Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sdk/storage/azure-mgmt-storage/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Release History
===============

5.0.0 (2019-10-21)
++++++++++++++++++

**Features**

- Model AzureFilesIdentityBasedAuthentication has a new parameter active_directory_properties

**Breaking changes**

- Operation StorageAccountsOperations.list_keys has a new signature

4.2.0 (2019-10-07)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -183,10 +185,12 @@
ImmutabilityPolicyState,
ImmutabilityPolicyUpdateType,
StorageAccountExpand,
ListKeyExpand,
)

__all__ = [
'AccountSasParameters',
'ActiveDirectoryProperties',
'AzureEntityResource',
'AzureFilesIdentityBasedAuthentication',
'BlobContainer',
Expand Down Expand Up @@ -290,4 +294,5 @@
'ImmutabilityPolicyState',
'ImmutabilityPolicyUpdateType',
'StorageAccountExpand',
'ListKeyExpand',
]
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 = {
Expand All @@ -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):
Expand Down Expand Up @@ -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
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 = {
Expand All @@ -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):
Expand Down Expand Up @@ -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
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class DirectoryServiceOptions(str, Enum):

none = "None"
aadds = "AADDS"
ad = "AD"


class AccessTier(str, Enum):
Expand Down Expand Up @@ -224,3 +225,8 @@ class ImmutabilityPolicyUpdateType(str, Enum):
class StorageAccountExpand(str, Enum):

geo_replication_stats = "geoReplicationStats"


class ListKeyExpand(str, Enum):

kerb = "kerb"
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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 = {}
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "4.2.0"
VERSION = "5.0.0"