From 639c0a37a7655eb72b416ad86ee9521559304f83 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Nov 2018 07:37:05 -0800 Subject: [PATCH] Generated from 1f26996e492bf786c2acd06e0a4e46159c52df70 (#3289) Adds storage account quick failover API --- .../2017-03-09/network/mgmt/network/models.go | 7 -- .../latest/network/mgmt/network/models.go | 7 -- .../preview/network/mgmt/network/models.go | 7 -- .../preview/network/mgmt/network/models.go | 7 -- .../preview/storage/mgmt/storage/models.go | 1 + .../mgmt/2015-05-01-preview/storage/models.go | 10 ++ .../storage/storageapi/interfaces.go | 46 +++++++++ .../storage/storageapi/interfaces.go | 84 ++++++++++++++++ .../storage/storageapi/interfaces.go | 46 +++++++++ .../storage/storageapi/interfaces.go | 46 +++++++++ .../storage/storageapi/interfaces.go | 48 +++++++++ .../storage/storageapi/interfaces.go | 48 +++++++++ .../storage/storageapi/interfaces.go | 62 ++++++++++++ .../storage/storageapi/interfaces.go | 62 ++++++++++++ .../storage/storageapi/interfaces.go | 81 +++++++++++++++ .../mgmt/2018-07-01/storage/accounts.go | 93 ++++++++++++++++++ .../storage/mgmt/2018-07-01/storage/models.go | 25 +++++ .../storage/storageapi/interfaces.go | 98 +++++++++++++++++++ 18 files changed, 750 insertions(+), 28 deletions(-) create mode 100644 services/preview/storage/mgmt/2015-05-01-preview/storage/storageapi/interfaces.go create mode 100644 services/preview/storage/mgmt/2018-03-01-preview/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2015-06-15/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2016-01-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2016-05-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2016-12-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2017-06-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2017-10-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2018-02-01/storage/storageapi/interfaces.go create mode 100644 services/storage/mgmt/2018-07-01/storage/storageapi/interfaces.go diff --git a/profiles/2017-03-09/network/mgmt/network/models.go b/profiles/2017-03-09/network/mgmt/network/models.go index 896f18980ee8..e0088ddbb392 100644 --- a/profiles/2017-03-09/network/mgmt/network/models.go +++ b/profiles/2017-03-09/network/mgmt/network/models.go @@ -32,7 +32,6 @@ type ExpressRouteCircuitAuthorizationsClient = original.ExpressRouteCircuitAutho type ExpressRouteCircuitPeeringsClient = original.ExpressRouteCircuitPeeringsClient type ExpressRouteCircuitsClient = original.ExpressRouteCircuitsClient type ExpressRouteServiceProvidersClient = original.ExpressRouteServiceProvidersClient -type InterfacesClient = original.InterfacesClient type LoadBalancersClient = original.LoadBalancersClient type LocalNetworkGatewaysClient = original.LocalNetworkGatewaysClient type ApplicationGatewayCookieBasedAffinity = original.ApplicationGatewayCookieBasedAffinity @@ -513,12 +512,6 @@ func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteSe func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { return original.NewExpressRouteServiceProvidersClientWithBaseURI(baseURI, subscriptionID) } -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return original.NewInterfacesClient(subscriptionID) -} -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return original.NewInterfacesClientWithBaseURI(baseURI, subscriptionID) -} func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { return original.NewLoadBalancersClient(subscriptionID) } diff --git a/profiles/latest/network/mgmt/network/models.go b/profiles/latest/network/mgmt/network/models.go index 482345fc8e18..6762f83b585e 100644 --- a/profiles/latest/network/mgmt/network/models.go +++ b/profiles/latest/network/mgmt/network/models.go @@ -40,7 +40,6 @@ type ExpressRouteServiceProvidersClient = original.ExpressRouteServiceProvidersC type InboundNatRulesClient = original.InboundNatRulesClient type InterfaceIPConfigurationsClient = original.InterfaceIPConfigurationsClient type InterfaceLoadBalancersClient = original.InterfaceLoadBalancersClient -type InterfacesClient = original.InterfacesClient type LoadBalancerBackendAddressPoolsClient = original.LoadBalancerBackendAddressPoolsClient type LoadBalancerFrontendIPConfigurationsClient = original.LoadBalancerFrontendIPConfigurationsClient type LoadBalancerLoadBalancingRulesClient = original.LoadBalancerLoadBalancingRulesClient @@ -1180,12 +1179,6 @@ func NewInterfaceLoadBalancersClient(subscriptionID string) InterfaceLoadBalance func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) InterfaceLoadBalancersClient { return original.NewInterfaceLoadBalancersClientWithBaseURI(baseURI, subscriptionID) } -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return original.NewInterfacesClient(subscriptionID) -} -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return original.NewInterfacesClientWithBaseURI(baseURI, subscriptionID) -} func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string) LoadBalancerBackendAddressPoolsClient { return original.NewLoadBalancerBackendAddressPoolsClient(subscriptionID) } diff --git a/profiles/preview/network/mgmt/network/models.go b/profiles/preview/network/mgmt/network/models.go index f0a8c69de982..9e8622d8222e 100644 --- a/profiles/preview/network/mgmt/network/models.go +++ b/profiles/preview/network/mgmt/network/models.go @@ -55,7 +55,6 @@ type InboundNatRulesClient = original.InboundNatRulesClient type InterfaceEndpointsClient = original.InterfaceEndpointsClient type InterfaceIPConfigurationsClient = original.InterfaceIPConfigurationsClient type InterfaceLoadBalancersClient = original.InterfaceLoadBalancersClient -type InterfacesClient = original.InterfacesClient type InterfaceTapConfigurationsClient = original.InterfaceTapConfigurationsClient type LoadBalancerBackendAddressPoolsClient = original.LoadBalancerBackendAddressPoolsClient type LoadBalancerFrontendIPConfigurationsClient = original.LoadBalancerFrontendIPConfigurationsClient @@ -1765,12 +1764,6 @@ func NewInterfaceLoadBalancersClient(subscriptionID string) InterfaceLoadBalance func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) InterfaceLoadBalancersClient { return original.NewInterfaceLoadBalancersClientWithBaseURI(baseURI, subscriptionID) } -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return original.NewInterfacesClient(subscriptionID) -} -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return original.NewInterfacesClientWithBaseURI(baseURI, subscriptionID) -} func NewInterfaceTapConfigurationsClient(subscriptionID string) InterfaceTapConfigurationsClient { return original.NewInterfaceTapConfigurationsClient(subscriptionID) } diff --git a/profiles/preview/preview/network/mgmt/network/models.go b/profiles/preview/preview/network/mgmt/network/models.go index a3ecb2be065b..53406eeb1fc5 100644 --- a/profiles/preview/preview/network/mgmt/network/models.go +++ b/profiles/preview/preview/network/mgmt/network/models.go @@ -32,7 +32,6 @@ type ExpressRouteCircuitAuthorizationsClient = original.ExpressRouteCircuitAutho type ExpressRouteCircuitPeeringsClient = original.ExpressRouteCircuitPeeringsClient type ExpressRouteCircuitsClient = original.ExpressRouteCircuitsClient type ExpressRouteServiceProvidersClient = original.ExpressRouteServiceProvidersClient -type InterfacesClient = original.InterfacesClient type LoadBalancersClient = original.LoadBalancersClient type LocalNetworkGatewaysClient = original.LocalNetworkGatewaysClient type ApplicationGatewayCookieBasedAffinity = original.ApplicationGatewayCookieBasedAffinity @@ -471,12 +470,6 @@ func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteSe func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { return original.NewExpressRouteServiceProvidersClientWithBaseURI(baseURI, subscriptionID) } -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return original.NewInterfacesClient(subscriptionID) -} -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return original.NewInterfacesClientWithBaseURI(baseURI, subscriptionID) -} func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { return original.NewLoadBalancersClient(subscriptionID) } diff --git a/profiles/preview/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go index a0596ef2697f..8f4174450a8b 100644 --- a/profiles/preview/storage/mgmt/storage/models.go +++ b/profiles/preview/storage/mgmt/storage/models.go @@ -259,6 +259,7 @@ type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParamet type AccountRegenerateKeyParameters = original.AccountRegenerateKeyParameters type AccountSasParameters = original.AccountSasParameters type AccountsCreateFuture = original.AccountsCreateFuture +type AccountsFailoverFuture = original.AccountsFailoverFuture type AccountUpdateParameters = original.AccountUpdateParameters type AzureEntityResource = original.AzureEntityResource type BlobContainer = original.BlobContainer diff --git a/services/preview/storage/mgmt/2015-05-01-preview/storage/models.go b/services/preview/storage/mgmt/2015-05-01-preview/storage/models.go index e668c7bf4cae..29134ce62a9a 100644 --- a/services/preview/storage/mgmt/2015-05-01-preview/storage/models.go +++ b/services/preview/storage/mgmt/2015-05-01-preview/storage/models.go @@ -436,6 +436,11 @@ func (iter AccountListResultIterator) Value() Account { return iter.page.Values()[iter.i] } +// Creates a new instance of the AccountListResultIterator type. +func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { + return AccountListResultIterator{page: page} +} + // IsEmpty returns true if the ListResult contains no values. func (alr AccountListResult) IsEmpty() bool { return alr.Value == nil || len(*alr.Value) == 0 @@ -505,6 +510,11 @@ func (page AccountListResultPage) Values() []Account { return *page.alr.Value } +// Creates a new instance of the AccountListResultPage type. +func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return AccountListResultPage{fn: getNextPage} +} + // AccountProperties ... type AccountProperties struct { // ProvisioningState - Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' diff --git a/services/preview/storage/mgmt/2015-05-01-preview/storage/storageapi/interfaces.go b/services/preview/storage/mgmt/2015-05-01-preview/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..7175f7d682e3 --- /dev/null +++ b/services/preview/storage/mgmt/2015-05-01-preview/storage/storageapi/interfaces.go @@ -0,0 +1,46 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2015-05-01-preview/storage" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResultPage, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storage.AccountListResultPage, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountKeys, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey storage.AccountRegenerateKeyParameters) (result storage.AccountKeys, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/preview/storage/mgmt/2018-03-01-preview/storage/storageapi/interfaces.go b/services/preview/storage/mgmt/2018-03-01-preview/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..f193467daa14 --- /dev/null +++ b/services/preview/storage/mgmt/2018-03-01-preview/storage/storageapi/interfaces.go @@ -0,0 +1,84 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/storage/mgmt/2018-03-01-preview/storage" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storage.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*storage.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storage.SkuListResult, err error) +} + +var _ SkusClientAPI = (*storage.SkusClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + CreateOrUpdateManagementPolicies(ctx context.Context, resourceGroupName string, accountName string, properties storage.ManagementPoliciesRulesSetParameter) (result storage.AccountManagementPolicies, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + DeleteManagementPolicies(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetManagementPolicies(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountManagementPolicies, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) + ListByLocation(ctx context.Context, location string) (result storage.UsageListResult, err error) +} + +var _ UsagesClientAPI = (*storage.UsagesClient)(nil) + +// BlobContainersClientAPI contains the set of methods on the BlobContainersClient type. +type BlobContainersClientAPI interface { + ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) + CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *storage.ImmutabilityPolicy, ifMatch string) (result storage.ImmutabilityPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result autorest.Response, err error) + DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, parameters *storage.ImmutabilityPolicy) (result storage.ImmutabilityPolicy, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result storage.BlobContainer, err error) + GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListContainerItems, err error) + LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) +} + +var _ BlobContainersClientAPI = (*storage.BlobContainersClient)(nil) diff --git a/services/storage/mgmt/2015-06-15/storage/storageapi/interfaces.go b/services/storage/mgmt/2015-06-15/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..fd352a9064ed --- /dev/null +++ b/services/storage/mgmt/2015-06-15/storage/storageapi/interfaces.go @@ -0,0 +1,46 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2015-06-15/storage" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result storage.AccountListResult, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountKeys, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey storage.AccountRegenerateKeyParameters) (result storage.AccountKeys, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2016-01-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2016-01-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..4ad273466a2c --- /dev/null +++ b/services/storage/mgmt/2016-01-01/storage/storageapi/interfaces.go @@ -0,0 +1,46 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2016-01-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey storage.AccountRegenerateKeyParameters) (result storage.AccountListKeysResult, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2016-05-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2016-05-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..30faff0794d3 --- /dev/null +++ b/services/storage/mgmt/2016-05-01/storage/storageapi/interfaces.go @@ -0,0 +1,48 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2016-05-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2016-12-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2016-12-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..13cc5926629f --- /dev/null +++ b/services/storage/mgmt/2016-12-01/storage/storageapi/interfaces.go @@ -0,0 +1,48 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2016-12-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2017-06-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2017-06-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..37b7603a7452 --- /dev/null +++ b/services/storage/mgmt/2017-06-01/storage/storageapi/interfaces.go @@ -0,0 +1,62 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-06-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storage.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*storage.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storage.SkuListResult, err error) +} + +var _ SkusClientAPI = (*storage.SkusClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2017-10-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2017-10-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..5d4046792208 --- /dev/null +++ b/services/storage/mgmt/2017-10-01/storage/storageapi/interfaces.go @@ -0,0 +1,62 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storage.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*storage.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storage.SkuListResult, err error) +} + +var _ SkusClientAPI = (*storage.SkusClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) diff --git a/services/storage/mgmt/2018-02-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2018-02-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..36f12d7f5817 --- /dev/null +++ b/services/storage/mgmt/2018-02-01/storage/storageapi/interfaces.go @@ -0,0 +1,81 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storage.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*storage.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storage.SkuListResult, err error) +} + +var _ SkusClientAPI = (*storage.SkusClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context) (result storage.UsageListResult, err error) + ListByLocation(ctx context.Context, location string) (result storage.UsageListResult, err error) +} + +var _ UsageClientAPI = (*storage.UsageClient)(nil) + +// BlobContainersClientAPI contains the set of methods on the BlobContainersClient type. +type BlobContainersClientAPI interface { + ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) + CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *storage.ImmutabilityPolicy, ifMatch string) (result storage.ImmutabilityPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result autorest.Response, err error) + DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, parameters *storage.ImmutabilityPolicy) (result storage.ImmutabilityPolicy, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result storage.BlobContainer, err error) + GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListContainerItems, err error) + LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) +} + +var _ BlobContainersClientAPI = (*storage.BlobContainersClient)(nil) diff --git a/services/storage/mgmt/2018-07-01/storage/accounts.go b/services/storage/mgmt/2018-07-01/storage/accounts.go index acd52c96d67d..9c5b7669fb60 100644 --- a/services/storage/mgmt/2018-07-01/storage/accounts.go +++ b/services/storage/mgmt/2018-07-01/storage/accounts.go @@ -325,6 +325,99 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore return } +// Failover failover request can be triggered for a storage account in case of availability issues. The failover occurs +// from the storage account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will +// become primary after failover. +// 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) Failover(ctx context.Context, resourceGroupName string, accountName string) (result AccountsFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Failover") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.AccountsClient", "Failover", err.Error()) + } + + req, err := client.FailoverPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", nil, "Failure preparing request") + return + } + + result, err = client.FailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsClient", "Failover", result.Response(), "Failure sending request") + return + } + + return +} + +// FailoverPreparer prepares the Failover request. +func (client AccountsClient) FailoverPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// FailoverSender sends the Failover request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) FailoverSender(req *http.Request) (future AccountsFailoverFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// FailoverResponder handles the response to the Failover request. The method always +// closes the http.Response Body. +func (client AccountsClient) FailoverResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // GetProperties returns the properties for the specified storage account including but not limited to name, SKU name, // location, and account status. The ListKeys operation should be used to retrieve storage keys. // Parameters: diff --git a/services/storage/mgmt/2018-07-01/storage/models.go b/services/storage/mgmt/2018-07-01/storage/models.go index c13258f8841a..19167262be09 100644 --- a/services/storage/mgmt/2018-07-01/storage/models.go +++ b/services/storage/mgmt/2018-07-01/storage/models.go @@ -900,6 +900,8 @@ type AccountProperties struct { NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` + // FailoverInProgress - If the failover is in progress, the value will be true, otherwise, it will be null. + FailoverInProgress *bool `json:"failoverInProgress,omitempty"` } // AccountPropertiesCreateParameters the parameters used to create the storage account. @@ -991,6 +993,29 @@ func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, er return } +// AccountsFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsFailoverFuture) Result(client AccountsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.AccountsFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("storage.AccountsFailoverFuture") + return + } + ar.Response = future.Response() + return +} + // AccountUpdateParameters the parameters that can be provided when updating the storage account // properties. type AccountUpdateParameters struct { diff --git a/services/storage/mgmt/2018-07-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2018-07-01/storage/storageapi/interfaces.go new file mode 100644 index 000000000000..d24731f5f1ac --- /dev/null +++ b/services/storage/mgmt/2018-07-01/storage/storageapi/interfaces.go @@ -0,0 +1,98 @@ +package storageapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result storage.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*storage.OperationsClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context) (result storage.SkuListResult, err error) +} + +var _ SkusClientAPI = (*storage.SkusClient)(nil) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + CheckNameAvailability(ctx context.Context, accountName storage.AccountCheckNameAvailabilityParameters) (result storage.CheckNameAvailabilityResult, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountCreateParameters) (result storage.AccountsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + Failover(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountsFailoverFuture, err error) + GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.Account, err error) + List(ctx context.Context) (result storage.AccountListResult, 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) + 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) + Update(ctx context.Context, resourceGroupName string, accountName string, parameters storage.AccountUpdateParameters) (result storage.Account, err error) +} + +var _ AccountsClientAPI = (*storage.AccountsClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + ListByLocation(ctx context.Context, location string) (result storage.UsageListResult, err error) +} + +var _ UsagesClientAPI = (*storage.UsagesClient)(nil) + +// BlobServicesClientAPI contains the set of methods on the BlobServicesClient type. +type BlobServicesClientAPI interface { + GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.BlobServiceProperties, err error) + SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters storage.BlobServiceProperties) (result storage.BlobServiceProperties, err error) +} + +var _ BlobServicesClientAPI = (*storage.BlobServicesClient)(nil) + +// BlobContainersClientAPI contains the set of methods on the BlobContainersClient type. +type BlobContainersClientAPI interface { + ClearLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Create(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) + CreateOrUpdateImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *storage.ImmutabilityPolicy, ifMatch string) (result storage.ImmutabilityPolicy, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result autorest.Response, err error) + DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, parameters *storage.ImmutabilityPolicy) (result storage.ImmutabilityPolicy, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result storage.BlobContainer, err error) + GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListContainerItems, err error) + LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) + SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) +} + +var _ BlobContainersClientAPI = (*storage.BlobContainersClient)(nil) + +// ManagementPoliciesClientAPI contains the set of methods on the ManagementPoliciesClient type. +type ManagementPoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, properties storage.ManagementPoliciesRulesSetParameter) (result storage.AccountManagementPolicies, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result storage.AccountManagementPolicies, err error) +} + +var _ ManagementPoliciesClientAPI = (*storage.ManagementPoliciesClient)(nil)