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..cb1e4de4a0bc 100644 --- a/profiles/preview/storage/mgmt/storage/models.go +++ b/profiles/preview/storage/mgmt/storage/models.go @@ -38,6 +38,12 @@ const ( Hot AccessTier = original.Hot ) +type AccountExpand = original.AccountExpand + +const ( + AccountExpandGeoReplicationStats AccountExpand = original.AccountExpandGeoReplicationStats +) + type AccountStatus = original.AccountStatus const ( @@ -67,6 +73,14 @@ const ( DefaultActionDeny DefaultAction = original.DefaultActionDeny ) +type GeoReplicationStatus = original.GeoReplicationStatus + +const ( + GeoReplicationStatusBootstrap GeoReplicationStatus = original.GeoReplicationStatusBootstrap + GeoReplicationStatusLive GeoReplicationStatus = original.GeoReplicationStatusLive + GeoReplicationStatusUnavailable GeoReplicationStatus = original.GeoReplicationStatusUnavailable +) + type HTTPProtocol = original.HTTPProtocol const ( @@ -259,6 +273,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 @@ -275,6 +290,7 @@ type Encryption = original.Encryption type EncryptionService = original.EncryptionService type EncryptionServices = original.EncryptionServices type Endpoints = original.Endpoints +type GeoReplicationStats = original.GeoReplicationStats type Identity = original.Identity type ImmutabilityPolicy = original.ImmutabilityPolicy type ImmutabilityPolicyProperties = original.ImmutabilityPolicyProperties @@ -347,6 +363,9 @@ func NewManagementPoliciesClientWithBaseURI(baseURI string, subscriptionID strin func PossibleAccessTierValues() []AccessTier { return original.PossibleAccessTierValues() } +func PossibleAccountExpandValues() []AccountExpand { + return original.PossibleAccountExpandValues() +} func PossibleAccountStatusValues() []AccountStatus { return original.PossibleAccountStatusValues() } @@ -359,6 +378,9 @@ func PossibleBypassValues() []Bypass { func PossibleDefaultActionValues() []DefaultAction { return original.PossibleDefaultActionValues() } +func PossibleGeoReplicationStatusValues() []GeoReplicationStatus { + return original.PossibleGeoReplicationStatusValues() +} func PossibleHTTPProtocolValues() []HTTPProtocol { return original.PossibleHTTPProtocolValues() } 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..291c27699ae5 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: @@ -332,7 +425,9 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore // 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) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { +// expand - may be used to expand the properties within account's properties. By default, data is not included +// when fecthing properties. Currently we only support geoReplicationStats. +func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string, expand AccountExpand) (result Account, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.GetProperties") defer func() { @@ -356,7 +451,7 @@ func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupNam return result, validation.NewError("storage.AccountsClient", "GetProperties", err.Error()) } - req, err := client.GetPropertiesPreparer(ctx, resourceGroupName, accountName) + req, err := client.GetPropertiesPreparer(ctx, resourceGroupName, accountName, expand) if err != nil { err = autorest.NewErrorWithError(err, "storage.AccountsClient", "GetProperties", nil, "Failure preparing request") return @@ -378,7 +473,7 @@ func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupNam } // GetPropertiesPreparer prepares the GetProperties request. -func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { +func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, expand AccountExpand) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -389,6 +484,9 @@ func (client AccountsClient) GetPropertiesPreparer(ctx context.Context, resource queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/services/storage/mgmt/2018-07-01/storage/models.go b/services/storage/mgmt/2018-07-01/storage/models.go index c13258f8841a..3559bf11d82c 100644 --- a/services/storage/mgmt/2018-07-01/storage/models.go +++ b/services/storage/mgmt/2018-07-01/storage/models.go @@ -43,6 +43,19 @@ func PossibleAccessTierValues() []AccessTier { return []AccessTier{Cool, Hot} } +// AccountExpand enumerates the values for account expand. +type AccountExpand string + +const ( + // AccountExpandGeoReplicationStats ... + AccountExpandGeoReplicationStats AccountExpand = "geoReplicationStats" +) + +// PossibleAccountExpandValues returns an array of possible values for the AccountExpand const type. +func PossibleAccountExpandValues() []AccountExpand { + return []AccountExpand{AccountExpandGeoReplicationStats} +} + // AccountStatus enumerates the values for account status. type AccountStatus string @@ -105,6 +118,23 @@ func PossibleDefaultActionValues() []DefaultAction { return []DefaultAction{DefaultActionAllow, DefaultActionDeny} } +// GeoReplicationStatus enumerates the values for geo replication status. +type GeoReplicationStatus string + +const ( + // GeoReplicationStatusBootstrap ... + GeoReplicationStatusBootstrap GeoReplicationStatus = "Bootstrap" + // GeoReplicationStatusLive ... + GeoReplicationStatusLive GeoReplicationStatus = "Live" + // GeoReplicationStatusUnavailable ... + GeoReplicationStatusUnavailable GeoReplicationStatus = "Unavailable" +) + +// PossibleGeoReplicationStatusValues returns an array of possible values for the GeoReplicationStatus const type. +func PossibleGeoReplicationStatusValues() []GeoReplicationStatus { + return []GeoReplicationStatus{GeoReplicationStatusBootstrap, GeoReplicationStatusLive, GeoReplicationStatusUnavailable} +} + // HTTPProtocol enumerates the values for http protocol. type HTTPProtocol string @@ -900,6 +930,10 @@ type AccountProperties struct { NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` + // GeoReplicationStats - Geo Replication Stats + GeoReplicationStats *GeoReplicationStats `json:"geoReplicationStats,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 +1025,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 { @@ -1449,6 +1506,15 @@ type Endpoints struct { Dfs *string `json:"dfs,omitempty"` } +// GeoReplicationStats statistics related to replication for storage account's Blob, Table, Queue and File +// services. It is only available when geo-redundant replication is enabled for the storage account. +type GeoReplicationStats struct { + // Status - The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable. Possible values include: 'GeoReplicationStatusLive', 'GeoReplicationStatusBootstrap', 'GeoReplicationStatusUnavailable' + Status GeoReplicationStatus `json:"status,omitempty"` + // LastSyncTime - All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap. + LastSyncTime *date.Time `json:"lastSyncTime,omitempty"` +} + // Identity identity for the resource. type Identity struct { // PrincipalID - The principal ID of resource identity. 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..d6580f7b9749 --- /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, expand AccountExpand) (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)