diff --git a/profiles/latest/storage/mgmt/storage/models.go b/profiles/latest/storage/mgmt/storage/models.go index a37cf2345411..c475a601a271 100644 --- a/profiles/latest/storage/mgmt/storage/models.go +++ b/profiles/latest/storage/mgmt/storage/models.go @@ -85,6 +85,7 @@ type DirectoryServiceOptions = original.DirectoryServiceOptions const ( DirectoryServiceOptionsAADDS DirectoryServiceOptions = original.DirectoryServiceOptionsAADDS + DirectoryServiceOptionsAD DirectoryServiceOptions = original.DirectoryServiceOptionsAD DirectoryServiceOptionsNone DirectoryServiceOptions = original.DirectoryServiceOptionsNone ) @@ -173,6 +174,12 @@ const ( LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked ) +type ListKeyExpand = original.ListKeyExpand + +const ( + Kerb ListKeyExpand = original.Kerb +) + type Permissions = original.Permissions const ( @@ -300,6 +307,7 @@ type AccountUpdateParameters = original.AccountUpdateParameters type AccountsClient = original.AccountsClient type AccountsCreateFuture = original.AccountsCreateFuture type AccountsFailoverFuture = original.AccountsFailoverFuture +type ActiveDirectoryProperties = original.ActiveDirectoryProperties type AzureEntityResource = original.AzureEntityResource type AzureFilesIdentityBasedAuthentication = original.AzureFilesIdentityBasedAuthentication type BaseClient = original.BaseClient @@ -523,6 +531,9 @@ func PossibleLeaseStateValues() []LeaseState { func PossibleLeaseStatusValues() []LeaseStatus { return original.PossibleLeaseStatusValues() } +func PossibleListKeyExpandValues() []ListKeyExpand { + return original.PossibleListKeyExpandValues() +} func PossiblePermissionsValues() []Permissions { return original.PossiblePermissionsValues() } diff --git a/profiles/preview/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go index bd83eed0e792..87e3d34ebd41 100644 --- a/profiles/preview/storage/mgmt/storage/models.go +++ b/profiles/preview/storage/mgmt/storage/models.go @@ -85,6 +85,7 @@ type DirectoryServiceOptions = original.DirectoryServiceOptions const ( DirectoryServiceOptionsAADDS DirectoryServiceOptions = original.DirectoryServiceOptionsAADDS + DirectoryServiceOptionsAD DirectoryServiceOptions = original.DirectoryServiceOptionsAD DirectoryServiceOptionsNone DirectoryServiceOptions = original.DirectoryServiceOptionsNone ) @@ -173,6 +174,12 @@ const ( LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked ) +type ListKeyExpand = original.ListKeyExpand + +const ( + Kerb ListKeyExpand = original.Kerb +) + type Permissions = original.Permissions const ( @@ -300,6 +307,7 @@ type AccountUpdateParameters = original.AccountUpdateParameters type AccountsClient = original.AccountsClient type AccountsCreateFuture = original.AccountsCreateFuture type AccountsFailoverFuture = original.AccountsFailoverFuture +type ActiveDirectoryProperties = original.ActiveDirectoryProperties type AzureEntityResource = original.AzureEntityResource type AzureFilesIdentityBasedAuthentication = original.AzureFilesIdentityBasedAuthentication type BaseClient = original.BaseClient @@ -523,6 +531,9 @@ func PossibleLeaseStateValues() []LeaseState { func PossibleLeaseStatusValues() []LeaseStatus { return original.PossibleLeaseStatusValues() } +func PossibleListKeyExpandValues() []ListKeyExpand { + return original.PossibleListKeyExpandValues() +} func PossiblePermissionsValues() []Permissions { return original.PossiblePermissionsValues() } diff --git a/services/storage/mgmt/2019-04-01/storage/accounts.go b/services/storage/mgmt/2019-04-01/storage/accounts.go index 4ca8db150dec..9b5daba19e50 100644 --- a/services/storage/mgmt/2019-04-01/storage/accounts.go +++ b/services/storage/mgmt/2019-04-01/storage/accounts.go @@ -164,6 +164,16 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.NetBiosDomainName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.ForestName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainGUID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.DomainSid", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.AccountPropertiesCreateParameters.AzureFilesIdentityBasedAuthentication.ActiveDirectoryProperties.AzureStorageSid", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, }}}}, {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { @@ -817,13 +827,14 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( return } -// ListKeys lists the access keys for the specified storage account. +// ListKeys lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { +// expand - specifies type of the key to be listed. Possible value is kerb. +func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string, expand ListKeyExpand) (result AccountListKeysResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListKeys") defer func() { @@ -847,7 +858,7 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str return result, validation.NewError("storage.AccountsClient", "ListKeys", err.Error()) } - req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName, expand) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request") return @@ -869,7 +880,7 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str } // ListKeysPreparer prepares the ListKeys request. -func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, expand ListKeyExpand) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -880,6 +891,9 @@ func (client AccountsClient) ListKeysPreparer(ctx context.Context, resourceGroup queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1008,13 +1022,13 @@ func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (resul return } -// RegenerateKey regenerates one of the access keys for the specified storage account. +// RegenerateKey regenerates one of the access keys or Kerberos keys for the specified storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// regenerateKey - specifies name of the key which should be regenerated -- key1 or key2. +// regenerateKey - specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.RegenerateKey") diff --git a/services/storage/mgmt/2019-04-01/storage/models.go b/services/storage/mgmt/2019-04-01/storage/models.go index 8cba20da6e24..b6326d0faba7 100644 --- a/services/storage/mgmt/2019-04-01/storage/models.go +++ b/services/storage/mgmt/2019-04-01/storage/models.go @@ -148,13 +148,15 @@ type DirectoryServiceOptions string const ( // DirectoryServiceOptionsAADDS ... DirectoryServiceOptionsAADDS DirectoryServiceOptions = "AADDS" + // DirectoryServiceOptionsAD ... + DirectoryServiceOptionsAD DirectoryServiceOptions = "AD" // DirectoryServiceOptionsNone ... DirectoryServiceOptionsNone DirectoryServiceOptions = "None" ) // PossibleDirectoryServiceOptionsValues returns an array of possible values for the DirectoryServiceOptions const type. func PossibleDirectoryServiceOptionsValues() []DirectoryServiceOptions { - return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsNone} + return []DirectoryServiceOptions{DirectoryServiceOptionsAADDS, DirectoryServiceOptionsAD, DirectoryServiceOptionsNone} } // GeoReplicationStatus enumerates the values for geo replication status. @@ -338,6 +340,19 @@ func PossibleLeaseStatusValues() []LeaseStatus { return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} } +// ListKeyExpand enumerates the values for list key expand. +type ListKeyExpand string + +const ( + // Kerb ... + Kerb ListKeyExpand = "kerb" +) + +// PossibleListKeyExpandValues returns an array of possible values for the ListKeyExpand const type. +func PossibleListKeyExpandValues() []ListKeyExpand { + return []ListKeyExpand{Kerb} +} + // Permissions enumerates the values for permissions. type Permissions string @@ -1070,7 +1085,7 @@ type AccountPropertiesUpdateParameters struct { // AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. type AccountRegenerateKeyParameters struct { - // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2. + // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. KeyName *string `json:"keyName,omitempty"` } @@ -1242,6 +1257,22 @@ func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// ActiveDirectoryProperties settings properties for Active Directory (AD). +type ActiveDirectoryProperties struct { + // DomainName - Specifies the primary domain that the AD DNS server is authoritative for. + DomainName *string `json:"domainName,omitempty"` + // NetBiosDomainName - Specifies the NetBIOS domain name. + NetBiosDomainName *string `json:"netBiosDomainName,omitempty"` + // ForestName - Specifies the Active Directory forest to get. + ForestName *string `json:"forestName,omitempty"` + // DomainGUID - Specifies the domain GUID. + DomainGUID *string `json:"domainGuid,omitempty"` + // DomainSid - Specifies the security identifier (SID). + DomainSid *string `json:"domainSid,omitempty"` + // AzureStorageSid - Specifies the security identifier (SID) for Azure Storage. + AzureStorageSid *string `json:"azureStorageSid,omitempty"` +} + // AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. type AzureEntityResource struct { // Etag - READ-ONLY; Resource Etag. @@ -1256,8 +1287,10 @@ type AzureEntityResource struct { // AzureFilesIdentityBasedAuthentication settings for Azure Files identity based authentication. type AzureFilesIdentityBasedAuthentication struct { - // DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS' + // DirectoryServiceOptions - Indicates the directory service used. Possible values include: 'DirectoryServiceOptionsNone', 'DirectoryServiceOptionsAADDS', 'DirectoryServiceOptionsAD' DirectoryServiceOptions DirectoryServiceOptions `json:"directoryServiceOptions,omitempty"` + // ActiveDirectoryProperties - Required if choose AD. + ActiveDirectoryProperties *ActiveDirectoryProperties `json:"activeDirectoryProperties,omitempty"` } // BlobContainer properties of the blob container, including Id, resource name, resource type, Etag. diff --git a/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go index 2b70fbf217e2..1e83ebd6eb83 100644 --- a/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go +++ b/services/storage/mgmt/2019-04-01/storage/storageapi/interfaces.go @@ -47,7 +47,7 @@ type AccountsClientAPI interface { List(ctx context.Context) (result storage.AccountListResultPage, err error) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountSasParameters) (result storage.ListAccountSasResponse, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storage.AccountListResult, err error) - ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountListKeysResult, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string, expand storage.ListKeyExpand) (result storage.AccountListKeysResult, err error) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters storage.ServiceSasParameters) (result storage.ListServiceSasResponse, err error) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey storage.AccountRegenerateKeyParameters) (result storage.AccountListKeysResult, err error) RevokeUserDelegationKeys(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error)