diff --git a/packages/@azure/arm-storage/LICENSE.txt b/packages/@azure/arm-storage/LICENSE.txt index a70e8cf66038..5431ba98b936 100644 --- a/packages/@azure/arm-storage/LICENSE.txt +++ b/packages/@azure/arm-storage/LICENSE.txt @@ -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. diff --git a/packages/@azure/arm-storage/README.md b/packages/@azure/arm-storage/README.md index 7e4ffefa24c4..f10ebf52b56d 100644 --- a/packages/@azure/arm-storage/README.md +++ b/packages/@azure/arm-storage/README.md @@ -1,77 +1,77 @@ -# Azure StorageManagementClient SDK for JavaScript -This package contains an isomorphic SDK for StorageManagementClient. - -## Currently supported environments -- Node.js version 6.x.x or higher -- Browser JavaScript - -## How to Install -``` -npm install @azure/arm-storage -``` - - -## How to use - -### nodejs - Authentication, client creation and list operations as an example written in TypeScript. - -```ts -import * as msRest from "ms-rest-js"; -import * as msRestAzure from "ms-rest-azure-js"; -import * as msRestNodeAuth from "ms-rest-nodeauth"; -import { StorageManagementClient, StorageManagementModels, StorageManagementMappers } from "@azure/arm-storage"; -const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; - -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new StorageManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.error(err); -}); -``` - -### browser - Authentication, client creation and list operations as an example written in JavaScript. -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - -- index.html -```html - - - - @azure/arm-storage sample - - - - - - - - - -``` - -# Related projects - - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) +# Azure StorageManagementClient SDK for JavaScript +This package contains an isomorphic SDK for StorageManagementClient. + +## Currently supported environments +- Node.js version 6.x.x or higher +- Browser JavaScript + +## How to Install +``` +npm install @azure/arm-storage +``` + + +## How to use + +### nodejs - Authentication, client creation and list operations as an example written in TypeScript. + +```ts +import * as msRest from "ms-rest-js"; +import * as msRestAzure from "ms-rest-azure-js"; +import * as msRestNodeAuth from "ms-rest-nodeauth"; +import { StorageManagementClient, StorageManagementModels, StorageManagementMappers } from "@azure/arm-storage"; +const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; + +msRestNodeAuth.interactiveLogin().then((creds) => { + const client = new StorageManagementClient(creds, subscriptionId); + client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.error(err); +}); +``` + +### browser - Authentication, client creation and list operations as an example written in JavaScript. +See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. + +- index.html +```html + + + + @azure/arm-storage sample + + + + + + + + + +``` + +# Related projects + - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) diff --git a/packages/@azure/arm-storage/lib/models/index.ts b/packages/@azure/arm-storage/lib/models/index.ts index e1a99b5055bf..ba592f5d3c06 100644 --- a/packages/@azure/arm-storage/lib/models/index.ts +++ b/packages/@azure/arm-storage/lib/models/index.ts @@ -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; } /** @@ -1995,33 +2002,19 @@ export interface UsageListResult extends Array { /** * Defines values for ReasonCode. * Possible values include: 'QuotaId', 'NotAvailableForSubscription' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: ReasonCode = "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum ReasonCode { - QuotaId = 'QuotaId', - NotAvailableForSubscription = 'NotAvailableForSubscription', -} +export type ReasonCode = 'QuotaId' | 'NotAvailableForSubscription'; /** * Defines values for SkuName. - * Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', - * 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' + * Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', + * 'Premium_LRS', 'Premium_ZRS' * @readonly * @enum {string} */ -export enum SkuName { - StandardLRS = 'Standard_LRS', - StandardGRS = 'Standard_GRS', - StandardRAGRS = 'Standard_RAGRS', - StandardZRS = 'Standard_ZRS', - PremiumLRS = 'Premium_LRS', - PremiumZRS = 'Premium_ZRS', -} +export type SkuName = 'Standard_LRS' | 'Standard_GRS' | 'Standard_RAGRS' | 'Standard_ZRS' | 'Premium_LRS' | 'Premium_ZRS'; /** * Defines values for SkuTier. @@ -2029,25 +2022,16 @@ export enum SkuName { * @readonly * @enum {string} */ -export enum SkuTier { - Standard = 'Standard', - Premium = 'Premium', -} +export type SkuTier = 'Standard' | 'Premium'; /** * Defines values for Kind. - * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', - * 'FileStorage', 'BlockBlobStorage' + * Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', + * 'BlockBlobStorage' * @readonly * @enum {string} */ -export enum Kind { - Storage = 'Storage', - StorageV2 = 'StorageV2', - BlobStorage = 'BlobStorage', - FileStorage = 'FileStorage', - BlockBlobStorage = 'BlockBlobStorage', -} +export type Kind = 'Storage' | 'StorageV2' | 'BlobStorage' | 'FileStorage' | 'BlockBlobStorage'; /** * Defines values for Reason. @@ -2055,25 +2039,15 @@ export enum Kind { * @readonly * @enum {string} */ -export enum Reason { - AccountNameInvalid = 'AccountNameInvalid', - AlreadyExists = 'AlreadyExists', -} +export type Reason = 'AccountNameInvalid' | 'AlreadyExists'; /** * Defines values for KeySource. * Possible values include: 'Microsoft.Storage', 'Microsoft.Keyvault' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: KeySource = "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum KeySource { - MicrosoftStorage = 'Microsoft.Storage', - MicrosoftKeyvault = 'Microsoft.Keyvault', -} +export type KeySource = 'Microsoft.Storage' | 'Microsoft.Keyvault'; /** * Defines values for Action. @@ -2081,41 +2055,24 @@ export enum KeySource { * @readonly * @enum {string} */ -export enum Action { - Allow = 'Allow', -} +export type Action = 'Allow'; /** * Defines values for State. - * Possible values include: 'provisioning', 'deprovisioning', 'succeeded', - * 'failed', 'networkSourceDeleted' + * Possible values include: 'provisioning', 'deprovisioning', 'succeeded', 'failed', + * 'networkSourceDeleted' * @readonly * @enum {string} */ -export enum State { - Provisioning = 'provisioning', - Deprovisioning = 'deprovisioning', - Succeeded = 'succeeded', - Failed = 'failed', - NetworkSourceDeleted = 'networkSourceDeleted', -} +export type State = 'provisioning' | 'deprovisioning' | 'succeeded' | 'failed' | 'networkSourceDeleted'; /** * Defines values for Bypass. * Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: Bypass = "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum Bypass { - None = 'None', - Logging = 'Logging', - Metrics = 'Metrics', - AzureServices = 'AzureServices', -} +export type Bypass = 'None' | 'Logging' | 'Metrics' | 'AzureServices'; /** * Defines values for DefaultAction. @@ -2123,10 +2080,7 @@ export enum Bypass { * @readonly * @enum {string} */ -export enum DefaultAction { - Allow = 'Allow', - Deny = 'Deny', -} +export type DefaultAction = 'Allow' | 'Deny'; /** * Defines values for AccessTier. @@ -2134,10 +2088,7 @@ export enum DefaultAction { * @readonly * @enum {string} */ -export enum AccessTier { - Hot = 'Hot', - Cool = 'Cool', -} +export type AccessTier = 'Hot' | 'Cool'; /** * Defines values for ProvisioningState. @@ -2145,11 +2096,7 @@ export enum AccessTier { * @readonly * @enum {string} */ -export enum ProvisioningState { - Creating = 'Creating', - ResolvingDNS = 'ResolvingDNS', - Succeeded = 'Succeeded', -} +export type ProvisioningState = 'Creating' | 'ResolvingDNS' | 'Succeeded'; /** * Defines values for AccountStatus. @@ -2157,10 +2104,7 @@ export enum ProvisioningState { * @readonly * @enum {string} */ -export enum AccountStatus { - Available = 'available', - Unavailable = 'unavailable', -} +export type AccountStatus = 'available' | 'unavailable'; /** * Defines values for KeyPermission. @@ -2168,82 +2112,40 @@ export enum AccountStatus { * @readonly * @enum {string} */ -export enum KeyPermission { - Read = 'Read', - Full = 'Full', -} +export type KeyPermission = 'Read' | 'Full'; /** * Defines values for UsageUnit. - * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', - * 'CountsPerSecond', 'BytesPerSecond' + * Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', + * 'BytesPerSecond' * @readonly * @enum {string} */ -export enum UsageUnit { - Count = 'Count', - Bytes = 'Bytes', - Seconds = 'Seconds', - Percent = 'Percent', - CountsPerSecond = 'CountsPerSecond', - BytesPerSecond = 'BytesPerSecond', -} +export type UsageUnit = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountsPerSecond' | 'BytesPerSecond'; /** * Defines values for Services. * Possible values include: 'b', 'q', 't', 'f' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: Services = "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum Services { - B = 'b', - Q = 'q', - T = 't', - F = 'f', -} +export type Services = 'b' | 'q' | 't' | 'f'; /** * Defines values for SignedResourceTypes. * Possible values include: 's', 'c', 'o' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: SignedResourceTypes = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum SignedResourceTypes { - S = 's', - C = 'c', - O = 'o', -} +export type SignedResourceTypes = 's' | 'c' | 'o'; /** * Defines values for Permissions. * Possible values include: 'r', 'd', 'w', 'l', 'a', 'c', 'u', 'p' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: Permissions = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum Permissions { - R = 'r', - D = 'd', - W = 'w', - L = 'l', - A = 'a', - C = 'c', - U = 'u', - P = 'p', -} +export type Permissions = 'r' | 'd' | 'w' | 'l' | 'a' | 'c' | 'u' | 'p'; /** * Defines values for HttpProtocol. @@ -2251,28 +2153,15 @@ export enum Permissions { * @readonly * @enum {string} */ -export enum HttpProtocol { - Httpshttp = 'https,http', - Https = 'https', -} +export type HttpProtocol = 'https,http' | 'https'; /** * Defines values for SignedResource. * Possible values include: 'b', 'c', 'f', 's' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: SignedResource = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum SignedResource { - B = 'b', - C = 'c', - F = 'f', - S = 's', -} +export type SignedResource = 'b' | 'c' | 'f' | 's'; /** * Defines values for PublicAccess. @@ -2280,95 +2169,47 @@ export enum SignedResource { * @readonly * @enum {string} */ -export enum PublicAccess { - Container = 'Container', - Blob = 'Blob', - None = 'None', -} +export type PublicAccess = 'Container' | 'Blob' | 'None'; /** * Defines values for LeaseStatus. * Possible values include: 'Locked', 'Unlocked' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: LeaseStatus = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum LeaseStatus { - Locked = 'Locked', - Unlocked = 'Unlocked', -} +export type LeaseStatus = 'Locked' | 'Unlocked'; /** * Defines values for LeaseState. - * Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', - * 'Broken' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: LeaseState = "someUnknownValueThatWillStillBeValid"; + * Possible values include: 'Available', 'Leased', 'Expired', 'Breaking', 'Broken' * @readonly * @enum {string} */ -export enum LeaseState { - Available = 'Available', - Leased = 'Leased', - Expired = 'Expired', - Breaking = 'Breaking', - Broken = 'Broken', -} +export type LeaseState = 'Available' | 'Leased' | 'Expired' | 'Breaking' | 'Broken'; /** * Defines values for LeaseDuration. * Possible values include: 'Infinite', 'Fixed' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: LeaseDuration = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum LeaseDuration { - Infinite = 'Infinite', - Fixed = 'Fixed', -} +export type LeaseDuration = 'Infinite' | 'Fixed'; /** * Defines values for ImmutabilityPolicyState. * Possible values include: 'Locked', 'Unlocked' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: ImmutabilityPolicyState = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum ImmutabilityPolicyState { - Locked = 'Locked', - Unlocked = 'Unlocked', -} +export type ImmutabilityPolicyState = 'Locked' | 'Unlocked'; /** * Defines values for ImmutabilityPolicyUpdateType. * Possible values include: 'put', 'lock', 'extend' - * There could be more values for this enum apart from the ones defined here.If - * you want to set a value that is not from the known values then you can do - * the following: - * let param: ImmutabilityPolicyUpdateType = - * "someUnknownValueThatWillStillBeValid"; * @readonly * @enum {string} */ -export enum ImmutabilityPolicyUpdateType { - Put = 'put', - Lock = 'lock', - Extend = 'extend', -} +export type ImmutabilityPolicyUpdateType = 'put' | 'lock' | 'extend'; /** * Contains response data for the list operation. diff --git a/packages/@azure/arm-storage/lib/models/mappers.ts b/packages/@azure/arm-storage/lib/models/mappers.ts index 08bb747f0fb1..140e9a6f56d2 100644 --- a/packages/@azure/arm-storage/lib/models/mappers.ts +++ b/packages/@azure/arm-storage/lib/models/mappers.ts @@ -1095,6 +1095,13 @@ export const StorageAccount: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + failoverInProgress: { + readOnly: true, + serializedName: "properties.failoverInProgress", + type: { + name: "Boolean" + } } } } diff --git a/packages/@azure/arm-storage/lib/operations/blobContainers.ts b/packages/@azure/arm-storage/lib/operations/blobContainers.ts index ee1db28141c7..ff315c79a6b2 100644 --- a/packages/@azure/arm-storage/lib/operations/blobContainers.ts +++ b/packages/@azure/arm-storage/lib/operations/blobContainers.ts @@ -57,7 +57,7 @@ export class BlobContainers { * @param callback The callback */ list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -112,7 +112,7 @@ export class BlobContainers { * @param callback The callback */ create(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersCreateOptionalParams, callback: msRest.ServiceCallback): void; - create(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOptionalParams, callback?: msRest.ServiceCallback): Promise { + create(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersCreateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -167,7 +167,7 @@ export class BlobContainers { * @param callback The callback */ update(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersUpdateOptionalParams, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersUpdateOptionalParams, callback?: msRest.ServiceCallback): Promise { + update(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -221,7 +221,7 @@ export class BlobContainers { * @param callback The callback */ get(resourceGroupName: string, accountName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + get(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -275,7 +275,7 @@ export class BlobContainers { * @param callback The callback */ deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + deleteMethod(resourceGroupName: string, accountName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -337,7 +337,7 @@ export class BlobContainers { * @param callback The callback */ setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + setLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -399,7 +399,7 @@ export class BlobContainers { * @param callback The callback */ clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + clearLegalHold(resourceGroupName: string, accountName: string, containerName: string, tags: string[], options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -461,7 +461,7 @@ export class BlobContainers { * @param callback The callback */ createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams, callback?: msRest.ServiceCallback): Promise { + createOrUpdateImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, immutabilityPeriodSinceCreationInDays: number, options?: Models.BlobContainersCreateOrUpdateImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -517,7 +517,7 @@ export class BlobContainers { * @param callback The callback */ getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options: Models.BlobContainersGetImmutabilityPolicyOptionalParams, callback: msRest.ServiceCallback): void; - getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersGetImmutabilityPolicyOptionalParams, callback?: msRest.ServiceCallback): Promise { + getImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, options?: Models.BlobContainersGetImmutabilityPolicyOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -583,7 +583,7 @@ export class BlobContainers { * @param callback The callback */ deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + deleteImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -648,7 +648,7 @@ export class BlobContainers { * @param callback The callback */ lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + lockImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -720,7 +720,7 @@ export class BlobContainers { * @param callback The callback */ extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, diff --git a/packages/@azure/arm-storage/lib/operations/blobServices.ts b/packages/@azure/arm-storage/lib/operations/blobServices.ts index 6635c25a2d5f..e5ea63a7a1fd 100644 --- a/packages/@azure/arm-storage/lib/operations/blobServices.ts +++ b/packages/@azure/arm-storage/lib/operations/blobServices.ts @@ -63,7 +63,7 @@ export class BlobServices { * @param callback The callback */ setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -106,7 +106,7 @@ export class BlobServices { * @param callback The callback */ getServiceProperties(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, diff --git a/packages/@azure/arm-storage/lib/operations/managementPolicies.ts b/packages/@azure/arm-storage/lib/operations/managementPolicies.ts index 24b1374190a3..d33ded1b53ee 100644 --- a/packages/@azure/arm-storage/lib/operations/managementPolicies.ts +++ b/packages/@azure/arm-storage/lib/operations/managementPolicies.ts @@ -56,7 +56,7 @@ export class ManagementPolicies { * @param callback The callback */ get(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -97,7 +97,7 @@ export class ManagementPolicies { * @param callback The callback */ createOrUpdate(resourceGroupName: string, accountName: string, options: Models.ManagementPoliciesCreateOrUpdateOptionalParams, callback: msRest.ServiceCallback): void; - createOrUpdate(resourceGroupName: string, accountName: string, options?: Models.ManagementPoliciesCreateOrUpdateOptionalParams, callback?: msRest.ServiceCallback): Promise { + createOrUpdate(resourceGroupName: string, accountName: string, options?: Models.ManagementPoliciesCreateOrUpdateOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -138,7 +138,7 @@ export class ManagementPolicies { * @param callback The callback */ deleteMethod(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, diff --git a/packages/@azure/arm-storage/lib/operations/operations.ts b/packages/@azure/arm-storage/lib/operations/operations.ts index edf731229cfa..3f4884c07d49 100644 --- a/packages/@azure/arm-storage/lib/operations/operations.ts +++ b/packages/@azure/arm-storage/lib/operations/operations.ts @@ -41,7 +41,7 @@ export class Operations { * @param callback The callback */ list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options diff --git a/packages/@azure/arm-storage/lib/operations/skus.ts b/packages/@azure/arm-storage/lib/operations/skus.ts index ddbdf9774b99..390819668aa6 100644 --- a/packages/@azure/arm-storage/lib/operations/skus.ts +++ b/packages/@azure/arm-storage/lib/operations/skus.ts @@ -41,7 +41,7 @@ export class Skus { * @param callback The callback */ list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options diff --git a/packages/@azure/arm-storage/lib/operations/storageAccounts.ts b/packages/@azure/arm-storage/lib/operations/storageAccounts.ts index 6d4db740fad9..ac8bfb45882c 100644 --- a/packages/@azure/arm-storage/lib/operations/storageAccounts.ts +++ b/packages/@azure/arm-storage/lib/operations/storageAccounts.ts @@ -45,7 +45,7 @@ export class StorageAccounts { * @param callback The callback */ checkNameAvailability(name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - checkNameAvailability(name: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + checkNameAvailability(name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { name, @@ -104,7 +104,7 @@ export class StorageAccounts { * @param callback The callback */ deleteMethod(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -147,7 +147,7 @@ export class StorageAccounts { * @param callback The callback */ getProperties(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - getProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + getProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -198,7 +198,7 @@ export class StorageAccounts { * @param callback The callback */ update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + update(resourceGroupName: string, accountName: string, parameters: Models.StorageAccountUpdateParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -226,7 +226,7 @@ export class StorageAccounts { * @param callback The callback */ list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - list(options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options @@ -257,7 +257,7 @@ export class StorageAccounts { * @param callback The callback */ listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -297,7 +297,7 @@ export class StorageAccounts { * @param callback The callback */ listKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -344,7 +344,7 @@ export class StorageAccounts { * @param callback The callback */ regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + regenerateKey(resourceGroupName: string, accountName: string, keyName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -389,7 +389,7 @@ export class StorageAccounts { * @param callback The callback */ listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + listAccountSAS(resourceGroupName: string, accountName: string, parameters: Models.AccountSasParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -434,7 +434,7 @@ export class StorageAccounts { * @param callback The callback */ listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + listServiceSAS(resourceGroupName: string, accountName: string, parameters: Models.ServiceSasParameters, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -446,6 +446,23 @@ export class StorageAccounts { callback) as Promise; } + /** + * 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 + */ + failover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + 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 @@ -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 + */ + beginFailover(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + accountName, + options + }, + beginFailoverOperationSpec, + options); + } } // Operation Specifications @@ -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 +}; diff --git a/packages/@azure/arm-storage/lib/operations/usages.ts b/packages/@azure/arm-storage/lib/operations/usages.ts index 6bb918e9efa5..07496c549923 100644 --- a/packages/@azure/arm-storage/lib/operations/usages.ts +++ b/packages/@azure/arm-storage/lib/operations/usages.ts @@ -45,7 +45,7 @@ export class Usages { * @param callback The callback */ listByLocation(location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - listByLocation(location: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback): Promise { + listByLocation(location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, diff --git a/packages/@azure/arm-storage/lib/storageManagementClientContext.ts b/packages/@azure/arm-storage/lib/storageManagementClientContext.ts index 1e77a264d69d..5a77743b13b5 100644 --- a/packages/@azure/arm-storage/lib/storageManagementClientContext.ts +++ b/packages/@azure/arm-storage/lib/storageManagementClientContext.ts @@ -13,7 +13,7 @@ import * as msRest from "ms-rest-js"; import * as msRestAzure from "ms-rest-azure-js"; const packageName = "@azure/arm-storage"; -const packageVersion = "1.0.0-preview"; +const packageVersion = "0.1.0"; export class StorageManagementClientContext extends msRestAzure.AzureServiceClient { credentials: msRest.ServiceClientCredentials; @@ -36,6 +36,11 @@ export class StorageManagementClientContext extends msRestAzure.AzureServiceClie if (!options) { options = {}; } + if(!options.userAgent) { + const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + super(credentials, options); this.acceptLanguage = 'en-US'; @@ -45,7 +50,6 @@ export class StorageManagementClientContext extends msRestAzure.AzureServiceClie this.credentials = credentials; this.subscriptionId = subscriptionId; - this.addUserAgentInfo(`${packageName}/${packageVersion}`); if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } diff --git a/packages/@azure/arm-storage/package.json b/packages/@azure/arm-storage/package.json index 2f19c2b59418..d82d41a84a6a 100644 --- a/packages/@azure/arm-storage/package.json +++ b/packages/@azure/arm-storage/package.json @@ -4,8 +4,8 @@ "description": "StorageManagementClient Library with typescript type definitions for node.js and browser.", "version": "0.1.0", "dependencies": { - "ms-rest-azure-js": "^1.0.176", - "ms-rest-js": "^1.0.455", + "ms-rest-azure-js": "^1.0.181", + "ms-rest-js": "^1.0.460", "tslib": "^1.9.3" }, "keywords": [ @@ -52,4 +52,4 @@ "prepack": "npm install && npm run build" }, "sideEffects": false -} \ No newline at end of file +}