diff --git a/ChangeLog.md b/ChangeLog.md index 74a536a9..3a926c82 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,12 @@ Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node. +2017.10 Version 2.6.0 + +FILE + +* Added support for file share snapshot. + 2017.09 Version 2.5.0 ALL diff --git a/browser/ChangeLog.md b/browser/ChangeLog.md index 0c8861ce..d9c18ebb 100644 --- a/browser/ChangeLog.md +++ b/browser/ChangeLog.md @@ -1,5 +1,9 @@ Note: This is the change log file for Azure Storage JavaScript Client Library. +2017.10 Version 0.2.6-preview.12 + +* Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.6.0. + 2017.09 Version 0.2.5-preview.11 * Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.5.0. diff --git a/browser/README.md b/browser/README.md index 6e52b080..0e6cc94c 100644 --- a/browser/README.md +++ b/browser/README.md @@ -29,7 +29,7 @@ Compatibility with mobile browsers have not been fully validated, please open is | Chrome | Firefox | Internet Explorer | Microsoft Edge | |------------|----------|--------------------|-----------------| -| v60 | v55 | v11 | v40 | +| v61 | v56 | v11 | v40 | ## Generating a Custom Azure Storage JavaScript Client Library diff --git a/lib/common/util/constants.js b/lib/common/util/constants.js index b4230db7..a9295ae7 100644 --- a/lib/common/util/constants.js +++ b/lib/common/util/constants.js @@ -37,7 +37,7 @@ var Constants = { * @const * @type {string} */ - USER_AGENT_PRODUCT_VERSION: '2.5.0', + USER_AGENT_PRODUCT_VERSION: '2.6.0', /** * The number of default concurrent requests for parallel operation. @@ -1874,13 +1874,21 @@ var Constants = { COPY_ID: 'copyid', /** - * The Snapshot value. + * The snapshot value. * * @const * @type {string} */ SNAPSHOT: 'snapshot', + /** + * The share snapshot value. + * + * @const + * @type {string} + */ + SHARE_SNAPSHOT: 'sharesnapshot', + /** * The previous snapshot value. * diff --git a/lib/services/file/fileservice.core.js b/lib/services/file/fileservice.core.js index 979b30a4..5b4a3416 100644 --- a/lib/services/file/fileservice.core.js +++ b/lib/services/file/fileservice.core.js @@ -55,6 +55,7 @@ var AclResult = azureCommon.AclResult; // Errors requires var errors = require('../../common/errors/errors'); var ArgumentNullError = errors.ArgumentNullError; +var ArgumentError = errors.ArgumentError; /** * Creates a new FileService object. @@ -208,7 +209,7 @@ FileService.prototype.setServiceProperties = function (serviceProperties, option * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage. -* @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata') +* @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them) * **Note** that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. @@ -238,7 +239,7 @@ FileService.prototype.listSharesSegmented = function (currentToken, optionsOrCal * Please see StorageUtilities.LocationMode for the possible values. * @param {string} [options.prefix] Filters the results to return only shares whose name begins with the specified prefix. * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage. -* @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata') +* @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them) * **Note** that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. @@ -326,6 +327,7 @@ FileService.prototype.listSharesSegmentedWithPrefix = function (prefix, currentT * @this {FileService} * @param {string} share The share name. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -408,6 +410,60 @@ FileService.prototype.createShare = function (share, optionsOrCallback, callback this.performRequest(webResource, null, options, processResponseCallback); }; +/** +* Creates a share snapshot. +* +* @this {FileService} +* @param {string} share The share name. +* @param {object} [options] The request options. +* @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. +* Please see StorageUtilities.LocationMode for the possible values. +* @param {object} [options.metadata] The metadata key/value pairs. +* @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. +* @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. +* @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. +* The maximum execution time interval begins at the time that the client begins building the request. The maximum +* execution time is checked intermittently while performing requests, and before executing retries. +* @param {string} [options.clientRequestId] A string that represents the client request ID with a 1KB character limit. +* @param {bool} [options.useNagleAlgorithm] Determines whether the Nagle algorithm is used; true to use the Nagle algorithm; otherwise, false. +* The default value is false. +* @param {errorOrResult} callback `error` will contain information +* if an error occurs; otherwise `result` will contain +* the ID of the snapshot. +* `response` will contain information related to this operation. +*/ +FileService.prototype.createShareSnapshot = function (share, optionsOrCallback, callback) { + var userOptions; + azureutil.normalizeArgs(optionsOrCallback, callback, function (o, c) { userOptions = o; callback = c; }); + + validate.validateArgs('createShareSnapshot', function (v) { + v.string(share, 'share'); + v.shareNameIsValid(share); + v.callback(callback); + }); + + var options = extend(true, {}, userOptions); + var webResource = WebResource.put(share) + .withQueryOption(QueryStringConstants.RESTYPE, 'share') + .withQueryOption(QueryStringConstants.COMP, QueryStringConstants.SNAPSHOT); + webResource.addOptionalMetadataHeaders(options.metadata); + + var processResponseCallback = function (responseObject, next) { + responseObject.snapshotId = null; + if (!responseObject.error) { + responseObject.snapshotId = responseObject.response.headers[HeaderConstants.SNAPSHOT]; + } + + var finalCallback = function (returnObject) { + callback(returnObject.error, returnObject.snapshotId, returnObject.response); + }; + + next(responseObject, finalCallback); + }; + + this.performRequest(webResource, null, options, processResponseCallback); +}; + /** * Creates a new share under the specified account if the share does not exists. * @@ -450,6 +506,8 @@ FileService.prototype.createShareIfNotExists = function (share, optionsOrCallbac }); var options = extend(true, {}, userOptions); + delete options.shareSnapshotId; + var self = this; self._doesShareExist(share, true, options, function(error, result, response) { var exists = result.exists; @@ -487,6 +545,7 @@ FileService.prototype.createShareIfNotExists = function (share, optionsOrCallbac * @this {FileService} * @param {string} share The share name. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -514,7 +573,8 @@ FileService.prototype.getShareProperties = function (share, optionsOrCallback, c var options = extend(true, {}, userOptions); var webResource = WebResource.head(share) - .withQueryOption(QueryStringConstants.RESTYPE, 'share'); + .withQueryOption(QueryStringConstants.RESTYPE, 'share') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); //options.requestLocationMode = Constants.RequestLocationMode.PRIMARY_OR_SECONDARY; @@ -655,6 +715,7 @@ FileService.prototype.getShareStats = function (share, optionsOrCallback, callba * @this {FileService} * @param {string} share The share name. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -683,7 +744,8 @@ FileService.prototype.getShareMetadata = function (share, optionsOrCallback, cal var options = extend(true, {}, userOptions); var webResource = WebResource.head(share) .withQueryOption(QueryStringConstants.RESTYPE, 'share') - .withQueryOption(QueryStringConstants.COMP, 'metadata'); + .withQueryOption(QueryStringConstants.COMP, 'metadata') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); var self = this; var processResponseCallback = function (responseObject, next) { @@ -892,6 +954,8 @@ FileService.prototype.setShareAcl = function (share, signedIdentifiers, optionsO * @this {FileService} * @param {string} share The share name. * @param {object} [options] The request options. +* @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*. +* @param {string} [options.shareSnapshotId] The share snapshot identifier. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -917,9 +981,15 @@ FileService.prototype.deleteShare = function (share, optionsOrCallback, callback }); var options = extend(true, {}, userOptions); + if (!azureutil.objectIsNull(options.shareSnapshotId) && !azureutil.objectIsNull(options.deleteSnapshots)) { + throw new ArgumentError('options', SR.INVALID_DELETE_SNAPSHOT_OPTION); + } + var webResource = WebResource.del(share) - .withQueryOption(QueryStringConstants.RESTYPE, 'share'); - + .withQueryOption(QueryStringConstants.RESTYPE, 'share') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId) + .withHeader(HeaderConstants.DELETE_SNAPSHOT, options.deleteSnapshots); + var processResponseCallback = function (responseObject, next) { var finalCallback = function (returnObject) { callback(returnObject.error, returnObject.response); @@ -938,6 +1008,8 @@ FileService.prototype.deleteShare = function (share, optionsOrCallback, callback * @this {FileService} * @param {string} share The share name. * @param {object} [options] The request options. +* @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*. +* @param {string} [options.shareSnapshotId] The share snapshot identifier. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -999,6 +1071,7 @@ FileService.prototype.deleteShareIfExists = function (share, optionsOrCallback, * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The share snapshot identifier. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -1121,6 +1194,8 @@ FileService.prototype.createDirectoryIfNotExists = function (share, directory, o }); var options = extend(true, {}, userOptions); + delete options.shareSnapshotId; + var self = this; self._doesDirectoryExist(share, directory, true, options, function(error, result, response) { var exists = result.exists; @@ -1157,6 +1232,7 @@ FileService.prototype.createDirectoryIfNotExists = function (share, directory, o * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -1185,8 +1261,9 @@ FileService.prototype.getDirectoryProperties = function (share, directory, optio var options = extend(true, {}, userOptions); var webResource = WebResource.head(createResourceName(share, directory)) - .withQueryOption(QueryStringConstants.RESTYPE, 'directory'); - + .withQueryOption(QueryStringConstants.RESTYPE, 'directory') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); + var self = this; var processResponseCallback = function (responseObject, next) { responseObject.directoryResult = null; @@ -1288,6 +1365,8 @@ FileService.prototype.deleteDirectoryIfExists = function (share, directory, opti }); var options = extend(true, {}, userOptions); + delete options.shareSnapshotId; + var self = this; self._doesDirectoryExist(share, directory, true, options, function(error, result, response) { if(error){ @@ -1321,6 +1400,7 @@ FileService.prototype.deleteDirectoryIfExists = function (share, directory, opti * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.maxResults] Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000) * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. @@ -1351,6 +1431,7 @@ FileService.prototype.listFilesAndDirectoriesSegmented = function (share, direct * @param {string} prefix The prefix of the directory/files name. * @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.maxResults] Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000) * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. @@ -1382,7 +1463,8 @@ FileService.prototype.listFilesAndDirectoriesSegmentedWithPrefix = function (sha var webResource = WebResource.get(createResourceName(share, directory)) .withQueryOption(QueryStringConstants.RESTYPE, 'directory') .withQueryOption(QueryStringConstants.COMP, 'list') - .withQueryOption(QueryStringConstants.MAX_RESULTS, options.maxResults); + .withQueryOption(QueryStringConstants.MAX_RESULTS, options.maxResults) + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); if (!azureutil.objectIsNull(currentToken)) { webResource.withQueryOption(QueryStringConstants.MARKER, currentToken.nextMarker); @@ -1459,6 +1541,8 @@ FileService.prototype.listFilesAndDirectoriesSegmentedWithPrefix = function (sha * @this {FileService} * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. +* @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. @@ -1487,8 +1571,9 @@ FileService.prototype.getDirectoryMetadata = function (share, directory, options var resourceName = createResourceName(share, directory); var webResource = WebResource.head(resourceName) .withQueryOption(QueryStringConstants.RESTYPE, 'directory') - .withQueryOption(QueryStringConstants.COMP, 'metadata'); - + .withQueryOption(QueryStringConstants.COMP, 'metadata') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); + var self = this; var processResponseCallback = function (responseObject, next) { responseObject.directoryResult = null; @@ -1645,6 +1730,7 @@ FileService.prototype.generateSharedAccessSignature = function (share, directory * @param {string} [file] The file name. File names may not start or end with the delimiter '/'. * @param {string} [sasToken] The Shared Access Signature token. * @param {boolean} [primary] A boolean representing whether to use the primary or the secondary endpoint. +* @param {boolean} [shareSnapshotId] The snapshot identifier of the share. * @return {string} The formatted URL string. * @example * var azure = require('azure-storage'); @@ -1660,7 +1746,7 @@ FileService.prototype.generateSharedAccessSignature = function (share, directory * var sasToken = fileService.generateSharedAccessSignature(shareName, directoryName, fileName, sharedAccessPolicy); * var url = fileService.getUrl(shareName, directoryName, fileName, sasToken, true); */ -FileService.prototype.getUrl = function (share, directory, file, sasToken, primary) { +FileService.prototype.getUrl = function (share, directory, file, sasToken, primary, shareSnapshotId) { validate.validateArgs('getUrl', function (v) { v.string(share, 'share'); v.stringAllowEmpty(directory, 'directory'); @@ -1679,7 +1765,11 @@ FileService.prototype.getUrl = function (share, directory, file, sasToken, prima } var name = createResourceName(share, directory, file); - return url.resolve(host, url.format({pathname: this._getPath(name), query: qs.parse(sasToken)})); + var query = qs.parse(sasToken); + if(shareSnapshotId) { + query[QueryStringConstants.SHARE_SNAPSHOT] = shareSnapshotId; + } + return url.resolve(host, url.format({pathname: this._getPath(name), query: query})); }; /** @@ -1692,6 +1782,7 @@ FileService.prototype.getUrl = function (share, directory, file, sasToken, prima * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -1721,7 +1812,8 @@ FileService.prototype.getFileProperties = function (share, directory, file, opti var options = extend(true, {}, userOptions); var resourceName = createResourceName(share, directory, file); - var webResource = WebResource.head(resourceName); + var webResource = WebResource.head(resourceName) + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); var self = this; var processResponseCallback = function (responseObject, next) { @@ -1751,6 +1843,8 @@ FileService.prototype.getFileProperties = function (share, directory, file, opti * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. +* @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -1781,7 +1875,8 @@ FileService.prototype.getFileMetadata = function (share, directory, file, option var options = extend(true, {}, userOptions); var resourceName = createResourceName(share, directory, file); var webResource = WebResource.head(resourceName) - .withQueryOption(QueryStringConstants.COMP, 'metadata'); + .withQueryOption(QueryStringConstants.COMP, 'metadata') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); var self = this; var processResponseCallback = function (responseObject, next) { @@ -1943,7 +2038,7 @@ FileService.prototype.setFileMetadata = function (share, directory, file, metada * @param {String} size The size of the file, in bytes. * @param {object} [options] The request options. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. -* @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. +* @param {int} [options.clientRequestTimeoutInMs] The timeout of client requests, in milliseconds, to use for the request. * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. * The maximum execution time interval begins at the time that the client begins building the request. The maximum * execution time is checked intermittently while performing requests, and before executing retries. @@ -2000,6 +2095,7 @@ FileService.prototype.resizeFile = function (share, directory, file, size, optio * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -2173,6 +2269,8 @@ FileService.prototype.deleteFileIfExists = function (share, directory, file, opt }); var options = extend(true, {}, userOptions); + delete options.shareSnapshotId; + var self = this; self._doesFileExist(share, directory, file, true, options, function(error, result, response) { if(error){ @@ -2206,6 +2304,7 @@ FileService.prototype.deleteFileIfExists = function (share, directory, file, opt * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.rangeStart] The range start. * @param {int} [options.rangeEnd] The range end. * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files. @@ -2239,6 +2338,7 @@ FileService.prototype.getFileToText = function (share, directory, file, optionsO var options = extend(true, {}, userOptions); var resourceName = createResourceName(share, directory, file); var webResource = WebResource.get(resourceName) + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId) .withRawResponse(); FileResult.setHeaders(webResource, options); @@ -2276,6 +2376,7 @@ FileService.prototype.getFileToText = function (share, directory, file, optionsO * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range. * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range. * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions. @@ -2336,6 +2437,7 @@ FileService.prototype.createReadStream = function (share, directory, file, optio * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Stream} writeStream The write stream. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download. * Set the option to true for small files. * Parallel download and speed summary won't work with this option on. @@ -2389,7 +2491,8 @@ FileService.prototype.getFileToStream = function (share, directory, file, writeS var propertiesRequestOptions = { timeoutIntervalInMs : options.timeoutIntervalInMs, clientRequestTimeoutInMs : options.clientRequestTimeoutInMs, - accessConditions : options.accessConditions + accessConditions : options.accessConditions, + shareSnapshotId : options.shareSnapshotId }; if (options.skipSizeCheck) { @@ -2431,6 +2534,7 @@ FileService.prototype.getFileToStream = function (share, directory, file, writeS * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.rangeStart] The range start. * @param {int} [options.rangeEnd] The range end. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. @@ -2463,7 +2567,8 @@ FileService.prototype.listRanges = function (share, directory, file, optionsOrCa var resourceName = createResourceName(share, directory, file); var options = extend(true, {}, userOptions); var webResource = WebResource.get(resourceName) - .withQueryOption(QueryStringConstants.COMP, 'rangelist'); + .withQueryOption(QueryStringConstants.COMP, 'rangelist') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); FileResult.setHeaders(webResource, options); @@ -3279,6 +3384,7 @@ FileService.prototype._createFileFromChunkStream = function(share, directory, fi * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Stream} writeStream The write stream. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range. * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range. * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions. @@ -3314,7 +3420,9 @@ FileService.prototype._getFileToStream = function (share, directory, file, write var options = extend(true, {}, userOptions); var resourceName = createResourceName(share, directory, file); - var webResource = WebResource.get(resourceName).withRawResponse(); + var webResource = WebResource.get(resourceName) + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId) + .withRawResponse(); FileResult.setHeaders(webResource, options); this._setRangeContentMD5Header(webResource, options); @@ -3414,6 +3522,7 @@ FileService.prototype._getFileToRangeStream = function (share, directory, file, }; var rangeSize = range.size; + requestOptions.shareSnapshotId = userOptions.shareSnapshotId; requestOptions.timeoutIntervalInMs = userOptions.timeoutIntervalInMs; requestOptions.clientRequestTimeoutInMs = userOptions.clientRequestTimeoutInMs; requestOptions.useTransactionalMD5 = userOptions.useTransactionalMD5; @@ -3621,6 +3730,7 @@ FileService.prototype._validateLengthAndMD5 = function (options, responseObject) * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {string} primaryOnly If true, the request will be executed against the primary storage location. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -3651,7 +3761,8 @@ FileService.prototype._doesFileExist = function (share, directory, file, primary var options = extend(true, {}, userOptions); var resourceName = createResourceName(share, directory, file); - var webResource = WebResource.head(resourceName); + var webResource = WebResource.head(resourceName) + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); /*if(primaryOnly === false) { options.requestLocationMode = RequestLocationMode.PRIMARY_OR_SECONDARY; @@ -3688,6 +3799,7 @@ FileService.prototype._doesFileExist = function (share, directory, file, primary * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} primaryOnly If true, the request will be executed against the primary storage location. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The share snapshot identifier. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -3716,7 +3828,8 @@ FileService.prototype._doesDirectoryExist = function (share, directory, primaryO var options = extend(true, {}, userOptions); var webResource = WebResource.head(createResourceName(share, directory)) - .withQueryOption(QueryStringConstants.RESTYPE, 'directory'); + .withQueryOption(QueryStringConstants.RESTYPE, 'directory') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); /*if(primaryOnly === false) { options.requestLocationMode = RequestLocationMode.PRIMARY_OR_SECONDARY; @@ -3753,6 +3866,7 @@ FileService.prototype._doesDirectoryExist = function (share, directory, primaryO * * @this {FileService} * @param {string} share The share name. +* @param {string} [options.shareSnapshotId] The share snapshot identifier. * @param {string} primaryOnly If true, the request will be executed against the primary storage location. * @param {object} [options] The request options. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. @@ -3782,7 +3896,8 @@ FileService.prototype._doesShareExist = function (share, primaryOnly, optionsOrC var options = extend(true, {}, userOptions); var webResource = WebResource.head(share) - .withQueryOption(QueryStringConstants.RESTYPE, 'share'); + .withQueryOption(QueryStringConstants.RESTYPE, 'share') + .withQueryOption(QueryStringConstants.SHARE_SNAPSHOT, options.shareSnapshotId); /*if(primaryOnly === false) { options.requestLocationMode = RequestLocationMode.PRIMARY_OR_SECONDARY; diff --git a/lib/services/file/fileservice.node.js b/lib/services/file/fileservice.node.js index ef202584..f6d4cef7 100644 --- a/lib/services/file/fileservice.node.js +++ b/lib/services/file/fileservice.node.js @@ -35,6 +35,7 @@ var validate = azureCommon.validate; * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {string} localFileName The local path to the file to be downloaded. * @param {object} [options] The request options. +* @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {boolean} [options.skipSizeCheck] Skip the size check to perform direct download. * Set the option to true for small files. * Parallel download and speed summary won't work with this option on. diff --git a/lib/services/file/fileutilities.js b/lib/services/file/fileutilities.js index be50f397..c227b893 100644 --- a/lib/services/file/fileutilities.js +++ b/lib/services/file/fileutilities.js @@ -56,7 +56,17 @@ var FileUtilities = { OFF: null, SHARE: 'share', FILE: 'file' - } + }, + + /** + * Deletion options for share snapshots + * + * @const + * @enum {string} + */ + ShareSnapshotDeleteOptions: { + SHARE_AND_SNAPSHOTS: 'include' + }, }; module.exports = FileUtilities; \ No newline at end of file diff --git a/package.json b/package.json index e0f1ebbb..087d93ad 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "azure-storage", "author": "Microsoft Corporation", - "version": "2.5.0", + "version": "2.6.0", "description": "Microsoft Azure Storage Client Library for Node.js", "typings": "typings/azure-storage/azure-storage.d.ts", "tags": [ diff --git a/test/recordings/fileservice-sharesnapshot-tests.nock.js b/test/recordings/fileservice-sharesnapshot-tests.nock.js new file mode 100644 index 00000000..66d13e09 --- /dev/null +++ b/test/recordings/fileservice-sharesnapshot-tests.nock.js @@ -0,0 +1,1582 @@ +// This file has been autogenerated. + +exports.setEnvironment = function() { + process.env['AZURE_STORAGE_CONNECTION_STRING'] = 'DefaultEndpointsProtocol=https;AccountName=hasonstg2;AccountKey=null'; +} + +exports.scopes = [[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:33 GMT', + etag: '"0x8D46CD2D4D480AC"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e3159fb3-001a-0001-7bbb-9ecde7000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:33 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:33 GMT', + etag: '"0x8D46CD2D4D480AC"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e3159fb3-001a-0001-7bbb-9ecde7000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:33 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '81cb06e5-001a-0006-33bb-9ea184000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:34 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '81cb06e5-001a-0006-33bb-9ea184000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:34 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:36 GMT', + etag: '"0x8D46CD2D650EE68"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '1532f9d9-001a-001a-6bbb-9ef3e4000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:36 GMT', + etag: '"0x8D46CD2D650EE68"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '1532f9d9-001a-001a-6bbb-9ef3e4000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'oESlnwPMJwZeQ9+FNcNVDA==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '79e2a0b9-001a-0013-61bb-9eb637000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': 'oESlnwPMJwZeQ9+FNcNVDA==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '79e2a0b9-001a-0013-61bb-9eb637000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:36 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=snapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ef3337d8-001a-0047-43bb-9ef960000000', + 'x-ms-version': '2016-10-16', + 'x-ms-snapshot': '2017-03-17T01:13:38.0000000Z', + date: 'Fri, 17 Mar 2017 01:13:37 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=snapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ef3337d8-001a-0047-43bb-9ef960000000', + 'x-ms-version': '2016-10-16', + 'x-ms-snapshot': '2017-03-17T01:13:38.0000000Z', + date: 'Fri, 17 Mar 2017 01:13:37 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b8aa545a-001a-0049-36bb-9ed0d0000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:39 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b8aa545a-001a-0049-36bb-9ed0d0000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:39 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '1091f75d-001a-0038-48bb-9e36fb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:39 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '1091f75d-001a-0038-48bb-9e36fb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:39 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:41 GMT', + etag: '"0x8D46CD2D9D2ACD6"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ac41f246-001a-0008-49bb-9e8834000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:41 GMT', + etag: '"0x8D46CD2D9D2ACD6"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ac41f246-001a-0008-49bb-9e8834000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:41 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': '/F7OplLGrCeoZwemq6IIgQ==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:43 GMT', + etag: '"0x8D46CD2DA844D16"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '972511d1-001a-0033-80bb-9ecd90000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:42 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': '/F7OplLGrCeoZwemq6IIgQ==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:43 GMT', + etag: '"0x8D46CD2DA844D16"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '972511d1-001a-0033-80bb-9ecd90000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:42 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:44 GMT', + etag: '"0x8D46CD2DB35782A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '67da5d81-001a-002b-21bb-9e12f7000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:43 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=properties') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:44 GMT', + etag: '"0x8D46CD2DB35782A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '67da5d81-001a-002b-21bb-9e12f7000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:43 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '8fa3ffbe-001a-0024-2fbb-9e649b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '8fa3ffbe-001a-0024-2fbb-9e649b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:44 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:46 GMT', + etag: '"0x8D46CD2DC97F544"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ea192abb-001a-0012-5dbb-9ee9eb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:45 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:46 GMT', + etag: '"0x8D46CD2DC97F544"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ea192abb-001a-0012-5dbb-9ee9eb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:45 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:47 GMT', + etag: '"0x8D46CD2DD48D22A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'a3cb4a1c-001a-000b-6bbb-9e6950000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:46 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:47 GMT', + etag: '"0x8D46CD2DD48D22A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'a3cb4a1c-001a-000b-6bbb-9e6950000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:46 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': '/F7OplLGrCeoZwemq6IIgQ==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9872effb-001a-0021-1fbb-9eb640000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:48 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .filteringRequestBody(function (path) { return '*';}) +.put('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2?comp=range', '*') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'content-md5': '/F7OplLGrCeoZwemq6IIgQ==', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9872effb-001a-0021-1fbb-9eb640000000', + 'x-ms-version': '2016-10-16', + 'x-ms-request-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:48 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/?comp=list&include=snapshots') + .reply(200, "share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf9232017-03-15T06:55:17.0000000ZWed, 15 Mar 2017 06:55:17 GMT\"0x8D46B703CFFF880\"5120share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf923Wed, 15 Mar 2017 06:55:13 GMT\"0x8D46B703B204A5F\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae512017-03-15T06:56:38.0000000ZWed, 15 Mar 2017 06:56:38 GMT\"0x8D46B706D479700\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae51Wed, 15 Mar 2017 06:56:40 GMT\"0x8D46B706E98B8FC\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bb2017-03-15T07:18:15.0000000ZWed, 15 Mar 2017 07:18:15 GMT\"0x8D46B73725A1580\"5120share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bb2017-03-15T07:18:28.0000000ZWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bbWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef1231502017-03-15T07:19:20.0000000ZWed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef123150Wed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b8282017-03-15T08:16:29.0000000ZWed, 15 Mar 2017 08:16:29 GMT\"0x8D46B7B94F02C80\"5120share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b828Wed, 15 Mar 2017 08:16:30 GMT\"0x8D46B7B95E82A34\"2560share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ce2017-03-15T06:57:54.0000000ZWed, 15 Mar 2017 06:57:54 GMT\"0x8D46B709A944500\"5120share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ceWed, 15 Mar 2017 06:57:56 GMT\"0x8D46B709BF1119C\"2560share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cff2017-03-15T06:59:18.0000000ZWed, 15 Mar 2017 06:59:18 GMT\"0x8D46B70CCA5A700\"5120share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cffWed, 15 Mar 2017 06:59:19 GMT\"0x8D46B70CDAC8724\"2560share-test-snapshot-testdata02017-03-17T01:13:38.0000000ZFri, 17 Mar 2017 01:13:38 GMT\"0x8D46CD2D7784D00\"5120share-test-snapshot-testdata0Fri, 17 Mar 2017 01:13:39 GMT\"0x8D46CD2D863D722\"2560", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '7a81fa9f-001a-0042-17bb-9e2bbb000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:49 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/?comp=list&include=snapshots') + .reply(200, "share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf9232017-03-15T06:55:17.0000000ZWed, 15 Mar 2017 06:55:17 GMT\"0x8D46B703CFFF880\"5120share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf923Wed, 15 Mar 2017 06:55:13 GMT\"0x8D46B703B204A5F\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae512017-03-15T06:56:38.0000000ZWed, 15 Mar 2017 06:56:38 GMT\"0x8D46B706D479700\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae51Wed, 15 Mar 2017 06:56:40 GMT\"0x8D46B706E98B8FC\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bb2017-03-15T07:18:15.0000000ZWed, 15 Mar 2017 07:18:15 GMT\"0x8D46B73725A1580\"5120share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bb2017-03-15T07:18:28.0000000ZWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bbWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef1231502017-03-15T07:19:20.0000000ZWed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef123150Wed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b8282017-03-15T08:16:29.0000000ZWed, 15 Mar 2017 08:16:29 GMT\"0x8D46B7B94F02C80\"5120share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b828Wed, 15 Mar 2017 08:16:30 GMT\"0x8D46B7B95E82A34\"2560share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ce2017-03-15T06:57:54.0000000ZWed, 15 Mar 2017 06:57:54 GMT\"0x8D46B709A944500\"5120share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ceWed, 15 Mar 2017 06:57:56 GMT\"0x8D46B709BF1119C\"2560share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cff2017-03-15T06:59:18.0000000ZWed, 15 Mar 2017 06:59:18 GMT\"0x8D46B70CCA5A700\"5120share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cffWed, 15 Mar 2017 06:59:19 GMT\"0x8D46B70CDAC8724\"2560share-test-snapshot-testdata02017-03-17T01:13:38.0000000ZFri, 17 Mar 2017 01:13:38 GMT\"0x8D46CD2D7784D00\"5120share-test-snapshot-testdata0Fri, 17 Mar 2017 01:13:39 GMT\"0x8D46CD2D863D722\"2560", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '7a81fa9f-001a-0042-17bb-9e2bbb000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:49 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/?comp=list') + .reply(200, "share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf923Wed, 15 Mar 2017 06:55:13 GMT\"0x8D46B703B204A5F\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae51Wed, 15 Mar 2017 06:56:40 GMT\"0x8D46B706E98B8FC\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bbWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef123150Wed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b828Wed, 15 Mar 2017 08:16:30 GMT\"0x8D46B7B95E82A34\"2560share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ceWed, 15 Mar 2017 06:57:56 GMT\"0x8D46B709BF1119C\"2560share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cffWed, 15 Mar 2017 06:59:19 GMT\"0x8D46B70CDAC8724\"2560share-test-snapshot-testdata0Fri, 17 Mar 2017 01:13:39 GMT\"0x8D46CD2D863D722\"2560", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '591ec955-001a-001f-7cbb-9e213f000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:50 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/?comp=list') + .reply(200, "share-test-sharesnapshot-561b6590-094c-11e7-8a29-a9a7fdfcf923Wed, 15 Mar 2017 06:55:13 GMT\"0x8D46B703B204A5F\"5120share-test-sharesnapshot-86721f40-094c-11e7-bd29-a1b5bddcae51Wed, 15 Mar 2017 06:56:40 GMT\"0x8D46B706E98B8FC\"2560share-test-sharesnapshot-8af61960-094f-11e7-87c8-6d35a452a0bbWed, 15 Mar 2017 07:18:16 GMT\"0x8D46B73734DD4D6\"2560share-test-sharesnapshot-a94ea760-094f-11e7-b480-9b72ef123150Wed, 15 Mar 2017 07:19:07 GMT\"0x8D46B739187B638\"2560share-test-sharesnapshot-ae06dea0-0957-11e7-9429-33318af5b828Wed, 15 Mar 2017 08:16:30 GMT\"0x8D46B7B95E82A34\"2560share-test-sharesnapshot-b3ab6c50-094c-11e7-bbf3-c1539697e7ceWed, 15 Mar 2017 06:57:56 GMT\"0x8D46B709BF1119C\"2560share-test-sharesnapshot-e56c3d50-094c-11e7-876e-c9bc7fd87cffWed, 15 Mar 2017 06:59:19 GMT\"0x8D46B70CDAC8724\"2560share-test-snapshot-testdata0Fri, 17 Mar 2017 01:13:39 GMT\"0x8D46CD2D863D722\"2560", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '591ec955-001a-001f-7cbb-9e213f000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:13:50 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '34d24a45-001a-0035-69bb-9efe2f000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-basem1': 'baseV1', + 'x-ms-meta-basem2': 'baseV2', + 'x-ms-meta-basem3': 'baseV3', + 'x-ms-share-quota': '2560', + date: 'Fri, 17 Mar 2017 01:13:52 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '34d24a45-001a-0035-69bb-9efe2f000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-basem1': 'baseV1', + 'x-ms-meta-basem2': 'baseV2', + 'x-ms-meta-basem3': 'baseV3', + 'x-ms-share-quota': '2560', + date: 'Fri, 17 Mar 2017 01:13:52 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '199f42d7-001a-0023-05bb-9e08f8000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + 'x-ms-share-quota': '5120', + date: 'Fri, 17 Mar 2017 01:13:53 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '199f42d7-001a-0023-05bb-9e08f8000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + 'x-ms-share-quota': '5120', + date: 'Fri, 17 Mar 2017 01:13:53 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '726c952c-001a-001c-41bb-9ec05b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-basem1': 'baseV1', + 'x-ms-meta-basem2': 'baseV2', + 'x-ms-meta-basem3': 'baseV3', + date: 'Fri, 17 Mar 2017 01:13:54 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '726c952c-001a-001c-41bb-9ec05b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-basem1': 'baseV1', + 'x-ms-meta-basem2': 'baseV2', + 'x-ms-meta-basem3': 'baseV3', + date: 'Fri, 17 Mar 2017 01:13:54 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cbb80328-001a-0028-47bb-9ef393000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + date: 'Fri, 17 Mar 2017 01:13:56 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cbb80328-001a-0028-47bb-9ef393000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + date: 'Fri, 17 Mar 2017 01:13:56 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '21bf21c7-001a-003f-6bbb-9e5a98000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + 'x-ms-share-quota': '5120', + date: 'Fri, 17 Mar 2017 01:13:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:38 GMT', + etag: '"0x8D46CD2D7784D00"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '21bf21c7-001a-003f-6bbb-9e5a98000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-snapshotm1': 'snapshotV1', + 'x-ms-meta-snapshotm2': 'snapshotV2', + 'x-ms-meta-snapshotm3': 'snapshotV3', + 'x-ms-share-quota': '5120', + date: 'Fri, 17 Mar 2017 01:13:57 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5a446eaf-001a-0041-2abb-9ecadf000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:13:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5a446eaf-001a-0041-2abb-9ecadf000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:13:57 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:46 GMT', + etag: '"0x8D46CD2DC97F544"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e5ced95b-001a-003a-7abb-9e8843000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:59 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:46 GMT', + etag: '"0x8D46CD2DC97F544"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e5ced95b-001a-003a-7abb-9e8843000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:13:59 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ff3b406d-001a-0032-43bb-9e924c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ff3b406d-001a-0032-43bb-9e924c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:00 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e9413259-001a-0044-61bb-9e1804000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:01 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e9413259-001a-0044-61bb-9e1804000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:01 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0?restype=directory&comp=list') + .reply(200, "testdirectoryforsharesnapshottestdirectoryforsharesnapshot2", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4846800a-001a-0019-70bb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:02 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0?restype=directory&comp=list') + .reply(200, "testdirectoryforsharesnapshottestdirectoryforsharesnapshot2", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4846800a-001a-0019-70bb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:02 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0?restype=directory&comp=list&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testdirectoryforsharesnapshot", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '56ec4673-001a-001e-70bb-9e7ee3000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:04 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0?restype=directory&comp=list&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testdirectoryforsharesnapshot", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '56ec4673-001a-001e-70bb-9e7ee3000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:04 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9d9a1340-001a-002a-30bb-9e4d2b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9d9a1340-001a-002a-30bb-9e4d2b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:05 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9872f015-001a-0021-25bb-9eb640000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:06 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9872f015-001a-0021-25bb-9eb640000000', + 'x-ms-version': '2016-10-16', + 'x-ms-server-encrypted': 'false', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:06 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c0f3c47e-001a-0039-0abb-9e6927000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:07 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:40 GMT', + etag: '"0x8D46CD2D9210C8C"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'c0f3c47e-001a-0039-0abb-9e6927000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-dirmetadata1updated': 'value1updated', + 'x-ms-meta-dirmetadata2updated': 'value2updated', + 'x-ms-meta-dirmetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:07 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cf500f43-001a-0045-35bb-9e47d8000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:09 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot?restype=directory&comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:34 GMT', + etag: '"0x8D46CD2D59DA06D"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'cf500f43-001a-0045-35bb-9e47d8000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-dirmetadata1': 'value1', + 'x-ms-meta-dirmetadata2': 'value2', + 'x-ms-meta-dirmetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:09 GMT', + connection: 'close' }); + return result; }], +[], +[], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ff3b407b-001a-0032-46bb-9e924c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:09 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ff3b407b-001a-0032-46bb-9e924c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:09 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd1609be6-001a-0030-27bb-9e2cf4000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:11 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd1609be6-001a-0030-27bb-9e2cf4000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:11 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '580a64a6-001a-0020-76bb-9ee99c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:12 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '580a64a6-001a-0020-76bb-9ee99c000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + date: 'Fri, 17 Mar 2017 01:14:12 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e9413271-001a-0044-66bb-9e1804000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:13 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=metadata&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e9413271-001a-0044-66bb-9e1804000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + date: 'Fri, 17 Mar 2017 01:14:13 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(200, "", { 'content-length': '19', + 'content-type': 'application/octet-stream', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b00eb822-001a-000c-4dbb-9e0533000000', + 'x-ms-version': '2016-10-16', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:14 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(200, "", { 'content-length': '19', + 'content-type': 'application/octet-stream', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'b00eb822-001a-000c-4dbb-9e0533000000', + 'x-ms-version': '2016-10-16', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:14 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '48468025-001a-0019-75bb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:15 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '48468025-001a-0019-75bb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:15 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '56ec468c-001a-001e-75bb-9e7ee3000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:17 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '56ec468c-001a-001e-75bb-9e7ee3000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:17 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=rangelist') + .reply(200, "018", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '90a18a44-001a-001b-29bb-9eac38000000', + 'x-ms-version': '2016-10-16', + 'x-ms-content-length': '19', + date: 'Fri, 17 Mar 2017 01:14:18 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=rangelist') + .reply(200, "018", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '90a18a44-001a-001b-29bb-9eac38000000', + 'x-ms-version': '2016-10-16', + 'x-ms-content-length': '19', + date: 'Fri, 17 Mar 2017 01:14:18 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=rangelist&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "011", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5b39f3d9-001a-0000-3cbb-9e923b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-content-length': '12', + date: 'Fri, 17 Mar 2017 01:14:19 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?comp=rangelist&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "011", { 'transfer-encoding': 'chunked', + 'content-type': 'application/xml', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '5b39f3d9-001a-0000-3cbb-9e923b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-content-length': '12', + date: 'Fri, 17 Mar 2017 01:14:19 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(200, "testfiletextupdated", { 'content-length': '19', + 'content-type': 'application/octet-stream', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e5117114-001a-0036-26bb-9e1f4b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:20 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot2/testfileforsharesnapshot2') + .reply(200, "testfiletextupdated", { 'content-length': '19', + 'content-type': 'application/octet-stream', + 'last-modified': 'Fri, 17 Mar 2017 01:13:48 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2DDF9AF1A"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'e5117114-001a-0036-26bb-9e1f4b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:20 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testfiletext", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ef333816-001a-0047-4ebb-9ef960000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:21 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testfiletext", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ef333816-001a-0047-4ebb-9ef960000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:21 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ac41f282-001a-0008-54bb-9e8834000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:22 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ac41f282-001a-0008-54bb-9e8834000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:22 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "testfiletextupdated", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '97251205-001a-0033-0bbb-9ecd90000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:23 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot') + .reply(200, "testfiletextupdated", { 'content-length': '19', + 'content-type': 'filecontentypeupdated', + 'last-modified': 'Fri, 17 Mar 2017 01:13:45 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2DBE6A331"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '97251205-001a-0033-0bbb-9ecd90000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1updated': 'value1updated', + 'x-ms-meta-filemetadata2updated': 'value2updated', + 'x-ms-meta-filemetadata3updated': 'value3updated', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:23 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ea192aee-001a-0012-67bb-9ee9eb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:31 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'ea192aee-001a-0012-67bb-9ee9eb000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:31 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testfiletext", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'f2a6686b-001a-0017-26bb-9e3b30000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:32 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .get('/share-test-snapshot-testdata0/testdirectoryforsharesnapshot/testfileforsharesnapshot?sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(200, "testfiletext", { 'content-length': '12', + 'content-type': 'filecontentype', + 'last-modified': 'Fri, 17 Mar 2017 01:13:37 GMT', + 'accept-ranges': 'bytes', + etag: '"0x8D46CD2D7043C63"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'f2a6686b-001a-0017-26bb-9e3b30000000', + 'x-ms-version': '2016-10-16', + 'x-ms-meta-filemetadata1': 'value1', + 'x-ms-meta-filemetadata2': 'value2', + 'x-ms-meta-filemetadata3': 'value3', + 'x-ms-type': 'File', + 'x-ms-server-encrypted': 'false', + date: 'Fri, 17 Mar 2017 01:14:32 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share') + .reply(409, "ShareHasSnapshotsThe share has snapshots and the operation requires no snapshots.\nRequestId:10e2773e-001a-002d-1abb-9e2148000000\nTime:2017-03-17T01:14:34.9576514Z", { 'content-length': '250', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '10e2773e-001a-002d-1abb-9e2148000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:34 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share') + .reply(409, "ShareHasSnapshotsThe share has snapshots and the operation requires no snapshots.\nRequestId:10e2773e-001a-002d-1abb-9e2148000000\nTime:2017-03-17T01:14:34.9576514Z", { 'content-length': '250', + 'content-type': 'application/xml', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '10e2773e-001a-002d-1abb-9e2148000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:34 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd1609c48-001a-0030-67bb-9e2cf4000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:35 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': 'd1609c48-001a-0030-67bb-9e2cf4000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:35 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4846803b-001a-0019-7abb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:36 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share&sharesnapshot=2017-03-17T01%3A13%3A38.0000000Z') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4846803b-001a-0019-7abb-9e1280000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:36 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=snapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9d9a136d-001a-002a-3abb-9e4d2b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-snapshot': '2017-03-17T01:14:38.0000000Z', + date: 'Fri, 17 Mar 2017 01:14:38 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .put('/share-test-snapshot-testdata0?restype=share&comp=snapshot') + .reply(201, "", { 'transfer-encoding': 'chunked', + 'last-modified': 'Fri, 17 Mar 2017 01:13:39 GMT', + etag: '"0x8D46CD2D863D722"', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '9d9a136d-001a-002a-3abb-9e4d2b000000', + 'x-ms-version': '2016-10-16', + 'x-ms-snapshot': '2017-03-17T01:14:38.0000000Z', + date: 'Fri, 17 Mar 2017 01:14:38 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4fa84f2a-001a-0016-25bb-9e64ec000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:38 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .delete('/share-test-snapshot-testdata0?restype=share') + .reply(202, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4fa84f2a-001a-0016-25bb-9e64ec000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:38 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4cde95a6-001a-0018-0cbb-9e4d5c000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:40 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://hasonstg2.file.core.windows.net:443') + .head('/share-test-snapshot-testdata0?restype=share') + .reply(404, "", { 'transfer-encoding': 'chunked', + server: 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id': '4cde95a6-001a-0018-0cbb-9e4d5c000000', + 'x-ms-version': '2016-10-16', + date: 'Fri, 17 Mar 2017 01:14:40 GMT', + connection: 'close' }); + return result; }]]; \ No newline at end of file diff --git a/test/services/file/fileservice-file-tests.js b/test/services/file/fileservice-file-tests.js index 202f85d7..71c73e07 100644 --- a/test/services/file/fileservice-file-tests.js +++ b/test/services/file/fileservice-file-tests.js @@ -99,6 +99,7 @@ describe('File', function () { var directory = 'directory'; var file = 'file' var fileServiceForUrl = azure.createFileService('storageAccount', 'storageAccessKey'); + var shareSnapshotId = '2017-05-10T04:40:00.0000000Z'; var url; it('Directory and file', function (done) { @@ -106,6 +107,10 @@ describe('File', function () { url = fileServiceForUrl.getUrl(share, directory, file, null, true); assert.strictEqual(url, 'https://host.com/' + share + '/' + directory + '/' + file); + fileServiceForUrl.setHost({ primaryHost: 'host.com' }); + url = fileServiceForUrl.getUrl(share, directory, file, null, true, shareSnapshotId); + assert.strictEqual(url, 'https://host.com/' + share + '/' + directory + '/' + file + '?sharesnapshot=2017-05-10T04%3A40%3A00.0000000Z'); + fileServiceForUrl.setHost({ primaryHost: 'http://host.com:80' }); url = fileServiceForUrl.getUrl(share, directory, file, null, true); assert.strictEqual(url, 'http://host.com/' + share + '/' + directory + '/' + file); @@ -157,9 +162,15 @@ describe('File', function () { fileServiceForUrl.setHost({ primaryHost: 'host.com' }); url = fileServiceForUrl.getUrl(share, directory, null, null, true); assert.strictEqual(url, 'https://host.com/' + share + '/' + directory); - url = fileServiceForUrl.getUrl(share, directory, '', true); + url = fileServiceForUrl.getUrl(share, directory, '', null, true); assert.strictEqual(url, 'https://host.com/' + share + '/' + directory); + fileServiceForUrl.setHost({ primaryHost: 'host.com' }); + url = fileServiceForUrl.getUrl(share, directory, null, null, true, shareSnapshotId); + assert.strictEqual(url, 'https://host.com/' + share + '/' + directory + '?sharesnapshot=2017-05-10T04%3A40%3A00.0000000Z'); + url = fileServiceForUrl.getUrl(share, directory, '', null, true, shareSnapshotId); + assert.strictEqual(url, 'https://host.com/' + share + '/' + directory + '?sharesnapshot=2017-05-10T04%3A40%3A00.0000000Z'); + fileServiceForUrl.setHost({ primaryHost: 'http://host.com:80' }); url = fileServiceForUrl.getUrl(share, directory, null, null, true); assert.strictEqual(url, 'http://host.com/' + share + '/' + directory); @@ -199,6 +210,12 @@ describe('File', function () { assert.strictEqual(url, 'https://host.com/' + share); url = fileServiceForUrl.getUrl(share, '', file, null, true); assert.strictEqual(url, 'https://host.com/' + share + '/' + file); + + fileServiceForUrl.setHost({ primaryHost: 'host.com' }); + url = fileServiceForUrl.getUrl(share, '', null, null, true, shareSnapshotId); + assert.strictEqual(url, 'https://host.com/' + share + '?sharesnapshot=2017-05-10T04%3A40%3A00.0000000Z'); + url = fileServiceForUrl.getUrl(share, '', file, null, true, shareSnapshotId); + assert.strictEqual(url, 'https://host.com/' + share + '/' + file + '?sharesnapshot=2017-05-10T04%3A40%3A00.0000000Z'); fileServiceForUrl.setHost({ primaryHost: 'http://host.com:80' }); url = fileServiceForUrl.getUrl(share, '', null, null, true); diff --git a/test/services/file/fileservice-sharesnapshot-tests.js b/test/services/file/fileservice-sharesnapshot-tests.js new file mode 100644 index 00000000..8f721e6e --- /dev/null +++ b/test/services/file/fileservice-sharesnapshot-tests.js @@ -0,0 +1,587 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +var assert = require('assert'); +var url = require('url'); +var fs = require('fs'); + +// Lib includes +var testutil = require('../../framework/util'); +var SR = testutil.libRequire('common/util/sr'); +var TestSuite = require('../../framework/test-suite'); +var errors = testutil.libRequire('common/errors/errors'); +var ArgumentError = errors.ArgumentError; +var ArgumentNullError = errors.ArgumentNullError; +var TimeoutError = errors.TimeoutError; +var StorageError = errors.StorageError; + +var azure = testutil.libRequire('azure-storage'); + +var Constants = azure.Constants; +var FileUtilities = azure.FileUtilities; +var HttpConstants = Constants.HttpConstants; + +var shareNamesPrefix = 'share-test-snapshot-'; + +var fileService; +var shareName; +var directoryName = 'testdirectoryforsharesnapshot'; +var directoryName2 = 'testdirectoryforsharesnapshot2'; +var fileName = 'testfileforsharesnapshot'; +var fileName2 = 'testfileforsharesnapshot2'; +var fileText = 'testfiletext'; +var fileTextUpdated = 'testfiletextupdated'; +var downloadFileName = 'fileservice_snapshottest_download.tmp'; + +var shareSnapshotId; + +var baseShareMetadata = { + 'basem1': 'baseV1', + 'basem2': 'baseV2', + 'basem3': 'baseV3', +}; + +var shareSnapshotMetadata = { + 'snapshotm1': 'snapshotV1', + 'snapshotm2': 'snapshotV2', + 'snapshotm3': 'snapshotV3', +}; + +var directoryMetadata = { + 'dirmetadata1': 'value1', + 'dirmetadata2': 'value2', + 'dirmetadata3': 'value3', +}; + +var directoryMetadataUpdated = { + 'dirmetadata1updated': 'value1updated', + 'dirmetadata2updated': 'value2updated', + 'dirmetadata3updated': 'value3updated', +}; + +var fileMetadata = { + 'filemetadata1': 'value1', + 'filemetadata2': 'value2', + 'filemetadata3': 'value3', +}; +var fileMetadataUpdated = { + 'filemetadata1updated': 'value1updated', + 'filemetadata2updated': 'value2updated', + 'filemetadata3updated': 'value3updated', +}; + +var fileContentType = 'filecontentype'; +var fileContentTypeUpdated = 'filecontentypeupdated'; + +var suite = new TestSuite('fileservice-sharesnapshot-tests'); +var runOrSkip = suite.isMocked ? it.skip : it; +var timeout = (suite.isRecording || !suite.isMocked) ? 30000 : 10; + +describe('FileShare', function () { + before(function (done) { + if (suite.isMocked) { + testutil.POLL_REQUEST_INTERVAL = 0; + } + shareName = suite.getName(shareNamesPrefix); + suite.setupSuite(function () { + fileService = azure.createFileService().withFilter(new azure.ExponentialRetryPolicyFilter()); + done(); + }); + }); + + after(function (done) { + try { fs.unlinkSync(downloadFileName); } catch (e) {} + suite.teardownSuite(done); + }); + + beforeEach(function (done) { + suite.setupTest(done); + }); + + afterEach(function (done) { + suite.teardownTest(done); + }); + + describe('createShare', function () { + it('Prepare the base share', function (done) { + fileService.createShare(shareName, { metadata: baseShareMetadata }, function (error, result) { + assert.equal(error, null); + + fileService.createDirectory(shareName, directoryName, {metadata: directoryMetadata}, function (error, result) { + assert.equal(error, null); + + fileService.createFileFromText(shareName, directoryName, fileName, fileText, {contentSettings: {contentType: fileContentType}, metadata: fileMetadata}, function (error, result) { + assert.equal(error, null); + done(); + }); + }); + }); + }); + }); + + describe('createShareSnapshot', function () { + it('should work', function (done) { + fileService.createShareSnapshot(shareName, { metadata: shareSnapshotMetadata }, function (error, result) { + assert.equal(error, null); + assert.notEqual(result, null); + + shareSnapshotId = result; + + // Update the base share properties after creating the share snapshot + fileService.setShareProperties(shareName, {quota: 2560}, function (error, result) { + assert.equal(error, null); + + // update the directory metadata in the base share + fileService.setDirectoryMetadata(shareName, directoryName, directoryMetadataUpdated, function (error, result) { + assert.equal(error, null); + + // Update the existing file content + fileService.createFileFromText(shareName, directoryName, fileName, fileTextUpdated, function (error, result) { + assert.equal(error, null); + + fileService.setFileProperties(shareName, directoryName, fileName, {contentType: fileContentTypeUpdated}, function (error, result) { + assert.equal(error, null); + + fileService.setFileMetadata(shareName, directoryName, fileName, fileMetadataUpdated, function (error, result) { + assert.equal(error, null); + + // Create a new directory which does not exist in the share snapshot + fileService.createDirectory(shareName, directoryName2, function (error, result) { + assert.equal(error, null); + + // Create a new file which does not exist in the share snapshot + fileService.createFileFromText(shareName, directoryName2, fileName2, fileTextUpdated, function (error, result) { + assert.equal(error, null); + done(); + }); + }); + }); + }); + }); + }); + }); + }); + }); + }); + + describe('listShares', function () { + it('include snapshot should work', function (done) { + listShares(null, {include: 'snapshots'}, null, function (shares) { + var testShares = shares.filter(function(element){ + return element.name == shareName; + }); + + assert.equal(2, testShares.length); + + var baseShare = testShares.find(function (element) { + return !element.snapshot; + }); + var shareSnapshot = testShares.find(function (element) { + return element.snapshot; + }); + assert.notEqual(baseShare, null); + assert.notEqual(shareSnapshot, null); + assert.equal(shareSnapshot.snapshot, shareSnapshotId); + + done(); + }); + }); + + it('include no snapshot should work', function (done) { + listShares(null, null, null, function (shares) { + var testShares = shares.filter(function(element){ + return element.name == shareName; + }); + + assert.equal(1, testShares.length); + done(); + }); + }); + }); + + describe('getShareProperties & getShareMetadata', function () { + it('get base share properties should work', function (done) { + fileService.getShareProperties(shareName, null, function (error, result) { + assert.equal(result.name, shareName); + assert.equal(result.quota, 2560); + assert.equal(result.metadata['basem1'], baseShareMetadata['basem1']); + assert.equal(result.metadata['basem2'], baseShareMetadata['basem2']); + assert.equal(result.metadata['basem3'], baseShareMetadata['basem3']); + done(); + }); + }); + + it('get share snapshot properties should work', function (done) { + fileService.getShareProperties(shareName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(result.name, shareName); + assert.equal(result.quota, 5120); + assert.equal(result.metadata['snapshotm1'], shareSnapshotMetadata['snapshotm1']); + assert.equal(result.metadata['snapshotm2'], shareSnapshotMetadata['snapshotm2']); + assert.equal(result.metadata['snapshotm3'], shareSnapshotMetadata['snapshotm3']); + done(); + }); + }); + + it('get base share metadata should work', function (done) { + fileService.getShareMetadata(shareName, null, function (error, result) { + assert.equal(result.name, shareName); + + assert.equal(result.metadata['basem1'], baseShareMetadata['basem1']); + assert.equal(result.metadata['basem2'], baseShareMetadata['basem2']); + assert.equal(result.metadata['basem3'], baseShareMetadata['basem3']); + done(); + }); + }); + + it('get share snapshot metadata should work', function (done) { + fileService.getShareMetadata(shareName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(result.name, shareName); + assert.equal(result.metadata['snapshotm1'], shareSnapshotMetadata['snapshotm1']); + assert.equal(result.metadata['snapshotm2'], shareSnapshotMetadata['snapshotm2']); + assert.equal(result.metadata['snapshotm3'], shareSnapshotMetadata['snapshotm3']); + done(); + }); + }); + }); + + describe('doesShareExist', function () { + it('should work with share snapshot', function (done) { + fileService.doesShareExist(shareName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(result.exists, true); + assert.equal(result.name, shareName); + assert.equal(result.quota, 5120); + done(); + }); + }); + }); + + describe('doesDirectoryExist', function () { + it('should work with base share', function (done) { + fileService.doesDirectoryExist(shareName, directoryName, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, true); + assert.equal(result.name, directoryName); + + fileService.doesDirectoryExist(shareName, directoryName2, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, true); + assert.equal(result.name, directoryName2); + done(); + }); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.doesDirectoryExist(shareName, directoryName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, true); + assert.equal(result.name, directoryName); + + fileService.doesDirectoryExist(shareName, directoryName2, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, false); + done(); + }); + }); + }); + }); + + describe('listFilesAndDirectoriesSegmented', function () { + it('should work with base share', function (done) { + fileService.listFilesAndDirectoriesSegmented(shareName, '', null, function (error, result) { + assert.equal(error, null); + assert.equal(result.entries.directories.length, 2); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.listFilesAndDirectoriesSegmented(shareName, '', null, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.entries.directories.length, 1); + done(); + }); + }); + }); + + describe('getDirectoryProperties', function () { + it('should work with base share', function (done) { + fileService.getDirectoryProperties(shareName, directoryName, function (error, result) { + assert.equal(error, null); + assert.equal(result.name, directoryName); + assert.equal(result.metadata['dirmetadata1updated'], directoryMetadataUpdated['dirmetadata1updated']); + assert.equal(result.metadata['dirmetadata2updated'], directoryMetadataUpdated['dirmetadata2updated']); + assert.equal(result.metadata['dirmetadata3updated'], directoryMetadataUpdated['dirmetadata3updated']); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.getDirectoryProperties(shareName, directoryName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.name, directoryName); + assert.equal(result.metadata['dirmetadata1'], directoryMetadata['dirmetadata1']); + assert.equal(result.metadata['dirmetadata2'], directoryMetadata['dirmetadata2']); + assert.equal(result.metadata['dirmetadata3'], directoryMetadata['dirmetadata3']); + done(); + }); + }); + }); + + describe('getDirectoryMetadata', function () { + it('should work with base share', function (done) { + fileService.getDirectoryMetadata(shareName, directoryName, function (error, result) { + assert.equal(error, null); + assert.equal(result.name, directoryName); + assert.equal(result.metadata['dirmetadata1updated'], directoryMetadataUpdated['dirmetadata1updated']); + assert.equal(result.metadata['dirmetadata2updated'], directoryMetadataUpdated['dirmetadata2updated']); + assert.equal(result.metadata['dirmetadata3updated'], directoryMetadataUpdated['dirmetadata3updated']); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.getDirectoryMetadata(shareName, directoryName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.name, directoryName); + assert.equal(result.metadata['dirmetadata1'], directoryMetadata['dirmetadata1']); + assert.equal(result.metadata['dirmetadata2'], directoryMetadata['dirmetadata2']); + assert.equal(result.metadata['dirmetadata3'], directoryMetadata['dirmetadata3']); + done(); + }); + }); + }); + + describe('getUrl', function () { + it('should work with base share', function (done) { + var fileUrl = fileService.getUrl(shareName, directoryName, fileName, 'q=faketoken', true /*primary*/, '2017-03-15T09:18:00.0000000Z' /*shareSnapshotId*/); + var parsedUrl = url.parse(fileUrl); + assert.strictEqual(parsedUrl.query, 'q=faketoken&sharesnapshot=2017-03-15T09%3A18%3A00.0000000Z'); + done(); + }); + + it('should work with share snapshot', function (done) { + var fileUrl = fileService.getUrl(shareName, directoryName, fileName, 'q=faketoken', true /*primary*/, null /*shareSnapshotId*/); + var parsedUrl = url.parse(fileUrl); + assert.strictEqual(parsedUrl.query, 'q=faketoken'); + done(); + }); + }); + + describe('getFileProperties', function () { + it('should work with base share', function (done) { + var fileUrl = fileService.getFileProperties(shareName, directoryName, fileName, function (error, result) { + assert.equal(error, null); + assert.equal(result.contentSettings.contentType, fileContentTypeUpdated); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + var fileUrl = fileService.getFileProperties(shareName, directoryName, fileName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.contentSettings.contentType, fileContentType); + done(); + }); + }); + }); + + describe('getFileMetadata', function () { + it('should work with base share', function (done) { + var fileUrl = fileService.getFileMetadata(shareName, directoryName, fileName, function (error, result) { + assert.equal(error, null); + assert.equal(result.metadata['filemetadata1updated'], fileMetadataUpdated['filemetadata1updated']); + assert.equal(result.metadata['filemetadata2updated'], fileMetadataUpdated['filemetadata2updated']); + assert.equal(result.metadata['filemetadata3updated'], fileMetadataUpdated['filemetadata3updated']); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + var fileUrl = fileService.getFileMetadata(shareName, directoryName, fileName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.metadata['filemetadata1'], fileMetadata['filemetadata1']); + assert.equal(result.metadata['filemetadata2'], fileMetadata['filemetadata2']); + assert.equal(result.metadata['filemetadata3'], fileMetadata['filemetadata3']); + done(); + }); + }); + }); + + describe('doesFileExist', function () { + it('should work with base share', function (done) { + fileService.doesFileExist(shareName, directoryName2, fileName2, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, true); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.doesFileExist(shareName, directoryName2, fileName2, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, false); + + fileService.doesFileExist(shareName, directoryName, fileName, {shareSnapshotId: shareSnapshotId}, function (error, result) { + assert.equal(error, null); + assert.equal(result.exists, true); + + done(); + }); + }); + }); + }); + + describe('listRanges', function () { + it('should work with base share', function (done) { + fileService.listRanges(shareName, directoryName, fileName, function (error, ranges) { + assert.equal(error, null); + assert.equal(ranges.length, 1); + assert.equal(ranges[0].start, 0); + assert.equal(ranges[0].end, Buffer.byteLength(fileTextUpdated) - 1); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.listRanges(shareName, directoryName, fileName, {shareSnapshotId: shareSnapshotId}, function (error, ranges) { + assert.equal(error, null); + assert.equal(ranges.length, 1); + assert.equal(ranges[0].start, 0); + assert.equal(ranges[0].end, Buffer.byteLength(fileText) - 1); + done(); + }); + }); + }); + + describe('getFileToText', function () { + it('should work with base share', function (done) { + fileService.getFileToText(shareName, directoryName2, fileName2, function (error, text) { + assert.equal(error, null); + assert.equal(text, fileTextUpdated); + done(); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.getFileToText(shareName, directoryName, fileName, {shareSnapshotId, shareSnapshotId}, function (error, text) { + assert.equal(error, null); + assert.equal(text, fileText); + done(); + }); + }); + }); + + describe('getFileToStream', function () { + it('should work with base share', function (done) { + fileService.getFileToStream(shareName, directoryName, fileName, fs.createWriteStream(downloadFileName), function (error, result, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.ok(result); + assert.equal(result.share, shareName); + assert.equal(result.directory, directoryName); + assert.equal(result.name, fileName); + + + var exists = fs.existsSync(downloadFileName); + assert.equal(exists, true); + + fs.readFile(downloadFileName, function (error, text) { + assert.equal(text, fileTextUpdated); + done(); + }); + }); + }); + + it('should work with share snapshot', function (done) { + fileService.getFileToStream(shareName, directoryName, fileName, fs.createWriteStream(downloadFileName), {shareSnapshotId: shareSnapshotId}, function (error, result, response) { + assert.equal(error, null); + assert.ok(response.isSuccessful); + assert.ok(result); + assert.equal(result.share, shareName); + assert.equal(result.directory, directoryName); + assert.equal(result.name, fileName); + + + var exists = fs.existsSync(downloadFileName); + assert.equal(exists, true); + + fs.readFile(downloadFileName, function (error, text) { + assert.equal(text, fileText); + done(); + }); + }); + }); + }); + + describe('deleteShare', function () { + it('delete share with snapshot should fail by default', function (done) { + fileService.deleteShare(shareName, function(error, result) { + assert.notEqual(error, null); + done(); + }); + }); + + it('delete share snapshot only should work', function (done) { + fileService.deleteShare(shareName, {shareSnapshotId: shareSnapshotId}, function(error, result) { + assert.equal(error, null); + + fileService.getShareProperties(shareName, {shareSnapshotId: shareSnapshotId}, function(error, result) { + // Snapshot should not exist any more + assert.notEqual(error, null); + done(); + }); + }); + }); + + it('delete share include snapshots should work', function (done) { + // Create another snapshot and forcely delete the share + fileService.createShareSnapshot(shareName, function (error, result) { + assert.equal(error, null); + fileService.deleteShare(shareName, { deleteSnapshots: FileUtilities.ShareSnapshotDeleteOptions.SHARE_AND_SNAPSHOTS }, function(error, result) { + assert.equal(error, null); + + fileService.getShareProperties(shareName, function(error, result) { + // Share should not exist any more + assert.notEqual(error, null); + done(); + }); + }); + }); + }); + }); +}); + +function listShares (prefix, options, token, callback) { + var entries = []; + // Helper function that allows us to do a full listing. + var recursionHelper = function(err, result) { + assert.equal(err, null); + entries.push.apply(entries, result.entries); + + if (result.continuationToken) { + // call list shares again with the new continuation token + fileService.listSharesSegmentedWithPrefix( + prefix, + result.continuationToken, + options, + recursionHelper); + } else { + callback(entries); + } + }; + + fileService.listSharesSegmentedWithPrefix(prefix, token, options, recursionHelper); +} \ No newline at end of file diff --git a/typings/azure-storage/azure-storage.d.ts b/typings/azure-storage/azure-storage.d.ts index dc61a484..99a3573f 100644 --- a/typings/azure-storage/azure-storage.d.ts +++ b/typings/azure-storage/azure-storage.d.ts @@ -5941,7 +5941,7 @@ declare module azurestorage { * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage. - * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata') + * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them) * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. * The maximum execution time interval begins at the time that the client begins building the request. The maximum @@ -5954,7 +5954,7 @@ declare module azurestorage { * `entries` gives a list of shares and the `continuationToken` is used for the next listing operation. * `response` will contain information related to this operation. */ - listSharesSegmented(currentToken: common.ContinuationToken, options: FileService.ListRequestOptions, callback: ErrorOrResult): void; + listSharesSegmented(currentToken: common.ContinuationToken, options: FileService.ListShareRequestOptions, callback: ErrorOrResult): void; listSharesSegmented(currentToken: common.ContinuationToken, callback: ErrorOrResult): void; /** @@ -5968,7 +5968,7 @@ declare module azurestorage { * Please see StorageUtilities.LocationMode for the possible values. * @param {string} [options.prefix] Filters the results to return only shares whose name begins with the specified prefix. * @param {int} [options.maxResults] Specifies the maximum number of shares to return per call to Azure storage. - * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata') + * @param {string} [options.include] Include this parameter to specify that the share's metadata be returned as part of the response body. (allowed values: '', 'metadata', 'snapshots' or any combination of them) * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. * The maximum execution time interval begins at the time that the client begins building the request. The maximum @@ -5981,7 +5981,7 @@ declare module azurestorage { * `entries` gives a list of shares and the `continuationToken` is used for the next listing operation. * `response` will contain information related to this operation. */ - listSharesSegmentedWithPrefix(prefix: string, currentToken: common.ContinuationToken, options: FileService.ListRequestOptions, callback: ErrorOrResult): void; + listSharesSegmentedWithPrefix(prefix: string, currentToken: common.ContinuationToken, options: FileService.ListShareRequestOptions, callback: ErrorOrResult): void; listSharesSegmentedWithPrefix(prefix: string, currentToken: common.ContinuationToken, callback: ErrorOrResult): void; /** @@ -5990,6 +5990,7 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6004,7 +6005,7 @@ declare module azurestorage { * be true if the share exists, or false if the share does not exist. * `response` will contain information related to this operation. */ - doesShareExist(share: string, options: common.RequestOptions, callback: ErrorOrResult): void; + doesShareExist(share: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; doesShareExist(share: string, callback: ErrorOrResult): void; /** @@ -6033,6 +6034,9 @@ declare module azurestorage { createShare(share: string, options: FileService.CreateShareRequestOptions, callback: ErrorOrResult): void; createShare(share: string, callback: ErrorOrResult): void; + createShareSnapshot(share: string, options: common.RequestOptions, callback: ErrorOrResult): void; + createShareSnapshot(share: string, callback: ErrorOrResult): void; + /** * Creates a new share under the specified account if the share does not exists. * @@ -6074,6 +6078,7 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6088,7 +6093,7 @@ declare module azurestorage { * information for the share. * `response` will contain information related to this operation. */ - getShareProperties(share: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getShareProperties(share: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getShareProperties(share: string, callback: ErrorOrResult): void; /** @@ -6141,6 +6146,7 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6155,7 +6161,7 @@ declare module azurestorage { * information for the share. * `response` will contain information related to this operation. */ - getShareMetadata(share: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getShareMetadata(share: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getShareMetadata(share: string, callback: ErrorOrResult): void; /** @@ -6190,6 +6196,8 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {Object} [options] The request options. + * @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6236,6 +6244,8 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {Object} [options] The request options. + * @param {string} [options.deleteSnapshots] The snapshot delete option. See azure.FileUtilities.ShareSnapshotDeleteOptions.*. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6249,7 +6259,7 @@ declare module azurestorage { * if an error occurs; otherwise * `response` will contain information related to this operation. */ - deleteShare(share: string, options: common.RequestOptions, callback: ErrorOrResponse): void; + deleteShare(share: string, options: FileService.DeleteShareOptions, callback: ErrorOrResponse): void; deleteShare(share: string, callback: ErrorOrResponse): void; /** @@ -6274,7 +6284,7 @@ declare module azurestorage { * did not exist. * `response` will contain information related to this operation. */ - deleteShareIfExists(share: string, options: common.RequestOptions, callback: ErrorOrResult): void; + deleteShareIfExists(share: string, options: FileService.DeleteShareOptions, callback: ErrorOrResult): void; deleteShareIfExists(share: string, callback: ErrorOrResult): void; /** @@ -6284,6 +6294,7 @@ declare module azurestorage { * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6298,7 +6309,7 @@ declare module azurestorage { * be true if the directory exists, or false if the directory does not exist. * `response` will contain information related to this operation. */ - doesDirectoryExist(share: string, directory: string, options: common.RequestOptions, callback: ErrorOrResult): void; + doesDirectoryExist(share: string, directory: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; doesDirectoryExist(share: string, directory: string, callback: ErrorOrResult): void; /** @@ -6367,6 +6378,7 @@ declare module azurestorage { * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6381,7 +6393,7 @@ declare module azurestorage { * information for the directory. * `response` will contain information related to this operation. */ - getDirectoryProperties(share: string, directory: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getDirectoryProperties(share: string, directory: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getDirectoryProperties(share: string, directory: string, callback: ErrorOrResult): void; /** @@ -6440,6 +6452,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {Object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.maxResults] Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000) * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. @@ -6468,6 +6481,7 @@ declare module azurestorage { * @param {string} prefix The prefix of the directory/files name. * @param {Object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.maxResults] Specifies the maximum number of files to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000) * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. @@ -6492,6 +6506,8 @@ declare module azurestorage { * @this {FileService} * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. + * @param {object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. * @param {int} [options.maximumExecutionTimeInMs] The maximum execution time, in milliseconds, across all potential retries, to use when making this request. * The maximum execution time interval begins at the time that the client begins building the request. The maximum @@ -6504,7 +6520,7 @@ declare module azurestorage { * information about the file. * `response` will contain information related to this operation. */ - getDirectoryMetadata(share: string, directory: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getDirectoryMetadata(share: string, directory: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getDirectoryMetadata(share: string, directory: string, callback: ErrorOrResult): void; /** @@ -6583,13 +6599,14 @@ declare module azurestorage { * @param {string} [file] The file name. File names may not start or end with the delimiter '/'. * @param {string} [sasToken] The Shared Access Signature token. * @param {boolean} [primary] A boolean representing whether to use the primary or the secondary endpoint. + * @param {boolean} [shareSnapshotId] The snapshot identifier of the share. * @return {string} The formatted URL string. * @example * var azure = require('azure-storage'); * var FileService = azure.createFileService(); * var url = FileService.getUrl(shareName, directoryName, fileName, sasToken, true); */ - getUrl(share: string, directory: string, file?: string, sasToken?: string, primary?: boolean): string; + getUrl(share: string, directory: string, file?: string, sasToken?: string, primary?: boolean, shareSnapshotId?: string): string; /** * Returns all user-defined metadata, standard HTTP properties, and system properties for the file. @@ -6600,6 +6617,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6614,7 +6632,7 @@ declare module azurestorage { * information about the file. * `response` will contain information related to this operation. */ - getFileProperties(share: string, directory: string, file: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getFileProperties(share: string, directory: string, file: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getFileProperties(share: string, directory: string, file: string, callback: ErrorOrResult): void; /** @@ -6625,6 +6643,8 @@ declare module azurestorage { * @param {string} share The share name. * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. + * @param {object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6639,7 +6659,7 @@ declare module azurestorage { * information about the file. * `response` will contain information related to this operation. */ - getFileMetadata(share: string, directory: string, file: string, options: common.RequestOptions, callback: ErrorOrResult): void; + getFileMetadata(share: string, directory: string, file: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; getFileMetadata(share: string, directory: string, file: string, callback: ErrorOrResult): void; /** @@ -6735,6 +6755,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. * Please see StorageUtilities.LocationMode for the possible values. * @param {int} [options.timeoutIntervalInMs] The server timeout interval, in milliseconds, to use for the request. @@ -6749,7 +6770,7 @@ declare module azurestorage { * be true if the file exists, or false if the file does not exist. * `response` will contain information related to this operation. */ - doesFileExist(share: string, directory: string, file: string, options: common.RequestOptions, callback: ErrorOrResult): void; + doesFileExist(share: string, directory: string, file: string, options: FileService.FileServiceOptions, callback: ErrorOrResult): void; doesFileExist(share: string, directory: string, file: string, callback: ErrorOrResult): void; /** @@ -6843,6 +6864,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.rangeStart] The range start. * @param {int} [options.rangeEnd] The range end. * @param {boolean} [options.disableContentMD5Validation] When set to true, MD5 validation will be disabled when downloading files. @@ -6872,6 +6894,7 @@ declare module azurestorage { * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {string} localFileName The local path to the file to be downloaded. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range. * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range. * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions. @@ -6907,6 +6930,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range. * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range. * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions. @@ -6942,6 +6966,7 @@ declare module azurestorage { * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Stream} writeStream The write stream. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {string} [options.rangeStart] Return only the bytes of the file in the specified range. * @param {string} [options.rangeEnd] Return only the bytes of the file in the specified range. * @param {boolean} [options.useTransactionalMD5] When set to true, Calculate and send/validate content MD5 for transactions. @@ -6979,6 +7004,7 @@ declare module azurestorage { * @param {string} directory The directory name. Use '' to refer to the base directory. * @param {string} file The file name. File names may not start or end with the delimiter '/'. * @param {Object} [options] The request options. + * @param {string} [options.shareSnapshotId] The snapshot identifier of the share. * @param {int} [options.rangeStart] The range start. * @param {int} [options.rangeEnd] The range end. * @param {LocationMode} [options.locationMode] Specifies the location mode used to decide which location the request should be sent to. @@ -7360,6 +7386,7 @@ declare module azurestorage { export interface ShareResult { name: string; + snapshot?: string; etag: string; lastModified: string; metadata?: { [key: string]: string; }; @@ -7423,12 +7450,20 @@ declare module azurestorage { quota: number } - export interface ListRangeRequestOptions extends common.RequestOptions { + export interface FileServiceOptions extends common.RequestOptions { + shareSnapshotId?: string; + } + + export interface DeleteShareOptions extends FileServiceOptions { + deleteSnapshots?: string; + } + + export interface ListRangeRequestOptions extends FileServiceOptions { rangeStart?: number; rangeEnd?: number; } - export interface GetFileRequestOptions extends common.RequestOptions { + export interface GetFileRequestOptions extends FileServiceOptions { parallelOperationThreadCount?: number; rangeStart?: number; rangeEnd?: number; @@ -7436,7 +7471,12 @@ declare module azurestorage { disableContentMD5Validation?: boolean; } - export interface ListRequestOptions extends common.RequestOptions { + export interface ListRequestOptions extends FileServiceOptions { + maxResults?: number; + include?: string; + } + + export interface ListShareRequestOptions extends common.RequestOptions { maxResults?: number; include?: string; } @@ -7544,6 +7584,10 @@ declare module azurestorage { SHARE: string; FILE: string; }; + + var ShareSnapshotDeleteOptions: { + SHARE_AND_SNAPSHOTS: string + }; } } }