From 14b4081da9517f4db0ac548e5e4027701da88e1a Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Sat, 10 Oct 2020 16:08:57 +0800 Subject: [PATCH] unskip quick query record & support include-leased for x-ms-delete-snapshots (#11754) --- .../package.json | 2 +- ...query_should_work_with_conditional_tags.js | 135 +++++++++++++++--- .../storage-blob/test/node/blobclient.spec.ts | 1 - .../recording_acquirelease_for_snapshot.json | 105 ++++++-------- .../recording_acquirelease_for_snapshot.js | 114 +++++++-------- .../review/storage-file-share.api.md | 2 +- .../src/generated/src/models/index.ts | 6 +- .../src/generated/src/models/parameters.ts | 3 +- .../test/fileserviceclient.spec.ts | 4 +- .../test/leaseclient.spec.ts | 4 +- 10 files changed, 215 insertions(+), 161 deletions(-) diff --git a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json index 6d1274623de3..26b81c5cd067 100644 --- a/sdk/eventhub/eventhubs-checkpointstore-blob/package.json +++ b/sdk/eventhub/eventhubs-checkpointstore-blob/package.json @@ -61,7 +61,7 @@ "dependencies": { "@azure/event-hubs": "^5.0.0", "@azure/logger": "^1.0.0", - "@azure/storage-blob": "^12.3.0-prerelease.1", + "@azure/storage-blob": "^12.3.0-beta.1", "events": "^3.0.0", "tslib": "^2.0.0" }, diff --git a/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_conditional_tags.js b/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_conditional_tags.js index 47dd2ad8fc01..c3961327f18c 100644 --- a/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_conditional_tags.js +++ b/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_conditional_tags.js @@ -1,62 +1,153 @@ let nock = require('nock'); -module.exports.hash = "35241ca13b2f0a4e39ac34a5c3703e44"; +module.exports.hash = "a3bb3d95026d53671b051ff1dbc68bc3"; -module.exports.testInfo = {"uniqueName":{"container":"container159549714446502477","blob":"blob159549714476903821"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"container":"container160231128647507275","blob":"blob160231128993209131"},"newDate":{}} nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container159549714446502477') + .put('/container160231128647507275') .query(true) .reply(201, "", [ 'Content-Length', '0', 'Last-Modified', - 'Thu, 23 Jul 2020 09:39:03 GMT', + 'Sat, 10 Oct 2020 06:28:09 GMT', 'ETag', - '"0x8D82EEC3C7D3E44"', + '"0x8D86CE5A82C7E31"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - '4bd01901-a01e-0020-3bd5-603607000000', + 'c2ea3acf-101e-000a-4cce-9ee917000000', 'x-ms-client-request-id', - '47ba7d87-1be4-49d1-9e7d-729c83f34cea', + '888c9721-f32b-436f-af73-3212c214b69a', 'x-ms-version', - '2019-12-12', + '2020-02-10', 'Date', - 'Thu, 23 Jul 2020 09:39:03 GMT' + 'Sat, 10 Oct 2020 06:28:09 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .put('/container159549714446502477/blob159549714476903821', "Hello World") + .put('/container160231128647507275/blob160231128993209131', "Hello World") .reply(201, "", [ 'Content-Length', '0', 'Content-MD5', 'sQqNsWTgdUEFt6mb5y4/5Q==', 'Last-Modified', - 'Thu, 23 Jul 2020 09:39:03 GMT', + 'Sat, 10 Oct 2020 06:28:10 GMT', 'ETag', - '"0x8D82EEC3CAACDC0"', + '"0x8D86CE5A85F355F"', 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - '4bd0191b-a01e-0020-4cd5-603607000000', + 'c2ea3aea-101e-000a-60ce-9ee917000000', 'x-ms-client-request-id', - '8a480dc9-a495-462d-a8f9-376158b7f63d', + 'a67e344f-019b-4ded-9200-28331d0b1002', 'x-ms-version', - '2019-12-12', + '2020-02-10', 'x-ms-content-crc64', 'YeJLfssylmU=', 'x-ms-request-server-encrypted', 'true', 'x-ms-version-id', - '2020-07-23T09:39:03.7911488Z', + '2020-10-10T06:28:10.1047647Z', 'Date', - 'Thu, 23 Jul 2020 09:39:03 GMT' + 'Sat, 10 Oct 2020 06:28:09 GMT' ]); nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) - .delete('/container159549714446502477') + .put('/container160231128647507275/blob160231128993209131', "100,200,300,400\n150,250,350,450\n") + .reply(201, "", [ + 'Content-Length', + '0', + 'Content-MD5', + 'v9C7YWQTetukQaGSOQcgRQ==', + 'Last-Modified', + 'Sat, 10 Oct 2020 06:28:10 GMT', + 'ETag', + '"0x8D86CE5A88ED98B"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'c2ea3af6-101e-000a-68ce-9ee917000000', + 'x-ms-client-request-id', + 'e29665de-124e-4d79-a6a8-02603a0a2ad4', + 'x-ms-version', + '2020-02-10', + 'x-ms-content-crc64', + 'gema9E3+zEY=', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-version-id', + '2020-10-10T06:28:10.4179867Z', + 'Date', + 'Sat, 10 Oct 2020 06:28:10 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/container160231128647507275/blob160231128993209131', "SQLselect * from BlobStorage") + .query(true) + .reply(412, "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:c2ea3b02-101e-000a-72ce-9ee917000000\nTime:2020-10-10T06:28:10.8701764Z", [ + 'Content-Length', + '253', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-error-code', + 'ConditionNotMet', + 'x-ms-request-id', + 'c2ea3b02-101e-000a-72ce-9ee917000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'e39e1ad3-29f9-42ea-8596-79055ce9f35e', + 'Date', + 'Sat, 10 Oct 2020 06:28:10 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/container160231128647507275/blob160231128993209131', "SQLselect * from BlobStorage") + .query(true) + .reply(200, Buffer.from("4f626a0102166176726f2e736368656d61be1e5b0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e726573756c7444617461222c0a2020202022646f63223a2022486f6c647320726573756c74206461746120696e2074686520666f726d61742073706563696669656420666f72207468697320717565727920284353562c204a534f4e2c206574632e292e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a202264617461222c0a20202020202020202274797065223a20226279746573220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e6572726f72222c0a2020202022646f63223a2022416e206572726f722074686174206f63637572726564207768696c652070726f63657373696e67207468652071756572792e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a2022666174616c222c0a20202020202020202274797065223a2022626f6f6c65616e222c0a202020202020202022646f63223a2022496620747275652c2074686973206572726f722070726576656e747320667572746865722071756572792070726f63657373696e672e20204d6f726520726573756c742064617461206d61792062652072657475726e65642c20627574207468657265206973206e6f2067756172616e746565207468617420616c6c206f6620746865206f726967696e616c20646174612077696c6c2062652070726f6365737365642e202049662066616c73652c2074686973206572726f7220646f6573206e6f742070726576656e7420667572746865722071756572792070726f63657373696e672e220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a20226e616d65222c0a20202020202020202274797065223a2022737472696e67222c0a202020202020202022646f63223a2022546865206e616d65206f6620746865206572726f72220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a20226465736372697074696f6e222c0a20202020202020202274797065223a2022737472696e67222c0a202020202020202022646f63223a202241206465736372697074696f6e206f6620746865206572726f72220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a2022706f736974696f6e222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520626c6f62206f666673657420617420776869636820746865206572726f72206f63637572726564220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e70726f6772657373222c0a2020202022646f63223a2022496e666f726d6174696f6e2061626f7574207468652070726f6772657373206f6620746865207175657279222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a202262797465735363616e6e6564222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a2022546865206e756d626572206f6620627974657320746861742068617665206265656e207363616e6e6564220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a2022746f74616c4279746573222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520746f74616c206e756d626572206f6620627974657320746f206265207363616e6e656420696e2074686973207175657279220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e656e64222c0a2020202022646f63223a202253656e74206173207468652066696e616c206d657373616765206f662074686520726573706f6e73652c20696e6469636174696e67207468617420616c6c20726573756c74732068617665206265656e2073656e742e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a2022746f74616c4279746573222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520746f74616c206e756d626572206f6620627974657320746f206265207363616e6e656420696e2074686973207175657279220a2020202020207d0a202020205d0a20207d0a5d0a00f6f0565630435444a3385adf0c234b58024400403130302c3230302c3330302c3430300a3135302c3235302c3335302c3435300af6f0565630435444a3385adf0c234b580206044040f6f0565630435444a3385adf0c234b5802040640f6f0565630435444a3385adf0c234b58", "hex"), [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'avro/binary', + 'Last-Modified', + 'Sat, 10 Oct 2020 06:28:10 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8D86CE5A88ED98B"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-creation-time', + 'Sat, 10 Oct 2020 06:28:10 GMT', + 'x-ms-lease-state', + 'available', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-version-id', + '2020-10-10T06:28:10.4179867Z', + 'x-ms-is-current-version', + 'true', + 'x-ms-request-id', + 'c2ea3b22-101e-000a-0cce-9ee917000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '3c88599d-74ee-4d72-8a7e-6a70c4949155', + 'Date', + 'Sat, 10 Oct 2020 06:28:11 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container160231128647507275') .query(true) .reply(202, "", [ 'Content-Length', @@ -64,11 +155,11 @@ nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParam 'Server', 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - '4bd0192d-a01e-0020-58d5-603607000000', + 'c2ea3b6e-101e-000a-3bce-9ee917000000', 'x-ms-client-request-id', - 'd1882594-78ea-4b35-9b06-2fdf08723138', + '6146a5f7-41a5-44a1-9b66-0288507886c3', 'x-ms-version', - '2019-12-12', + '2020-02-10', 'Date', - 'Thu, 23 Jul 2020 09:39:03 GMT' + 'Sat, 10 Oct 2020 06:28:12 GMT' ]); diff --git a/sdk/storage/storage-blob/test/node/blobclient.spec.ts b/sdk/storage/storage-blob/test/node/blobclient.spec.ts index 229dbbad000a..c6544f42c142 100644 --- a/sdk/storage/storage-blob/test/node/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobclient.spec.ts @@ -364,7 +364,6 @@ describe("BlobClient Node.js only", () => { }); it("query should work with conditional tags", async function() { - recorder.skip(undefined, "TODO: figure out why quick query do not work with recording"); const csvContent = "100,200,300,400\n150,250,350,450\n"; await blockBlobClient.upload(csvContent, csvContent.length, { tags: { tag: "val" } }); diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_for_snapshot.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_for_snapshot.json index ae036b6c05ed..9508341ef683 100644 --- a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_for_snapshot.json +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_for_snapshot.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "PUT", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { "restype": "share" }, @@ -11,18 +11,18 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:54 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", + "date": "Sat, 10 Oct 2020 07:51:14 GMT", + "etag": "\"0x8D86CF14351E2C7\"", + "last-modified": "Sat, 10 Oct 2020 07:51:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "ec88425d-60fb-47e6-b1ef-e3cc46570b57", - "x-ms-request-id": "776634d3-901a-004c-46bc-9efe96000000", + "x-ms-client-request-id": "4c6840d7-4b39-4c0c-b6aa-7915b9f832ec", + "x-ms-request-id": "945ebcf3-e01a-001b-11da-9e50a5000000", "x-ms-version": "2020-02-10" } }, { "method": "PUT", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { "restype": "share", "comp": "snapshot" @@ -32,21 +32,21 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:55 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", + "date": "Sat, 10 Oct 2020 07:51:14 GMT", + "etag": "\"0x8D86CF14351E2C7\"", + "last-modified": "Sat, 10 Oct 2020 07:51:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "628f1ce3-128e-48f8-b6eb-fc5b04cedee1", - "x-ms-request-id": "776634d7-901a-004c-48bc-9efe96000000", - "x-ms-snapshot": "2020-10-10T04:21:55.0000000Z", + "x-ms-client-request-id": "49aaf0e0-a3b4-4739-8946-7bdfe35a3f08", + "x-ms-request-id": "945ebcf6-e01a-001b-13da-9e50a5000000", + "x-ms-snapshot": "2020-10-10T07:51:15.0000000Z", "x-ms-version": "2020-02-10" } }, { "method": "PUT", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { - "sharesnapshot": "2020-10-10T04:21:55.0000000Z", + "sharesnapshot": "2020-10-10T07:51:15.0000000Z", "comp": "lease", "restype": "share" }, @@ -55,21 +55,21 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:55 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", + "date": "Sat, 10 Oct 2020 07:51:15 GMT", + "etag": "\"0x8D86CF14351E2C7\"", + "last-modified": "Sat, 10 Oct 2020 07:51:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "656f18e6-d7d1-456b-a5a0-de6e947e36eb", + "x-ms-client-request-id": "838e3cd0-3cab-4b2a-ad83-6404ec4c383c", "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", - "x-ms-request-id": "776634da-901a-004c-4abc-9efe96000000", + "x-ms-request-id": "945ebcf8-e01a-001b-15da-9e50a5000000", "x-ms-version": "2020-02-10" } }, { "method": "GET", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { - "sharesnapshot": "2020-10-10T04:21:55.0000000Z", + "sharesnapshot": "2020-10-10T07:51:15.0000000Z", "restype": "share" }, "requestBody": null, @@ -77,26 +77,26 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:56 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", + "date": "Sat, 10 Oct 2020 07:51:16 GMT", + "etag": "\"0x8D86CF14351E2C7\"", + "last-modified": "Sat, 10 Oct 2020 07:51:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "x-ms-access-tier": "TransactionOptimized", - "x-ms-access-tier-change-time": "Sat, 10 Oct 2020 04:21:54 GMT", - "x-ms-client-request-id": "e1cc8bb9-9aee-4379-99bf-223e27a15fe6", + "x-ms-access-tier-change-time": "Sat, 10 Oct 2020 07:51:14 GMT", + "x-ms-client-request-id": "f36139e1-45ec-4e5c-94e9-29b0ba26e6f5", "x-ms-has-immutability-policy": "false", "x-ms-has-legal-hold": "false", "x-ms-lease-duration": "infinite", "x-ms-lease-state": "leased", "x-ms-lease-status": "locked", - "x-ms-request-id": "776634dd-901a-004c-4cbc-9efe96000000", + "x-ms-request-id": "945ebcfc-e01a-001b-18da-9e50a5000000", "x-ms-share-quota": "5120", "x-ms-version": "2020-02-10" } }, { "method": "GET", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { "restype": "share" }, @@ -105,48 +105,25 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:57 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", + "date": "Sat, 10 Oct 2020 07:51:16 GMT", + "etag": "\"0x8D86CF14351E2C7\"", + "last-modified": "Sat, 10 Oct 2020 07:51:14 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "x-ms-access-tier": "TransactionOptimized", - "x-ms-access-tier-change-time": "Sat, 10 Oct 2020 04:21:54 GMT", - "x-ms-client-request-id": "9f99d919-3f2a-4011-b2de-31e9b92451a2", + "x-ms-access-tier-change-time": "Sat, 10 Oct 2020 07:51:14 GMT", + "x-ms-client-request-id": "26f817a6-5d69-4922-906b-b7954756ea80", "x-ms-has-immutability-policy": "false", "x-ms-has-legal-hold": "false", "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", - "x-ms-request-id": "776634e0-901a-004c-4ebc-9efe96000000", + "x-ms-request-id": "945ebd02-e01a-001b-1ada-9e50a5000000", "x-ms-share-quota": "5120", "x-ms-version": "2020-02-10" } }, - { - "method": "PUT", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", - "query": { - "sharesnapshot": "2020-10-10T04:21:55.0000000Z", - "comp": "lease", - "restype": "share" - }, - "requestBody": null, - "status": 200, - "response": "", - "responseHeaders": { - "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:57 GMT", - "etag": "\"0x8D86CD405269335\"", - "last-modified": "Sat, 10 Oct 2020 04:21:54 GMT", - "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "7a2c6622-bf65-4cef-babd-2d1c886f51c4", - "x-ms-lease-time": "0", - "x-ms-request-id": "776634e5-901a-004c-51bc-9efe96000000", - "x-ms-version": "2020-02-10" - } - }, { "method": "DELETE", - "url": "https://fakestorageaccount.file.core.windows.net/share160230371435605703", + "url": "https://fakestorageaccount.file.core.windows.net/share160231627308806358", "query": { "restype": "share" }, @@ -155,19 +132,19 @@ "response": "", "responseHeaders": { "content-length": "0", - "date": "Sat, 10 Oct 2020 04:21:58 GMT", + "date": "Sat, 10 Oct 2020 07:51:17 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", - "x-ms-client-request-id": "bd29e983-3a68-4922-96f0-ed45fcd83d26", - "x-ms-request-id": "776634e7-901a-004c-53bc-9efe96000000", + "x-ms-client-request-id": "60b9fcbe-d47d-4942-a17b-0f6be6180ea2", + "x-ms-request-id": "945ebd05-e01a-001b-1cda-9e50a5000000", "x-ms-version": "2020-02-10" } } ], "uniqueTestInfo": { "uniqueName": { - "share": "share160230371435605703" + "share": "share160231627308806358" }, "newDate": {} }, - "hash": "8a1b842ede74dce1f9477edc6371f29e" + "hash": "487acd291d19992deeae80a7526b6cc0" } \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_for_snapshot.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_for_snapshot.js index 8e28531cdb4c..e3d38fda8c35 100644 --- a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_for_snapshot.js +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_for_snapshot.js @@ -1,95 +1,101 @@ let nock = require('nock'); -module.exports.hash = "66acba6578a6fe70ffea703bf23c4fa7"; +module.exports.hash = "605aa7c32fc39d9cef1923e874e73573"; -module.exports.testInfo = {"uniqueName":{"share":"share160230364967002560"},"newDate":{}} +module.exports.testInfo = {"uniqueName":{"share":"share160231621762403825"},"newDate":{}} nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .put('/share160230364967002560') + .put('/share160231621762403825') .query(true) .reply(201, "", [ 'Content-Length', '0', 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'ETag', - '"0x8D86CD3DE6BB9AC"', + '"0x8D86CF122C31DE4"', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871bda-d01a-005d-5dbc-9e6422000000', + 'c6eefa50-601a-0077-16da-9ebb32000000', 'x-ms-client-request-id', - '5c83f43f-9443-4c5a-bb98-1cd3f5c9de94', + 'fc84405d-a9db-457b-bb36-64bffaf1313e', 'x-ms-version', '2020-02-10', 'Date', - 'Sat, 10 Oct 2020 04:20:49 GMT' + 'Sat, 10 Oct 2020 07:50:19 GMT', + 'Connection', + 'close' ]); nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .put('/share160230364967002560') + .put('/share160231621762403825') .query(true) .reply(201, "", [ 'Content-Length', '0', 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'ETag', - '"0x8D86CD3DE6BB9AC"', + '"0x8D86CF122C31DE4"', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871bdc-d01a-005d-5ebc-9e6422000000', + '26963bc8-001a-0061-16da-9e4de5000000', 'x-ms-client-request-id', - '0ee6db24-ecf7-4cd6-a112-c375a7f122f4', + '4b3062da-1bb2-4fde-b1b8-4e647f06f113', 'x-ms-version', '2020-02-10', 'x-ms-snapshot', - '2020-10-10T04:20:50.0000000Z', + '2020-10-10T07:50:21.0000000Z', 'Date', - 'Sat, 10 Oct 2020 04:20:49 GMT' + 'Sat, 10 Oct 2020 07:50:21 GMT', + 'Connection', + 'close' ]); nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .put('/share160230364967002560') + .put('/share160231621762403825') .query(true) .reply(201, "", [ 'Content-Length', '0', 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'ETag', - '"0x8D86CD3DE6BB9AC"', + '"0x8D86CF122C31DE4"', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871bdf-d01a-005d-60bc-9e6422000000', + 'a54469d4-001a-0013-23da-9e4aaa000000', 'x-ms-client-request-id', - '4148ddc9-2148-4119-8282-ed74bd923bd9', + 'a45c8417-7156-4341-a75b-e57891ef5b49', 'x-ms-version', '2020-02-10', 'x-ms-lease-id', 'e9890485-bf47-4d9a-b3d0-aceb18506124', 'Date', - 'Sat, 10 Oct 2020 04:20:49 GMT' + 'Sat, 10 Oct 2020 07:50:21 GMT', + 'Connection', + 'close' ]); nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .get('/share160230364967002560') + .get('/share160231621762403825') .query(true) .reply(200, "", [ 'Content-Length', '0', 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'ETag', - '"0x8D86CD3DE6BB9AC"', + '"0x8D86CF122C31DE4"', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871be0-d01a-005d-61bc-9e6422000000', + '32797438-201a-003b-47da-9e2b02000000', 'x-ms-client-request-id', - '7654ee54-f431-4b6e-8f11-910cb77c3c6e', + 'f2cb11c4-fd7d-4748-88bf-9f64b202a9ac', 'x-ms-version', '2020-02-10', 'x-ms-lease-status', @@ -107,31 +113,33 @@ nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParam 'x-ms-access-tier', 'TransactionOptimized', 'x-ms-access-tier-change-time', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'Access-Control-Expose-Headers', 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-lease-duration,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-share-quota,x-ms-access-tier,x-ms-access-tier-change-time,Content-Length,Date,Transfer-Encoding', 'Access-Control-Allow-Origin', '*', 'Date', - 'Sat, 10 Oct 2020 04:20:50 GMT' + 'Sat, 10 Oct 2020 07:50:23 GMT', + 'Connection', + 'close' ]); nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .get('/share160230364967002560') + .get('/share160231621762403825') .query(true) .reply(200, "", [ 'Content-Length', '0', 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'ETag', - '"0x8D86CD3DE6BB9AC"', + '"0x8D86CF122C31DE4"', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871be3-d01a-005d-62bc-9e6422000000', + '0f519f12-a01a-0078-5ada-9ecd5e000000', 'x-ms-client-request-id', - 'c51a0fa7-3861-4d9a-bb94-481a720a741e', + '7df7280b-8e52-4de2-87ef-014f37dcddb6', 'x-ms-version', '2020-02-10', 'x-ms-lease-status', @@ -147,41 +155,19 @@ nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParam 'x-ms-access-tier', 'TransactionOptimized', 'x-ms-access-tier-change-time', - 'Sat, 10 Oct 2020 04:20:49 GMT', + 'Sat, 10 Oct 2020 07:50:19 GMT', 'Access-Control-Expose-Headers', 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Last-Modified,ETag,x-ms-lease-status,x-ms-lease-state,x-ms-has-immutability-policy,x-ms-has-legal-hold,x-ms-share-quota,x-ms-access-tier,x-ms-access-tier-change-time,Content-Length,Date,Transfer-Encoding', 'Access-Control-Allow-Origin', '*', 'Date', - 'Sat, 10 Oct 2020 04:20:50 GMT' + 'Sat, 10 Oct 2020 07:50:24 GMT', + 'Connection', + 'close' ]); nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .put('/share160230364967002560') - .query(true) - .reply(200, "", [ - 'Content-Length', - '0', - 'Last-Modified', - 'Sat, 10 Oct 2020 04:20:49 GMT', - 'ETag', - '"0x8D86CD3DE6BB9AC"', - 'Server', - 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', - 'x-ms-request-id', - 'e7871be5-d01a-005d-63bc-9e6422000000', - 'x-ms-client-request-id', - '62f74de0-32d1-4dcf-ac45-25e6b8576284', - 'x-ms-version', - '2020-02-10', - 'x-ms-lease-time', - '0', - 'Date', - 'Sat, 10 Oct 2020 04:20:50 GMT' -]); - -nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) - .delete('/share160230364967002560') + .delete('/share160231621762403825') .query(true) .reply(202, "", [ 'Content-Length', @@ -189,11 +175,13 @@ nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParam 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - 'e7871be6-d01a-005d-64bc-9e6422000000', + '4ad66e7f-401a-005f-20da-9eda9a000000', 'x-ms-client-request-id', - '62f08376-2653-4731-bff3-ebda59e6b7d1', + '7c9541f2-aed4-416e-ab52-94a6fe320bf1', 'x-ms-version', '2020-02-10', 'Date', - 'Sat, 10 Oct 2020 04:20:51 GMT' + 'Sat, 10 Oct 2020 07:50:26 GMT', + 'Connection', + 'close' ]); diff --git a/sdk/storage/storage-file-share/review/storage-file-share.api.md b/sdk/storage/storage-file-share/review/storage-file-share.api.md index 75491d375576..ef0e9da44b7b 100644 --- a/sdk/storage/storage-file-share/review/storage-file-share.api.md +++ b/sdk/storage/storage-file-share/review/storage-file-share.api.md @@ -150,7 +150,7 @@ export abstract class CredentialPolicy extends BaseRequestPolicy { export type CredentialPolicyCreator = (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => CredentialPolicy; // @public -export type DeleteSnapshotsOptionType = 'include'; +export type DeleteSnapshotsOptionType = 'include' | 'include-leased'; export { deserializationPolicy } diff --git a/sdk/storage/storage-file-share/src/generated/src/models/index.ts b/sdk/storage/storage-file-share/src/generated/src/models/index.ts index 0a5037282dc7..abedbd788e9c 100644 --- a/sdk/storage/storage-file-share/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file-share/src/generated/src/models/index.ts @@ -588,7 +588,7 @@ export interface ShareDeleteMethodOptionalParams extends coreHttp.RequestOptions timeoutInSeconds?: number; /** * Specifies the option include to delete the base share and all of its snapshots. Possible - * values include: 'include' + * values include: 'include', 'include-leased' */ deleteSnapshots?: DeleteSnapshotsOptionType; /** @@ -3477,11 +3477,11 @@ export type PermissionCopyModeType = 'source' | 'override'; /** * Defines values for DeleteSnapshotsOptionType. - * Possible values include: 'include' + * Possible values include: 'include', 'include-leased' * @readonly * @enum {string} */ -export type DeleteSnapshotsOptionType = 'include'; +export type DeleteSnapshotsOptionType = 'include' | 'include-leased'; /** * Defines values for ListSharesIncludeType. diff --git a/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts b/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts index 3d787212b73c..4c989c972f46 100644 --- a/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts +++ b/sdk/storage/storage-file-share/src/generated/src/models/parameters.ts @@ -350,7 +350,8 @@ export const deleteSnapshots: coreHttp.OperationParameter = { type: { name: "Enum", allowedValues: [ - "include" + "include", + "include-leased" ] } } diff --git a/sdk/storage/storage-file-share/test/fileserviceclient.spec.ts b/sdk/storage/storage-file-share/test/fileserviceclient.spec.ts index db4eacb6d45f..92270337ea90 100644 --- a/sdk/storage/storage-file-share/test/fileserviceclient.spec.ts +++ b/sdk/storage/storage-file-share/test/fileserviceclient.spec.ts @@ -334,8 +334,8 @@ describe("FileServiceClient", () => { cors: serviceProperties.cors, minuteMetrics: serviceProperties.minuteMetrics, hourMetrics: serviceProperties.hourMetrics - } - + }; + await serviceClient.setProperties(newServiceProperties); await delay(5 * 1000); diff --git a/sdk/storage/storage-file-share/test/leaseclient.spec.ts b/sdk/storage/storage-file-share/test/leaseclient.spec.ts index 4707d8a9cb39..46436b38f986 100644 --- a/sdk/storage/storage-file-share/test/leaseclient.spec.ts +++ b/sdk/storage/storage-file-share/test/leaseclient.spec.ts @@ -352,7 +352,7 @@ describe("LeaseClient for share", () => { }); afterEach(async function() { - await shareClient.deleteIfExists({ deleteSnapshots: "include" }); + await shareClient.deleteIfExists({ deleteSnapshots: "include-leased" }); await recorder.stop(); }); @@ -389,8 +389,6 @@ describe("LeaseClient for share", () => { assert.equal(result.leaseDuration, undefined); assert.equal(result.leaseState, "available"); assert.equal(result.leaseStatus, "unlocked"); - - await leaseClient.releaseLease(); }); it("acquireLease without proposed lease id, with a finite duration", async () => {