Skip to content

Commit

Permalink
[AutoPR] storage/resource-manager (#7906)
Browse files Browse the repository at this point in the history
* [AutoPR storage/resource-manager] [Bug fix] Remove read-only constraint for management policy (#6233)

* Generated from 00d9e1b50ab5daed68696f0b0c612e912acde7db

[Bug fix] Remove read-only constraint for management policy

* Packaging update of azure-mgmt-storage

* Generated from 0e6f149f5338b7fe8256adb51584a22aaecdb407

change type to number

* Generated from 870609e2d01b2e64b589a0eb07e938f19282f4f0

Modify description, remove integer

* Generated from 2e78b5cbe1e0ef6676f9d9c3266b48cfe87403fd (#6536)

fix typo

* [AutoPR storage/resource-manager] updating description - clarify encryption enabled by default (#5978)

* Generated from 1929243cc853b5f21c5e6cef8a2867fb4d26b4dc

updating description - clarify encryption enabled by default

* Generated from 1929243cc853b5f21c5e6cef8a2867fb4d26b4dc

updating description - clarify encryption enabled by default

* Generated from 3acbc3b4106db3097de5be5e4df47afb38d51ec0 (#6735)

Use cors definition from blob.json

* Generated from 94667089d429b4f1aca38e60f85b13f5c0039219 (#6884)

Align File swagger with the Blob swagger

* [AutoPR storage/resource-manager] Add change feed properties to 2019-04-01 Storage. (#6956)

* Generated from 774367438889ac553def1957b72b8ba63ad877e5

Add change feed properties to 2019-04-01 Storage.

Add change feed properties to Storage Blob Services.

* Generated from 774367438889ac553def1957b72b8ba63ad877e5

Add change feed properties to 2019-04-01 Storage.

Add change feed properties to Storage Blob Services.

* [AutoPR storage/resource-manager] Rename errorResponse to align with other RPs (#7058)

* Generated from 3658b509eba17c55f99d9e22c28e55cb88e33ac0

Rename errorResponse to align with other RPs

* Generated from 3658b509eba17c55f99d9e22c28e55cb88e33ac0

Rename errorResponse to align with other RPs

* Generated from ebaee7c36eb7db67a4e648374f69f26a654b444f (#7445)

[SRP] Add new storage account property largeFileSharesState

* model change for storage

* changelog for storage

* Generated from ebaee7c36eb7db67a4e648374f69f26a654b444f (#7445)

[SRP] Add new storage account property largeFileSharesState

* changelog for storage 4.2.0

* Update HISTORY.rst

* Update HISTORY.rst

* Generated from c7ff553c30947fdc9a3e133cc8c1ec3740abc0ac (#7922)

[SRP] Support Active Directory and regenerate kerb keys

* changelog
  • Loading branch information
AutorestCI authored and fengzhou-msft committed Nov 5, 2019
1 parent 9990bba commit ea7e3a0
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 10 deletions.
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"

0 comments on commit ea7e3a0

Please sign in to comment.