Skip to content

Commit

Permalink
[AutoPR] storage/resource-manager (Azure#489)
Browse files Browse the repository at this point in the history
* Generated from 1f26996e492bf786c2acd06e0a4e46159c52df70 (Azure#482)

Adds storage account quick failover API

* Regenerated "@azure/arm-storage" SDK.

* Resolve conflicts
  • Loading branch information
AutorestCI authored and kpajdzik committed Nov 14, 2018
1 parent cd613dc commit b12f707
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/@azure/arm-storage/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2018 Microsoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions packages/@azure/arm-storage/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,13 @@ export interface StorageAccount extends TrackedResource {
* sets to true.
*/
isHnsEnabled?: boolean;
/**
* @member {boolean} [failoverInProgress] If the failover is in progress, the
* value will be true, otherwise, it will be null.
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly failoverInProgress?: boolean;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions packages/@azure/arm-storage/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,13 @@ export const StorageAccount: msRest.CompositeMapper = {
type: {
name: "Boolean"
}
},
failoverInProgress: {
readOnly: true,
serializedName: "properties.failoverInProgress",
type: {
name: "Boolean"
}
}
}
}
Expand Down
64 changes: 64 additions & 0 deletions packages/@azure/arm-storage/lib/operations/storageAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,23 @@ export class StorageAccounts {
callback) as Promise<Models.StorageAccountsListServiceSASResponse>;
}

/**
* 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.
* @param resourceGroupName The name of the resource group within the user's subscription. The name
* is case insensitive.
* @param 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.
* @param [options] The optional parameters
* @returns Promise<msRest.RestResponse>
*/
failover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
return this.beginFailover(resourceGroupName,accountName,options)
.then(lroPoller => lroPoller.pollUntilFinished());
}

/**
* Asynchronously creates a new storage account with the specified parameters. If an account is
* already created and a subsequent create request is issued with different properties, the account
Expand All @@ -471,6 +488,29 @@ export class StorageAccounts {
beginCreateOperationSpec,
options);
}

/**
* 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.
* @param resourceGroupName The name of the resource group within the user's subscription. The name
* is case insensitive.
* @param 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.
* @param [options] The optional parameters
* @returns Promise<msRestAzure.LROPoller>
*/
beginFailover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
return this.client.sendLRORequest(
{
resourceGroupName,
accountName,
options
},
beginFailoverOperationSpec,
options);
}
}

// Operation Specifications
Expand Down Expand Up @@ -790,3 +830,27 @@ const beginCreateOperationSpec: msRest.OperationSpec = {
},
serializer
};

const beginFailoverOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover",
urlParameters: [
Parameters.resourceGroupName,
Parameters.accountName,
Parameters.subscriptionId
],
queryParameters: [
Parameters.apiVersion0
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {},
202: {},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};

0 comments on commit b12f707

Please sign in to comment.