diff --git a/sdk/storage/storage-blob/recordings/browsers/blob_versioning/recording_promote_a_version_as_the_copy_source.json b/sdk/storage/storage-blob/recordings/browsers/blob_versioning/recording_promote_a_version_as_the_copy_source.json index 0d8cde0db2fe..3fc1b11085d3 100644 --- a/sdk/storage/storage-blob/recordings/browsers/blob_versioning/recording_promote_a_version_as_the_copy_source.json +++ b/sdk/storage/storage-blob/recordings/browsers/blob_versioning/recording_promote_a_version_as_the_copy_source.json @@ -1,167 +1,196 @@ { - "recordings": [ - { - "method": "PUT", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499", - "query": { - "sip": "0.0.0.0-255.255.255.255", - "restype": "container" - }, - "requestBody": null, - "status": 201, - "response": "", - "responseHeaders": { - "etag": "\"0x8D7CFA131B4BBD1\"", - "last-modified": "Tue, 24 Mar 2020 03:12:32 GMT", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "b501cc0e-4f28-44ee-a8da-fc97b26c0011", - "x-ms-request-id": "f7f5c097-201e-0003-488a-01645a000000", - "x-ms-version": "2019-12-12" - } + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188", + "query": { + "sip": "0.0.0.0-255.255.255.255", + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "etag": "\"0x8D7CCAF96D4FFB8\"", + "last-modified": "Fri, 20 Mar 2020 09:18:01 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "71afe7c1-f395-4d12-b902-c99a5d8908db", + "x-ms-request-id": "382c2cdf-601e-0012-0a98-fefeee000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686", + "query": { + "sip": "0.0.0.0-255.255.255.255" + }, + "requestBody": "Hello World", + "status": 201, + "response": "", + "responseHeaders": { + "content-md5": "sQqNsWTgdUEFt6mb5y4/5Q==", + "etag": "\"0x8D7CCAF971EAF63\"", + "last-modified": "Fri, 20 Mar 2020 09:18:02 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "91069504-a5f9-485d-9f70-5b9baf371225", + "x-ms-content-crc64": "YeJLfssylmU=", + "x-ms-request-id": "382c2cf9-601e-0012-1c98-fefeee000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12", + "x-ms-version-id": "2020-03-20T09:18:02.2928227Z" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686", + "query": { + "sip": "0.0.0.0-255.255.255.255" + }, + "requestBody": "", + "status": 201, + "response": "", + "responseHeaders": { + "content-md5": "1B2M2Y8AsgTpgAmY7PhCfg==", + "etag": "\"0x8D7CCAF974306FF\"", + "last-modified": "Fri, 20 Mar 2020 09:18:02 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0446d7c8-e287-4c8c-94bd-e7e5710cc9f3", + "x-ms-content-crc64": "AAAAAAAAAAA=", + "x-ms-request-id": "382c2d03-601e-0012-2698-fefeee000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12", + "x-ms-version-id": "2020-03-20T09:18:02.5319951Z" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686", + "query": { + "sip": "0.0.0.0-255.255.255.255", + "versionid": "2020-03-20T09:18:02.2928227Z" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-md5": "sQqNsWTgdUEFt6mb5y4/5Q==", + "content-type": "application/octet-stream", + "etag": "\"0x8D7CCAF971EAF63\"", + "last-modified": "Fri, 20 Mar 2020 09:18:02 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "059b718f-636a-4081-9587-d46a3dcc31c9", + "x-ms-creation-time": "Fri, 20 Mar 2020 09:18:02 GMT", + "x-ms-request-id": "382c2d21-601e-0012-3d98-fefeee000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12", + "x-ms-version-id": "2020-03-20T09:18:02.2928227Z" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686", + "query": { + "sip": "0.0.0.0-255.255.255.255" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "etag": "\"0x8D7CCAF97DCF295\"", + "last-modified": "Fri, 20 Mar 2020 09:18:03 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "dafb4ee7-4266-476c-ab94-0393e517dad2", + "x-ms-copy-id": "6bb78fff-afe4-483b-a13e-71190407f7ac", + "x-ms-copy-status": "success", + "x-ms-request-id": "382c2d3a-601e-0012-5198-fefeee000000", + "x-ms-version": "2019-12-12", + "x-ms-version-id": "2020-03-20T09:18:03.5417279Z" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188", + "query": { + "sip": "0.0.0.0-255.255.255.255", + "include": "versions", + "restype": "container", + "comp": "list" + }, + "requestBody": null, + "status": 200, + "response": "blob1584695881886076862020-03-20T09:18:02.2928227ZFri, 20 Mar 2020 09:18:02 GMTFri, 20 Mar 2020 09:18:02 GMT0x8D7CCAF971EAF6311application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottruetrueblob1584695881886076862020-03-20T09:18:02.5319951ZFri, 20 Mar 2020 09:18:02 GMTFri, 20 Mar 2020 09:18:02 GMT0x8D7CCAF974306FF0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottruetrueblob1584695881886076862020-03-20T09:18:03.5417279ZtrueFri, 20 Mar 2020 09:18:02 GMTFri, 20 Mar 2020 09:18:03 GMT0x8D7CCAF97DCF29511application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottrueunlockedavailabletrue", + "responseHeaders": { + "content-type": "application/xml", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b4c29f64-b2a0-47f3-ab1a-9047d3ae6ea6", + "x-ms-request-id": "382c2d59-601e-0012-6998-fefeee000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686", + "query": { + "sip": "0.0.0.0-255.255.255.255" + }, + "requestBody": null, + "status": 200, + "response": "Hello World", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-md5": "sQqNsWTgdUEFt6mb5y4/5Q==", + "content-type": "application/octet-stream", + "etag": "\"0x8D7CCAF97DCF295\"", + "last-modified": "Fri, 20 Mar 2020 09:18:03 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "76a56e9b-e83a-4a72-8299-f45339a49595", + "x-ms-copy-completion-time": "Fri, 20 Mar 2020 09:18:03 GMT", + "x-ms-copy-id": "6bb78fff-afe4-483b-a13e-71190407f7ac", + "x-ms-copy-progress": "11/11", + "x-ms-copy-source": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188/blob158469588188607686?sv=2019-10-10&ss=btqf&srt=sco&spr=https%2Chttp&st=2020-03-20T09%3A00%3A00Z&se=2022-12-15T09%3A05%3A00Z&sip=0.0.0.0-255.255.255.255&sp=rwdxlacup&versionid=2020-03-20T09:18:02.2928227Z", + "x-ms-copy-status": "success", + "x-ms-creation-time": "Fri, 20 Mar 2020 09:18:02 GMT", + "x-ms-is-current-version": "true", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "382c2d8d-601e-0012-1098-fefeee000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12", + "x-ms-version-id": "2020-03-20T09:18:03.5417279Z" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/container158469588020807188", + "query": { + "sip": "0.0.0.0-255.255.255.255", + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "de051cfe-a985-4575-b9c8-399fbd78cd44", + "x-ms-request-id": "382c2d9d-601e-0012-1e98-fefeee000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "container": "container158469588020807188", + "blob": "blob158469588188607686" + }, + "newDate": {} }, - { - "method": "PUT", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499/blob158501955278801412", - "query": { - "sip": "0.0.0.0-255.255.255.255" - }, - "requestBody": "Hello World", - "status": 201, - "response": "", - "responseHeaders": { - "content-md5": "sQqNsWTgdUEFt6mb5y4/5Q==", - "etag": "\"0x8D7CFA131FEA31B\"", - "last-modified": "Tue, 24 Mar 2020 03:12:33 GMT", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "67e456de-813e-4f15-af28-5b21949895ad", - "x-ms-content-crc64": "YeJLfssylmU=", - "x-ms-request-id": "f7f5c176-201e-0003-258a-01645a000000", - "x-ms-request-server-encrypted": "true", - "x-ms-version": "2019-12-12", - "x-ms-version-id": "2020-03-24T03:12:33.1670299Z" - } - }, - { - "method": "PUT", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499/blob158501955278801412", - "query": { - "sip": "0.0.0.0-255.255.255.255" - }, - "requestBody": "", - "status": 201, - "response": "", - "responseHeaders": { - "content-md5": "1B2M2Y8AsgTpgAmY7PhCfg==", - "etag": "\"0x8D7CFA1322E2064\"", - "last-modified": "Tue, 24 Mar 2020 03:12:33 GMT", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "93fa6096-c851-4d41-aded-e1245893f23f", - "x-ms-content-crc64": "AAAAAAAAAAA=", - "x-ms-request-id": "f7f5c1e1-201e-0003-0d8a-01645a000000", - "x-ms-request-server-encrypted": "true", - "x-ms-version": "2019-12-12", - "x-ms-version-id": "2020-03-24T03:12:33.4792564Z" - } - }, - { - "method": "PUT", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499/blob158501955278801412", - "query": { - "sip": "0.0.0.0-255.255.255.255" - }, - "requestBody": null, - "status": 202, - "response": "", - "responseHeaders": { - "etag": "\"0x8D7CFA132843F7D\"", - "last-modified": "Tue, 24 Mar 2020 03:12:34 GMT", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "958d13ba-8865-4b76-8745-f1130736b262", - "x-ms-copy-id": "e860501f-ea27-43c2-a625-920f73a80a86", - "x-ms-copy-status": "success", - "x-ms-request-id": "f7f5c324-201e-0003-508a-01645a000000", - "x-ms-version": "2019-12-12", - "x-ms-version-id": "2020-03-24T03:12:34.0446626Z" - } - }, - { - "method": "GET", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499", - "query": { - "sip": "0.0.0.0-255.255.255.255", - "include": "versions", - "restype": "container", - "comp": "list" - }, - "requestBody": null, - "status": 200, - "response": "blob1585019552788014122020-03-24T03:12:33.1670299ZTue, 24 Mar 2020 03:12:33 GMTTue, 24 Mar 2020 03:12:33 GMT0x8D7CFA131FEA31B11application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottruetrueblob1585019552788014122020-03-24T03:12:33.4792564ZTue, 24 Mar 2020 03:12:33 GMTTue, 24 Mar 2020 03:12:33 GMT0x8D7CFA1322E20640application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottruetrueblob1585019552788014122020-03-24T03:12:34.0446626ZtrueTue, 24 Mar 2020 03:12:33 GMTTue, 24 Mar 2020 03:12:34 GMT0x8D7CFA132843F7D11application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottrueunlockedavailabletrue", - "responseHeaders": { - "content-type": "application/xml", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "49854405-6f13-4626-83ee-592ad18b2e43", - "x-ms-request-id": "f7f5c3f9-201e-0003-1a8a-01645a000000", - "x-ms-version": "2019-12-12" - } - }, - { - "method": "GET", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499/blob158501955278801412", - "query": { - "sip": "0.0.0.0-255.255.255.255" - }, - "requestBody": null, - "status": 200, - "response": "Hello World", - "responseHeaders": { - "accept-ranges": "bytes", - "content-length": "11", - "content-md5": "sQqNsWTgdUEFt6mb5y4/5Q==", - "content-type": "application/octet-stream", - "etag": "\"0x8D7CFA132843F7D\"", - "last-modified": "Tue, 24 Mar 2020 03:12:34 GMT", - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-blob-type": "BlockBlob", - "x-ms-client-request-id": "4214978d-cc24-4303-93c1-617a6bfd43b7", - "x-ms-copy-completion-time": "Tue, 24 Mar 2020 03:12:34 GMT", - "x-ms-copy-id": "e860501f-ea27-43c2-a625-920f73a80a86", - "x-ms-copy-progress": "11/11", - "x-ms-copy-source": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499/blob158501955278801412?sv=2019-10-10&ss=btqf&srt=sco&spr=https%2Chttp&st=2020-03-20T09%3A00%3A00Z&se=2022-12-15T09%3A05%3A00Z&sip=0.0.0.0-255.255.255.255&sp=rwdxlacup&versionid=2020-03-24T03:12:33.1670299Z", - "x-ms-copy-status": "success", - "x-ms-creation-time": "Tue, 24 Mar 2020 03:12:33 GMT", - "x-ms-is-current-version": "true", - "x-ms-lease-state": "available", - "x-ms-lease-status": "unlocked", - "x-ms-request-id": "f7f5c5db-201e-0003-7a8a-01645a000000", - "x-ms-server-encrypted": "true", - "x-ms-version": "2019-12-12", - "x-ms-version-id": "2020-03-24T03:12:34.0446626Z" - } - }, - { - "method": "DELETE", - "url": "https://fakestorageaccount.blob.preprod.core.windows.net/container158501954955601499", - "query": { - "sip": "0.0.0.0-255.255.255.255", - "restype": "container" - }, - "requestBody": null, - "status": 202, - "response": "", - "responseHeaders": { - "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "5b51d86f-ba60-45a9-a0e1-eeee685b629b", - "x-ms-request-id": "f7f5c652-201e-0003-708a-01645a000000", - "x-ms-version": "2019-12-12" - } - } - ], - "uniqueTestInfo": { - "uniqueName": { - "container": "container158501954955601499", - "blob": "blob158501955278801412" - }, - "newDate": {} - }, - "hash": "54fda11a7b7b7495916f55430107b1ab" -} \ No newline at end of file + "hash": "d904b79863031a84c2093a63c68fce79" +} diff --git a/sdk/storage/storage-blob/recordings/node/blob_versioning/recording_promote_a_version_as_the_copy_source.js b/sdk/storage/storage-blob/recordings/node/blob_versioning/recording_promote_a_version_as_the_copy_source.js index 5a0015bdeda1..dacca11c4143 100644 --- a/sdk/storage/storage-blob/recordings/node/blob_versioning/recording_promote_a_version_as_the_copy_source.js +++ b/sdk/storage/storage-blob/recordings/node/blob_versioning/recording_promote_a_version_as_the_copy_source.js @@ -1,48 +1,48 @@ let nock = require('nock'); -module.exports.hash = "982c4e2fe5d1d00d124d98f61bc8882d"; +module.exports.hash = "318de628af223ea365a07e3ad594193f"; -module.exports.testInfo = {"uniqueName":{"container":"container158501909382406507","blob":"blob158501909509404786"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"container":"container158459901204501613","blob":"blob158459901228504616"},"newDate":{}} nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container158501909382406507') + .put('/container158459901204501613') .query(true) .reply(201, "", [ 'Content-Length', '0', 'Last-Modified', - 'Tue, 24 Mar 2020 03:04:54 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'ETag', - '"0x8D7CFA020E65FD9"', + '"0x8D7CBCE0C057E0C"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab083b9f-e01e-0071-2888-013ce9000000', + 'b42b8833-701e-005c-7ab6-fd8f9a000000', 'x-ms-client-request-id', - '441b4d68-2936-443d-a30b-563fc126e1c0', + 'fec91be5-af38-46f3-af2f-8c0eaee74b9b', 'x-ms-version', '2019-12-12', 'Date', - 'Tue, 24 Mar 2020 03:04:54 GMT' + 'Thu, 19 Mar 2020 06:23:31 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container158501909382406507/blob158501909509404786', "Hello World") + .put('/container158459901204501613/blob158459901228504616', "Hello World") .reply(201, "", [ 'Content-Length', '0', 'Content-MD5', 'sQqNsWTgdUEFt6mb5y4/5Q==', 'Last-Modified', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'ETag', - '"0x8D7CFA0210E2C33"', + '"0x8D7CBCE0C2D2841"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab083c8d-e01e-0071-7e88-013ce9000000', + '775e4f99-b01e-0088-1cb6-fd3fcb000000', 'x-ms-client-request-id', - '41a25d68-7c85-4e98-adcd-d9e4701fc8dc', + '2bb400d7-8bf1-4757-abdb-20a06a6b1741', 'x-ms-version', '2019-12-12', 'x-ms-content-crc64', @@ -50,28 +50,28 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'x-ms-request-server-encrypted', 'true', 'x-ms-version-id', - '2020-03-24T03:04:55.2508467Z', + '2020-03-19T06:23:32.4202049Z', 'Date', - 'Tue, 24 Mar 2020 03:04:55 GMT' + 'Thu, 19 Mar 2020 06:23:32 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container158501909382406507/blob158501909509404786') + .put('/container158459901204501613/blob158459901228504616') .reply(201, "", [ 'Content-Length', '0', 'Content-MD5', '1B2M2Y8AsgTpgAmY7PhCfg==', 'Last-Modified', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'ETag', - '"0x8D7CFA021362DDF"', + '"0x8D7CBCE0C521C1E"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab083d58-e01e-0071-4288-013ce9000000', + 'b42b88f3-701e-005c-22b6-fd8f9a000000', 'x-ms-client-request-id', - 'f1114793-2574-41a1-b572-3d5e55ba5271', + 'a73acf78-0ce8-4d18-bc4e-169eb7ead072', 'x-ms-version', '2019-12-12', 'x-ms-content-crc64', @@ -79,42 +79,42 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'x-ms-request-server-encrypted', 'true', 'x-ms-version-id', - '2020-03-24T03:04:55.5140335Z', + '2020-03-19T06:23:32.6633774Z', 'Date', - 'Tue, 24 Mar 2020 03:04:55 GMT' + 'Thu, 19 Mar 2020 06:23:32 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container158501909382406507/blob158501909509404786') + .put('/container158459901204501613/blob158459901228504616') .reply(202, "", [ 'Content-Length', '0', 'Last-Modified', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'ETag', - '"0x8D7CFA021703433"', + '"0x8D7CBCE0C78E510"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab083e2d-e01e-0071-0f88-013ce9000000', + '775e5027-b01e-0088-20b6-fd3fcb000000', 'x-ms-client-request-id', - 'd08164f5-b6ee-4544-822b-4652015cc113', + '9dce2e27-bce4-4749-b74d-7b3dc9939512', 'x-ms-version', '2019-12-12', 'x-ms-version-id', - '2020-03-24T03:04:55.8963057Z', + '2020-03-19T06:23:32.9185593Z', 'x-ms-copy-id', - 'f2388049-749b-4c08-b423-1739983768bb', + '97284516-417d-4e6a-b0fe-5bc0437d8040', 'x-ms-copy-status', 'success', 'Date', - 'Tue, 24 Mar 2020 03:04:55 GMT' + 'Thu, 19 Mar 2020 06:23:32 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .get('/container158501909382406507') + .get('/container158459901204501613') .query(true) - .reply(200, "blob1585019095094047862020-03-24T03:04:55.2508467ZTue, 24 Mar 2020 03:04:55 GMTTue, 24 Mar 2020 03:04:55 GMT0x8D7CFA0210E2C3311application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottruetrueblob1585019095094047862020-03-24T03:04:55.5140335ZTue, 24 Mar 2020 03:04:55 GMTTue, 24 Mar 2020 03:04:55 GMT0x8D7CFA021362DDF0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottruetrueblob1585019095094047862020-03-24T03:04:55.8963057ZtrueTue, 24 Mar 2020 03:04:55 GMTTue, 24 Mar 2020 03:04:55 GMT0x8D7CFA02170343311application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottrueunlockedavailabletrue", [ + .reply(200, "blob1584599012285046162020-03-19T06:23:32.4202049ZThu, 19 Mar 2020 06:23:32 GMTThu, 19 Mar 2020 06:23:32 GMT0x8D7CBCE0C2D284111application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottruetrueblob1584599012285046162020-03-19T06:23:32.6633774ZThu, 19 Mar 2020 06:23:32 GMTThu, 19 Mar 2020 06:23:32 GMT0x8D7CBCE0C521C1E0application/octet-stream1B2M2Y8AsgTpgAmY7PhCfg==BlockBlobHottruetrueblob1584599012285046162020-03-19T06:23:32.9185593ZtrueThu, 19 Mar 2020 06:23:32 GMTThu, 19 Mar 2020 06:23:32 GMT0x8D7CBCE0C78E51011application/octet-streamsQqNsWTgdUEFt6mb5y4/5Q==BlockBlobHottrueunlockedavailabletrue", [ 'Transfer-Encoding', 'chunked', 'Content-Type', @@ -122,9 +122,9 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab083f7a-e01e-0071-5188-013ce9000000', + 'b42b89bc-701e-005c-55b6-fd8f9a000000', 'x-ms-client-request-id', - 'd77fc088-f8bb-4d32-bd16-6d04e2b2206c', + 'a41f74df-3d58-4194-8c7a-a386c49cd8c1', 'x-ms-version', '2019-12-12', 'Access-Control-Expose-Headers', @@ -132,11 +132,11 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Access-Control-Allow-Origin', '*', 'Date', - 'Tue, 24 Mar 2020 03:04:55 GMT' + 'Thu, 19 Mar 2020 06:23:32 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .get('/container158501909382406507/blob158501909509404786') + .get('/container158459901204501613/blob158459901228504616') .reply(200, "Hello World", [ 'Content-Length', '11', @@ -145,25 +145,25 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Content-MD5', 'sQqNsWTgdUEFt6mb5y4/5Q==', 'Last-Modified', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'Accept-Ranges', 'bytes', 'ETag', - '"0x8D7CFA021703433"', + '"0x8D7CBCE0C78E510"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab08411f-e01e-0071-6788-013ce9000000', + '775e5125-b01e-0088-05b6-fd3fcb000000', 'x-ms-client-request-id', - 'a405b072-6e56-4b89-8887-80617eef19ae', + 'ba1dbb23-fb70-4fa3-844f-499ffdff82d8', 'x-ms-version', '2019-12-12', 'x-ms-version-id', - '2020-03-24T03:04:55.8963057Z', + '2020-03-19T06:23:32.9185593Z', 'x-ms-is-current-version', 'true', 'x-ms-creation-time', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'x-ms-lease-status', 'unlocked', 'x-ms-lease-state', @@ -171,15 +171,15 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'x-ms-blob-type', 'BlockBlob', 'x-ms-copy-id', - 'f2388049-749b-4c08-b423-1739983768bb', + '97284516-417d-4e6a-b0fe-5bc0437d8040', 'x-ms-copy-source', - 'https://fakestorageaccount.blob.core.windows.net/container158501909382406507/blob158501909509404786?versionid=2020-03-24T03:04:55.2508467Z', + 'https://fakestorageaccount.blob.core.windows.net/container158459901204501613/blob158459901228504616?versionId=2020-03-19T06:23:32.4202049Z', 'x-ms-copy-status', 'success', 'x-ms-copy-progress', '11/11', 'x-ms-copy-completion-time', - 'Tue, 24 Mar 2020 03:04:55 GMT', + 'Thu, 19 Mar 2020 06:23:32 GMT', 'x-ms-server-encrypted', 'true', 'Access-Control-Expose-Headers', @@ -187,11 +187,11 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Access-Control-Allow-Origin', '*', 'Date', - 'Tue, 24 Mar 2020 03:04:56 GMT' + 'Thu, 19 Mar 2020 06:23:33 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .delete('/container158501909382406507') + .delete('/container158459901204501613') .query(true) .reply(202, "", [ 'Content-Length', @@ -199,11 +199,11 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'ab0841f4-e01e-0071-3188-013ce9000000', + 'b42b8acb-701e-005c-42b6-fd8f9a000000', 'x-ms-client-request-id', - 'b0054ba7-6176-4f34-bc92-9d2c6e5d6325', + 'ef3c8759-2f91-4526-8253-db0095100b06', 'x-ms-version', '2019-12-12', 'Date', - 'Tue, 24 Mar 2020 03:04:56 GMT' + 'Thu, 19 Mar 2020 06:23:33 GMT' ]); diff --git a/sdk/storage/storage-blob/review/storage-blob.api.md b/sdk/storage/storage-blob/review/storage-blob.api.md index e021611e11d1..543ab6e247f6 100644 --- a/sdk/storage/storage-blob/review/storage-blob.api.md +++ b/sdk/storage/storage-blob/review/storage-blob.api.md @@ -373,7 +373,6 @@ export class BlobClient extends StorageClient { getBlockBlobClient(): BlockBlobClient; getPageBlobClient(): PageBlobClient; getProperties(options?: BlobGetPropertiesOptions): Promise; - getURLWithVersionId(versionId: string): string; get name(): string; setAccessTier(tier: BlockBlobTier | PremiumPageBlobTier | string, options?: BlobSetTierOptions): Promise; setHTTPHeaders(blobHTTPHeaders?: BlobHTTPHeaders, options?: BlobSetHTTPHeadersOptions): Promise; @@ -381,6 +380,7 @@ export class BlobClient extends StorageClient { syncCopyFromURL(copySource: string, options?: BlobSyncCopyFromURLOptions): Promise; undelete(options?: BlobUndeleteOptions): Promise; withSnapshot(snapshot: string): BlobClient; + withVersionId(versionId: string): BlobClient; } // @public diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 80e34e70f619..7b8080653422 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -1099,18 +1099,21 @@ export class BlobClient extends StorageClient { } /** - * Get the URL pointing to a version of this blob. - * Provide "" will remove the versionId and return the URL to the base blob. + * Creates a new BlobClient object pointing to a version of this blob. + * Provide "" will remove the versionId and return a Client to the base blob. * * @param {string} versionId The versionId. - * @returns {string} A URL pointing to the version of this blob. + * @returns {BlobClient} A new BlobClient object pointing to the version of this blob. * @memberof BlobClient */ - public getURLWithVersionId(versionId: string): string { - return setURLParameter( - this.url, - URLConstants.Parameters.VERSIONID, - versionId.length === 0 ? undefined : versionId + public withVersionId(versionId: string): BlobClient { + return new BlobClient( + setURLParameter( + this.url, + URLConstants.Parameters.VERSIONID, + versionId.length === 0 ? undefined : versionId + ), + this.pipeline ); } diff --git a/sdk/storage/storage-blob/test/blobversioning.spec.ts b/sdk/storage/storage-blob/test/blobversioning.spec.ts index d8d283d91cc1..f04cea396cce 100644 --- a/sdk/storage/storage-blob/test/blobversioning.spec.ts +++ b/sdk/storage/storage-blob/test/blobversioning.spec.ts @@ -21,9 +21,6 @@ import { import { setURLParameter, } from "../src/utils/utils.common"; -import { - URLConstants, -} from "../src/utils/constants"; dotenv.config({ path: "../.env" }); describe("Blob versioning", () => { @@ -293,7 +290,10 @@ describe("Blob versioning", () => { }); it("promote a version: as the copy source", async () => { - const versionURL = setURLParameter(blobClient.url, URLConstants.Parameters.VERSIONID, uploadRes.versionId); + const versionBlobClient = blobClient.withVersionId(uploadRes.versionId!); + await versionBlobClient.getProperties(); + + const versionURL = setURLParameter(blobClient.url, "versionid", uploadRes.versionId); const copyRes = await (await blobClient.beginCopyFromURL(versionURL)).pollUntilDone(); assert.ok(copyRes.copyId); diff --git a/sdk/storage/storage-blob/test/node/sas.spec.ts b/sdk/storage/storage-blob/test/node/sas.spec.ts index 7287a1839f74..13e47635b847 100644 --- a/sdk/storage/storage-blob/test/node/sas.spec.ts +++ b/sdk/storage/storage-blob/test/node/sas.spec.ts @@ -884,7 +884,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { sharedKeyCredential as StorageSharedKeyCredential ); - const sasURL = `${blobClient.getURLWithVersionId(uploadRes.versionId!)}&${blobSAS}`; + const sasURL = `${blobClient.withVersionId(uploadRes.versionId!).url}&${blobSAS}`; const blobClientWithSAS = new BlobClient(sasURL, newPipeline(new AnonymousCredential())); await blobClientWithSAS.delete({ versionId: uploadRes.versionId }); assert.ok(!(await blobClientWithSAS.exists({ versionId: uploadRes.versionId }))); @@ -947,7 +947,7 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { accountName ); - const sasURL = `${blobClient.getURLWithVersionId(uploadRes.versionId!)}&${blobSAS}`; + const sasURL = `${blobClient.withVersionId(uploadRes.versionId!).url}&${blobSAS}`; const blobClientWithSAS = new BlobClient(sasURL, newPipeline(new AnonymousCredential())); await blobClientWithSAS.delete({ versionId: uploadRes.versionId }); assert.ok(!(await blobClientWithSAS.exists({ versionId: uploadRes.versionId })));