Generate azure-arm-storage package (#5077)

* Generate azure-arm-storage package

* Bump the version
This commit is contained in:
Kamil Pajdzik 2019-04-30 14:33:46 -07:00 коммит произвёл GitHub
Родитель 943c679ef8
Коммит 026f54e678
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
15 изменённых файлов: 1112 добавлений и 34 удалений

Просмотреть файл

@ -37,6 +37,8 @@ class BlobServiceProperties extends models['Resource'] {
* @property {number} [deleteRetentionPolicy.days] Indicates the number of
* days that the deleted blob should be retained. The minimum specified value
* can be 1 and the maximum value can be 365.
* @property {boolean} [automaticSnapshotPolicyEnabled] Automatic Snapshot is
* enabled if set to true.
*/
constructor() {
super();
@ -102,6 +104,13 @@ class BlobServiceProperties extends models['Resource'] {
name: 'Composite',
className: 'DeleteRetentionPolicy'
}
},
automaticSnapshotPolicyEnabled: {
required: false,
serializedName: 'properties.automaticSnapshotPolicyEnabled',
type: {
name: 'Boolean'
}
}
}
}

Просмотреть файл

@ -180,7 +180,8 @@ export interface Sku {
/**
* Gets or sets the SKU name. Required for account creation; optional for update. Note that in
* older versions, SKU name was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS',
* 'Standard_GZRS', 'Standard_RAGZRS'
*/
name: string;
/**
@ -1410,6 +1411,54 @@ export interface BlobServiceProperties extends Resource {
* The blob service properties for soft delete.
*/
deleteRetentionPolicy?: DeleteRetentionPolicy;
/**
* Automatic Snapshot is enabled if set to true.
*/
automaticSnapshotPolicyEnabled?: boolean;
}
/**
* Lease Container request schema.
*/
export interface LeaseContainerRequest {
/**
* Specifies the lease action. Can be one of the available actions. Possible values include:
* 'Acquire', 'Renew', 'Change', 'Release', 'Break'
*/
action: string;
/**
* Identifies the lease. Can be specified in any valid GUID string format.
*/
leaseId?: string;
/**
* Optional. For a break action, proposed duration the lease should continue before it is broken,
* in seconds, between 0 and 60.
*/
breakPeriod?: number;
/**
* Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1)
* for a lease that never expires.
*/
leaseDuration?: number;
/**
* Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
*/
proposedLeaseId?: string;
}
/**
* Lease Container response schema.
*/
export interface LeaseContainerResponse {
/**
* Returned unique lease ID that must be included with any request to delete the container, or to
* renew, change, or release the lease.
*/
leaseId?: string;
/**
* Approximate time remaining in the lease period, in seconds.
*/
leaseTimeSeconds?: string;
}
/**

Просмотреть файл

@ -78,6 +78,8 @@ exports.CorsRule = require('./corsRule');
exports.CorsRules = require('./corsRules');
exports.DeleteRetentionPolicy = require('./deleteRetentionPolicy');
exports.BlobServiceProperties = require('./blobServiceProperties');
exports.LeaseContainerRequest = require('./leaseContainerRequest');
exports.LeaseContainerResponse = require('./leaseContainerResponse');
exports.OperationListResult = require('./operationListResult');
exports.StorageSkuListResult = require('./storageSkuListResult');
exports.StorageAccountListResult = require('./storageAccountListResult');

Просмотреть файл

@ -0,0 +1,92 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* Lease Container request schema.
*
*/
class LeaseContainerRequest {
/**
* Create a LeaseContainerRequest.
* @property {string} action Specifies the lease action. Can be one of the
* available actions. Possible values include: 'Acquire', 'Renew', 'Change',
* 'Release', 'Break'
* @property {string} [leaseId] Identifies the lease. Can be specified in any
* valid GUID string format.
* @property {number} [breakPeriod] Optional. For a break action, proposed
* duration the lease should continue before it is broken, in seconds,
* between 0 and 60.
* @property {number} [leaseDuration] Required for acquire. Specifies the
* duration of the lease, in seconds, or negative one (-1) for a lease that
* never expires.
* @property {string} [proposedLeaseId] Optional for acquire, required for
* change. Proposed lease ID, in a GUID string format.
*/
constructor() {
}
/**
* Defines the metadata of LeaseContainerRequest
*
* @returns {object} metadata of LeaseContainerRequest
*
*/
mapper() {
return {
required: false,
serializedName: 'LeaseContainerRequest',
type: {
name: 'Composite',
className: 'LeaseContainerRequest',
modelProperties: {
action: {
required: true,
serializedName: 'action',
type: {
name: 'String'
}
},
leaseId: {
required: false,
serializedName: 'leaseId',
type: {
name: 'String'
}
},
breakPeriod: {
required: false,
serializedName: 'breakPeriod',
type: {
name: 'Number'
}
},
leaseDuration: {
required: false,
serializedName: 'leaseDuration',
type: {
name: 'Number'
}
},
proposedLeaseId: {
required: false,
serializedName: 'proposedLeaseId',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = LeaseContainerRequest;

Просмотреть файл

@ -0,0 +1,63 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* Lease Container response schema.
*
*/
class LeaseContainerResponse {
/**
* Create a LeaseContainerResponse.
* @property {string} [leaseId] Returned unique lease ID that must be
* included with any request to delete the container, or to renew, change, or
* release the lease.
* @property {string} [leaseTimeSeconds] Approximate time remaining in the
* lease period, in seconds.
*/
constructor() {
}
/**
* Defines the metadata of LeaseContainerResponse
*
* @returns {object} metadata of LeaseContainerResponse
*
*/
mapper() {
return {
required: false,
serializedName: 'LeaseContainerResponse',
type: {
name: 'Composite',
className: 'LeaseContainerResponse',
modelProperties: {
leaseId: {
required: false,
serializedName: 'leaseId',
type: {
name: 'String'
}
},
leaseTimeSeconds: {
required: false,
serializedName: 'leaseTimeSeconds',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = LeaseContainerResponse;

Просмотреть файл

@ -21,7 +21,7 @@ class Sku {
* creation; optional for update. Note that in older versions, SKU name was
* called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
* @property {string} [tier] Gets the SKU tier. This is based on the SKU
* name. Possible values include: 'Standard', 'Premium'
* @property {string} [resourceType] The type of the resource, usually it is
@ -59,8 +59,7 @@ class Sku {
required: true,
serializedName: 'name',
type: {
name: 'Enum',
allowedValues: [ 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS' ]
name: 'String'
}
},
tier: {
@ -85,8 +84,7 @@ class Sku {
readOnly: true,
serializedName: 'kind',
type: {
name: 'Enum',
allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ]
name: 'String'
}
},
locations: {

Просмотреть файл

@ -25,7 +25,7 @@ class StorageAccount extends models['TrackedResource'] {
* account creation; optional for update. Note that in older versions, SKU
* name was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
* @property {string} [sku.tier] Gets the SKU tier. This is based on the SKU
* name. Possible values include: 'Standard', 'Premium'
* @property {string} [sku.resourceType] The type of the resource, usually it
@ -265,8 +265,7 @@ class StorageAccount extends models['TrackedResource'] {
readOnly: true,
serializedName: 'kind',
type: {
name: 'Enum',
allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ]
name: 'String'
}
},
identity: {

Просмотреть файл

@ -22,7 +22,7 @@ class StorageAccountCreateParameters {
* account creation; optional for update. Note that in older versions, SKU
* name was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
* @property {string} [sku.tier] Gets the SKU tier. This is based on the SKU
* name. Possible values include: 'Standard', 'Premium'
* @property {string} [sku.resourceType] The type of the resource, usually it
@ -169,8 +169,7 @@ class StorageAccountCreateParameters {
required: true,
serializedName: 'kind',
type: {
name: 'Enum',
allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ]
name: 'String'
}
},
location: {

Просмотреть файл

@ -25,7 +25,7 @@ class StorageAccountUpdateParameters {
* account creation; optional for update. Note that in older versions, SKU
* name was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
* @property {string} [sku.tier] Gets the SKU tier. This is based on the SKU
* name. Possible values include: 'Standard', 'Premium'
* @property {string} [sku.resourceType] The type of the resource, usually it
@ -232,8 +232,7 @@ class StorageAccountUpdateParameters {
required: false,
serializedName: 'kind',
type: {
name: 'Enum',
allowedValues: [ 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage' ]
name: 'String'
}
}
}

Просмотреть файл

@ -401,7 +401,7 @@ function _create(resourceGroupName, accountName, containerName, options, callbac
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 201) {
if (statusCode !== 200 && statusCode !== 201) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
@ -430,7 +430,7 @@ function _create(resourceGroupName, accountName, containerName, options, callbac
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 201) {
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
@ -446,6 +446,23 @@ function _create(resourceGroupName, accountName, containerName, options, callbac
return callback(deserializationError);
}
}
// Deserialize Response
if (statusCode === 201) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['BlobContainer']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError1.request = msRest.stripRequest(httpRequest);
deserializationError1.response = msRest.stripResponse(response);
return callback(deserializationError1);
}
}
return callback(null, result, httpRequest, response);
});
@ -2721,6 +2738,248 @@ function _extendImmutabilityPolicy(resourceGroupName, accountName, containerName
});
}
/**
* The Lease Container operation establishes and manages a lock on a container
* for delete operations. The lock duration can be 15 to 60 seconds, or can be
* infinite.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {string} containerName The name of the blob container within the
* specified storage account. Blob container names must be between 3 and 63
* characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a
* letter or number.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] Lease Container request body.
*
* @param {string} options.parameters.action Specifies the lease action. Can be
* one of the available actions. Possible values include: 'Acquire', 'Renew',
* 'Change', 'Release', 'Break'
*
* @param {string} [options.parameters.leaseId] Identifies the lease. Can be
* specified in any valid GUID string format.
*
* @param {number} [options.parameters.breakPeriod] Optional. For a break
* action, proposed duration the lease should continue before it is broken, in
* seconds, between 0 and 60.
*
* @param {number} [options.parameters.leaseDuration] Required for acquire.
* Specifies the duration of the lease, in seconds, or negative one (-1) for a
* lease that never expires.
*
* @param {string} [options.parameters.proposedLeaseId] Optional for acquire,
* required for change. Proposed lease ID, in a GUID string format.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link LeaseContainerResponse} for more
* information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _lease(resourceGroupName, accountName, containerName, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
let parameters = (options && options.parameters !== undefined) ? options.parameters : undefined;
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 90)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/');
}
}
if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
throw new Error('accountName cannot be null or undefined and it must be of type string.');
}
if (accountName !== null && accountName !== undefined) {
if (accountName.length > 24)
{
throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24');
}
if (accountName.length < 3)
{
throw new Error('"accountName" should satisfy the constraint - "MinLength": 3');
}
}
if (containerName === null || containerName === undefined || typeof containerName.valueOf() !== 'string') {
throw new Error('containerName cannot be null or undefined and it must be of type string.');
}
if (containerName !== null && containerName !== undefined) {
if (containerName.length > 63)
{
throw new Error('"containerName" should satisfy the constraint - "MaxLength": 63');
}
if (containerName.length < 3)
{
throw new Error('"containerName" should satisfy the constraint - "MinLength": 3');
}
}
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) {
if (this.client.apiVersion.length < 1)
{
throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) {
if (this.client.subscriptionId.length < 1)
{
throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName));
requestUrl = requestUrl.replace('{containerName}', encodeURIComponent(containerName));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'POST';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
// Serialize Request
let requestContent = null;
let requestModel = null;
try {
if (parameters !== null && parameters !== undefined) {
let requestModelMapper = new client.models['LeaseContainerRequest']().mapper();
requestModel = client.serialize(requestModelMapper, parameters, 'parameters');
requestContent = JSON.stringify(requestModel);
}
} catch (error) {
let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` +
`payload - ${JSON.stringify(parameters, null, 2)}.`);
return callback(serializationError);
}
httpRequest.body = requestContent;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
// Deserialize Response
if (statusCode === 200) {
let parsedResponse = null;
try {
parsedResponse = JSON.parse(responseBody);
result = JSON.parse(responseBody);
if (parsedResponse !== null && parsedResponse !== undefined) {
let resultMapper = new client.models['LeaseContainerResponse']().mapper();
result = client.deserialize(resultMapper, parsedResponse, 'result');
}
} catch (error) {
let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
deserializationError.request = msRest.stripRequest(httpRequest);
deserializationError.response = msRest.stripResponse(response);
return callback(deserializationError);
}
}
return callback(null, result, httpRequest, response);
});
}
/** Class representing a BlobContainers. */
class BlobContainers {
/**
@ -2741,6 +3000,7 @@ class BlobContainers {
this._deleteImmutabilityPolicy = _deleteImmutabilityPolicy;
this._lockImmutabilityPolicy = _lockImmutabilityPolicy;
this._extendImmutabilityPolicy = _extendImmutabilityPolicy;
this._lease = _lease;
}
/**
@ -4120,6 +4380,155 @@ class BlobContainers {
}
}
/**
* The Lease Container operation establishes and manages a lock on a container
* for delete operations. The lock duration can be 15 to 60 seconds, or can be
* infinite.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {string} containerName The name of the blob container within the
* specified storage account. Blob container names must be between 3 and 63
* characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a
* letter or number.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] Lease Container request body.
*
* @param {string} options.parameters.action Specifies the lease action. Can be
* one of the available actions. Possible values include: 'Acquire', 'Renew',
* 'Change', 'Release', 'Break'
*
* @param {string} [options.parameters.leaseId] Identifies the lease. Can be
* specified in any valid GUID string format.
*
* @param {number} [options.parameters.breakPeriod] Optional. For a break
* action, proposed duration the lease should continue before it is broken, in
* seconds, between 0 and 60.
*
* @param {number} [options.parameters.leaseDuration] Required for acquire.
* Specifies the duration of the lease, in seconds, or negative one (-1) for a
* lease that never expires.
*
* @param {string} [options.parameters.proposedLeaseId] Optional for acquire,
* required for change. Proposed lease ID, in a GUID string format.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<LeaseContainerResponse>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
leaseWithHttpOperationResponse(resourceGroupName, accountName, containerName, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._lease(resourceGroupName, accountName, containerName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* The Lease Container operation establishes and manages a lock on a container
* for delete operations. The lock duration can be 15 to 60 seconds, or can be
* infinite.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {string} containerName The name of the blob container within the
* specified storage account. Blob container names must be between 3 and 63
* characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a
* letter or number.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] Lease Container request body.
*
* @param {string} options.parameters.action Specifies the lease action. Can be
* one of the available actions. Possible values include: 'Acquire', 'Renew',
* 'Change', 'Release', 'Break'
*
* @param {string} [options.parameters.leaseId] Identifies the lease. Can be
* specified in any valid GUID string format.
*
* @param {number} [options.parameters.breakPeriod] Optional. For a break
* action, proposed duration the lease should continue before it is broken, in
* seconds, between 0 and 60.
*
* @param {number} [options.parameters.leaseDuration] Required for acquire.
* Specifies the duration of the lease, in seconds, or negative one (-1) for a
* lease that never expires.
*
* @param {string} [options.parameters.proposedLeaseId] Optional for acquire,
* required for change. Proposed lease ID, in a GUID string format.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {LeaseContainerResponse} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {object} [result] - The deserialized result object if an error did not occur.
* See {@link LeaseContainerResponse} for more
* information.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
lease(resourceGroupName, accountName, containerName, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._lease(resourceGroupName, accountName, containerName, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._lease(resourceGroupName, accountName, containerName, options, optionalCallback);
}
}
}
module.exports = BlobContainers;

Просмотреть файл

@ -53,6 +53,9 @@ const WebResource = msRest.WebResource;
* of days that the deleted blob should be retained. The minimum specified
* value can be 1 and the maximum value can be 365.
*
* @param {boolean} [parameters.automaticSnapshotPolicyEnabled] Automatic
* Snapshot is enabled if set to true.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@ -485,6 +488,9 @@ class BlobServices {
* of days that the deleted blob should be retained. The minimum specified
* value can be 1 and the maximum value can be 365.
*
* @param {boolean} [parameters.automaticSnapshotPolicyEnabled] Automatic
* Snapshot is enabled if set to true.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@ -549,6 +555,9 @@ class BlobServices {
* of days that the deleted blob should be retained. The minimum specified
* value can be 1 and the maximum value can be 365.
*
* @param {boolean} [parameters.automaticSnapshotPolicyEnabled] Automatic
* Snapshot is enabled if set to true.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the

Просмотреть файл

@ -222,7 +222,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -356,7 +356,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -658,7 +658,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -789,7 +789,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -1546,6 +1546,70 @@ export interface StorageAccounts {
failover(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<void>): void;
/**
* Revoke user delegation keys.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<null>} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
revokeUserDelegationKeysWithHttpOperationResponse(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<void>>;
/**
* Revoke user delegation keys.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {ServiceCallback} [optionalCallback] - The optional callback.
*
* @returns {ServiceCallback|Promise} If a callback was passed as the last
* parameter then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned.
*
* @resolve {null} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
* {ServiceCallback} optionalCallback(err, result, request, response)
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
* {null} [result] - The deserialized result object if an error did not occur.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
revokeUserDelegationKeys(resourceGroupName: string, accountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<void>;
revokeUserDelegationKeys(resourceGroupName: string, accountName: string, callback: ServiceCallback<void>): void;
revokeUserDelegationKeys(resourceGroupName: string, accountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<void>): void;
/**
* Asynchronously creates a new storage account with the specified parameters.
* If an account is already created and a subsequent create request is issued
@ -1569,7 +1633,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -1703,7 +1767,7 @@ export interface StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -2236,6 +2300,9 @@ export interface BlobServices {
* of days that the deleted blob should be retained. The minimum specified
* value can be 1 and the maximum value can be 365.
*
* @param {boolean} [parameters.automaticSnapshotPolicyEnabled] Automatic
* Snapshot is enabled if set to true.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@ -2288,6 +2355,9 @@ export interface BlobServices {
* of days that the deleted blob should be retained. The minimum specified
* value can be 1 and the maximum value can be 365.
*
* @param {boolean} [parameters.automaticSnapshotPolicyEnabled] Automatic
* Snapshot is enabled if set to true.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
@ -3449,4 +3519,126 @@ export interface BlobContainers {
extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.ImmutabilityPolicy>;
extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, callback: ServiceCallback<models.ImmutabilityPolicy>): void;
extendImmutabilityPolicy(resourceGroupName: string, accountName: string, containerName: string, ifMatch: string, immutabilityPeriodSinceCreationInDays: number, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.ImmutabilityPolicy>): void;
/**
* The Lease Container operation establishes and manages a lock on a container
* for delete operations. The lock duration can be 15 to 60 seconds, or can be
* infinite.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {string} containerName The name of the blob container within the
* specified storage account. Blob container names must be between 3 and 63
* characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a
* letter or number.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] Lease Container request body.
*
* @param {string} options.parameters.action Specifies the lease action. Can be
* one of the available actions. Possible values include: 'Acquire', 'Renew',
* 'Change', 'Release', 'Break'
*
* @param {string} [options.parameters.leaseId] Identifies the lease. Can be
* specified in any valid GUID string format.
*
* @param {number} [options.parameters.breakPeriod] Optional. For a break
* action, proposed duration the lease should continue before it is broken, in
* seconds, between 0 and 60.
*
* @param {number} [options.parameters.leaseDuration] Required for acquire.
* Specifies the duration of the lease, in seconds, or negative one (-1) for a
* lease that never expires.
*
* @param {string} [options.parameters.proposedLeaseId] Optional for acquire,
* required for change. Proposed lease ID, in a GUID string format.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<LeaseContainerResponse>} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*/
leaseWithHttpOperationResponse(resourceGroupName: string, accountName: string, containerName: string, options?: { parameters? : models.LeaseContainerRequest, customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.LeaseContainerResponse>>;
/**
* The Lease Container operation establishes and manages a lock on a container
* for delete operations. The lock duration can be 15 to 60 seconds, or can be
* infinite.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {string} containerName The name of the blob container within the
* specified storage account. Blob container names must be between 3 and 63
* characters in length and use numbers, lower-case letters and dash (-) only.
* Every dash (-) character must be immediately preceded and followed by a
* letter or number.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] Lease Container request body.
*
* @param {string} options.parameters.action Specifies the lease action. Can be
* one of the available actions. Possible values include: 'Acquire', 'Renew',
* 'Change', 'Release', 'Break'
*
* @param {string} [options.parameters.leaseId] Identifies the lease. Can be
* specified in any valid GUID string format.
*
* @param {number} [options.parameters.breakPeriod] Optional. For a break
* action, proposed duration the lease should continue before it is broken, in
* seconds, between 0 and 60.
*
* @param {number} [options.parameters.leaseDuration] Required for acquire.
* Specifies the duration of the lease, in seconds, or negative one (-1) for a
* lease that never expires.
*
* @param {string} [options.parameters.proposedLeaseId] Optional for acquire,
* required for change. Proposed lease ID, in a GUID string format.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {ServiceCallback} [optionalCallback] - The optional callback.
*
* @returns {ServiceCallback|Promise} If a callback was passed as the last
* parameter then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned.
*
* @resolve {LeaseContainerResponse} - The deserialized result object.
*
* @reject {Error|ServiceError} - The error object.
*
* {ServiceCallback} optionalCallback(err, result, request, response)
*
* {Error|ServiceError} err - The Error object if an error occurred, null otherwise.
*
* {LeaseContainerResponse} [result] - The deserialized result object if an error did not occur.
* See {@link LeaseContainerResponse} for more
* information.
*
* {WebResource} [request] - The HTTP Request object if an error did not occur.
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
lease(resourceGroupName: string, accountName: string, containerName: string, options?: { parameters? : models.LeaseContainerRequest, customHeaders? : { [headerName: string]: string; } }): Promise<models.LeaseContainerResponse>;
lease(resourceGroupName: string, accountName: string, containerName: string, callback: ServiceCallback<models.LeaseContainerResponse>): void;
lease(resourceGroupName: string, accountName: string, containerName: string, options: { parameters? : models.LeaseContainerRequest, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.LeaseContainerResponse>): void;
}

Просмотреть файл

@ -211,7 +211,7 @@ function _checkNameAvailability(name, options, callback) {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -775,7 +775,7 @@ function _getProperties(resourceGroupName, accountName, options, callback) {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -2333,6 +2333,172 @@ function _failover(resourceGroupName, accountName, options, callback) {
});
}
/**
* Revoke user delegation keys.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} callback - The callback.
*
* @returns {function} callback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _revokeUserDelegationKeys(resourceGroupName, accountName, options, callback) {
/* jshint validthis: true */
let client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
options = null;
}
if (!callback) {
throw new Error('callback cannot be null.');
}
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (resourceGroupName !== null && resourceGroupName !== undefined) {
if (resourceGroupName.length > 90)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90');
}
if (resourceGroupName.length < 1)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1');
}
if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null)
{
throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/');
}
}
if (accountName === null || accountName === undefined || typeof accountName.valueOf() !== 'string') {
throw new Error('accountName cannot be null or undefined and it must be of type string.');
}
if (accountName !== null && accountName !== undefined) {
if (accountName.length > 24)
{
throw new Error('"accountName" should satisfy the constraint - "MaxLength": 24');
}
if (accountName.length < 3)
{
throw new Error('"accountName" should satisfy the constraint - "MinLength": 3');
}
}
if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') {
throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.');
}
if (this.client.apiVersion !== null && this.client.apiVersion !== undefined) {
if (this.client.apiVersion.length < 1)
{
throw new Error('"this.client.apiVersion" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
}
if (this.client.subscriptionId !== null && this.client.subscriptionId !== undefined) {
if (this.client.subscriptionId.length < 1)
{
throw new Error('"this.client.subscriptionId" should satisfy the constraint - "MinLength": 1');
}
}
if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
throw new Error('this.client.acceptLanguage must be of type string.');
}
} catch (error) {
return callback(error);
}
// Construct URL
let baseUrl = this.client.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys';
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{accountName}', encodeURIComponent(accountName));
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion));
if (queryParameters.length > 0) {
requestUrl += '?' + queryParameters.join('&');
}
// Create HTTP transport objects
let httpRequest = new WebResource();
httpRequest.method = 'POST';
httpRequest.url = requestUrl;
httpRequest.headers = {};
// Set Headers
httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
if (this.client.generateClientRequestId) {
httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
}
if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
httpRequest.headers['accept-language'] = this.client.acceptLanguage;
}
if(options) {
for(let headerName in options['customHeaders']) {
if (options['customHeaders'].hasOwnProperty(headerName)) {
httpRequest.headers[headerName] = options['customHeaders'][headerName];
}
}
}
httpRequest.body = null;
// Send Request
return client.pipeline(httpRequest, (err, response, responseBody) => {
if (err) {
return callback(err);
}
let statusCode = response.statusCode;
if (statusCode !== 200) {
let error = new Error(responseBody);
error.statusCode = response.statusCode;
error.request = msRest.stripRequest(httpRequest);
error.response = msRest.stripResponse(response);
if (responseBody === '') responseBody = null;
let parsedErrorResponse;
try {
parsedErrorResponse = JSON.parse(responseBody);
if (parsedErrorResponse) {
if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
}
if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
let resultMapper = new client.models['CloudError']().mapper();
error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
}
} catch (defaultError) {
error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
`- "${responseBody}" for the default response.`;
return callback(error);
}
return callback(error);
}
// Create Result
let result = null;
if (responseBody === '') responseBody = null;
return callback(null, result, httpRequest, response);
});
}
/**
* Asynchronously creates a new storage account with the specified parameters.
* If an account is already created and a subsequent create request is issued
@ -2356,7 +2522,7 @@ function _failover(resourceGroupName, accountName, options, callback) {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -2838,6 +3004,7 @@ class StorageAccounts {
this._listAccountSAS = _listAccountSAS;
this._listServiceSAS = _listServiceSAS;
this._failover = _failover;
this._revokeUserDelegationKeys = _revokeUserDelegationKeys;
this._beginCreate = _beginCreate;
this._beginFailover = _beginFailover;
}
@ -2948,7 +3115,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -3094,7 +3261,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -3465,7 +3632,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -3608,7 +3775,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -4569,6 +4736,97 @@ class StorageAccounts {
}
}
/**
* Revoke user delegation keys.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @returns {Promise} A promise is returned
*
* @resolve {HttpOperationResponse<null>} - The deserialized result object.
*
* @reject {Error} - The error object.
*/
revokeUserDelegationKeysWithHttpOperationResponse(resourceGroupName, accountName, options) {
let client = this.client;
let self = this;
return new Promise((resolve, reject) => {
self._revokeUserDelegationKeys(resourceGroupName, accountName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
else { resolve(httpOperationResponse); }
return;
});
});
}
/**
* Revoke user delegation keys.
*
* @param {string} resourceGroupName The name of the resource group within the
* user's subscription. The name is case insensitive.
*
* @param {string} 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 {object} [options] Optional Parameters.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {function} [optionalCallback] - The optional callback.
*
* @returns {function|Promise} If a callback was passed as the last parameter
* then it returns the callback else returns a Promise.
*
* {Promise} A promise is returned
*
* @resolve {null} - The deserialized result object.
*
* @reject {Error} - The error object.
*
* {function} optionalCallback(err, result, request, response)
*
* {Error} err - The Error object if an error occurred, null otherwise.
*
* {null} [result] - The deserialized result object if an error did not occur.
*
* {object} [request] - The HTTP Request object if an error did not occur.
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
revokeUserDelegationKeys(resourceGroupName, accountName, options, optionalCallback) {
let client = this.client;
let self = this;
if (!optionalCallback && typeof options === 'function') {
optionalCallback = options;
options = null;
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._revokeUserDelegationKeys(resourceGroupName, accountName, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._revokeUserDelegationKeys(resourceGroupName, accountName, options, optionalCallback);
}
}
/**
* Asynchronously creates a new storage account with the specified parameters.
* If an account is already created and a subsequent create request is issued
@ -4592,7 +4850,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.
@ -4738,7 +4996,7 @@ class StorageAccounts {
* account creation; optional for update. Note that in older versions, SKU name
* was called accountType. Possible values include: 'Standard_LRS',
* 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
* 'Premium_ZRS'
* 'Premium_ZRS', 'Standard_GZRS', 'Standard_RAGZRS'
*
* @param {array} [parameters.sku.restrictions] The restrictions because of
* which SKU cannot be used. This is empty if there are no restrictions.

Просмотреть файл

@ -50,7 +50,7 @@ class StorageManagementClient extends ServiceClient {
super(credentials, options);
this.apiVersion = '2018-11-01';
this.apiVersion = '2019-04-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;

Просмотреть файл

@ -2,7 +2,7 @@
"name": "azure-arm-storage",
"author": "Microsoft Corporation",
"description": "StorageManagementClient Library with typescript type definitions for node",
"version": "8.0.0",
"version": "8.1.0",
"dependencies": {
"ms-rest": "^2.5.0",
"ms-rest-azure": "^2.5.5"