diff --git a/sdk/storage/storage-blob/karma.conf.js b/sdk/storage/storage-blob/karma.conf.js index 36b4fbda909a..18e2277dceb2 100644 --- a/sdk/storage/storage-blob/karma.conf.js +++ b/sdk/storage/storage-blob/karma.conf.js @@ -67,7 +67,9 @@ module.exports = function(config) { "ENCRYPTION_SCOPE_1", "ENCRYPTION_SCOPE_2", "ORS_DEST_ACCOUNT_NAME", - "ORS_DEST_ACCOUNT_SAS" + "ORS_DEST_ACCOUNT_SAS", + "CONTAINER_SOFT_DELETE_ACCOUNT_NAME", + "CONTAINER_SOFT_DELETE_ACCOUNT_SAS" ], // test results reporter to use diff --git a/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container.json b/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container.json new file mode 100644 index 000000000000..9a29399a9caf --- /dev/null +++ b/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container.json @@ -0,0 +1,88 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container160126300203004421", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:16:42 GMT", + "etag": "\"0x8D8635CECF434C8\"", + "last-modified": "Mon, 28 Sep 2020 03:16:43 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "7c0f0296-e5ba-4378-94f8-0cd26bf48431", + "x-ms-request-id": "d3d39dc9-a01e-009c-5b45-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/container160126300203004421", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:16:43 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "7972156d-5f50-4114-9931-567d33ca93f5", + "x-ms-request-id": "d3d39e17-a01e-009c-1c45-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.blob.core.windows.net/", + "query": { + "include": "deleted", + "comp": "list" + }, + "requestBody": null, + "status": 200, + "response": "container160126084293406905true01D69540C360196EMon, 28 Sep 2020 02:40:44 GMT\"0x8D86357E5D6E2D3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:40:44 GMT6container160126106381401561true01D6954159845195Mon, 28 Sep 2020 02:44:56 GMT\"0x8D863587BFB5C7E\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:45:17 GMT6container160126138854301057Mon, 28 Sep 2020 02:52:20 GMT\"0x8D8635984BFED93\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126156070606689true01D695426F2D1935Mon, 28 Sep 2020 02:52:41 GMT\"0x8D8635991A3D4C3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:52:42 GMT7container160126163636303463Mon, 28 Sep 2020 02:54:29 GMT\"0x8D86359D1773488\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126189495206143Mon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6B7F32AC\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126192762308290true01D695434939B1EDMon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6BB07DB9\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:58:48 GMT7container160126192762308290true01D695435B799FC5Mon, 28 Sep 2020 02:59:18 GMT\"0x8D8635A7DEFF0A5\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:59:18 GMT7container160126214436904243true01D69543CB1B180EMon, 28 Sep 2020 03:02:25 GMT\"0x8D8635AED911531\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:02:26 GMT7container160126287722103166Mon, 28 Sep 2020 03:15:09 GMT\"0x8D8635CB50497D2\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126300203004421true01D69545CA7E7E9CMon, 28 Sep 2020 03:16:43 GMT\"0x8D8635CECF434C8\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:16:44 GMT7newcontainer160126234811800748Mon, 28 Sep 2020 03:05:48 GMT\"0x8D8635B66537475\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248509809420Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB7F89648\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248544608083Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB82D9242\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126294120807116Mon, 28 Sep 2020 03:15:41 GMT\"0x8D8635CC7D518BB\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "responseHeaders": { + "content-type": "application/xml", + "date": "Mon, 28 Sep 2020 03:17:14 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "a3d9a31b-2880-449f-ad69-ae53b649ef29", + "x-ms-request-id": "d3d3c833-a01e-009c-3c45-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container160126300203004421", + "query": { + "restype": "container", + "comp": "undelete" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:17:15 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b42ba986-c9c4-4f04-815a-f56eb374bbb1", + "x-ms-request-id": "d3d3c89e-a01e-009c-1845-95c3c0000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "container": "container160126300203004421" + }, + "newDate": {} + }, + "hash": "7d59403e2123de9b95b525b56a0cda54" +} \ No newline at end of file diff --git a/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container_to_a_new_name.json b/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container_to_a_new_name.json new file mode 100644 index 000000000000..d2997081c366 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/browsers/blobserviceclient/recording_restore_container_to_a_new_name.json @@ -0,0 +1,89 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/container160126303601800919", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:17:16 GMT", + "etag": "\"0x8D8635D0084A53B\"", + "last-modified": "Mon, 28 Sep 2020 03:17:16 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ec494d63-76f5-4b2b-88ec-f61edfed2ce1", + "x-ms-request-id": "d3d3c929-a01e-009c-1645-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/container160126303601800919", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:17:17 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "712f2145-b924-42c4-8a07-0aea0e1df047", + "x-ms-request-id": "d3d3c98f-a01e-009c-6a45-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.blob.core.windows.net/", + "query": { + "include": "deleted", + "comp": "list" + }, + "requestBody": null, + "status": 200, + "response": "container160126084293406905true01D69540C360196EMon, 28 Sep 2020 02:40:44 GMT\"0x8D86357E5D6E2D3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:40:44 GMT6container160126106381401561true01D6954159845195Mon, 28 Sep 2020 02:44:56 GMT\"0x8D863587BFB5C7E\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:45:17 GMT6container160126138854301057Mon, 28 Sep 2020 02:52:20 GMT\"0x8D8635984BFED93\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126156070606689true01D695426F2D1935Mon, 28 Sep 2020 02:52:41 GMT\"0x8D8635991A3D4C3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:52:42 GMT7container160126163636303463Mon, 28 Sep 2020 02:54:29 GMT\"0x8D86359D1773488\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126189495206143Mon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6B7F32AC\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126192762308290true01D695434939B1EDMon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6BB07DB9\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:58:48 GMT7container160126192762308290true01D695435B799FC5Mon, 28 Sep 2020 02:59:18 GMT\"0x8D8635A7DEFF0A5\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:59:18 GMT7container160126214436904243true01D69543CB1B180EMon, 28 Sep 2020 03:02:25 GMT\"0x8D8635AED911531\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:02:26 GMT7container160126287722103166Mon, 28 Sep 2020 03:15:09 GMT\"0x8D8635CB50497D2\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126300203004421Mon, 28 Sep 2020 03:17:15 GMT\"0x8D8635D00226D98\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126303601800919true01D69545DE0DBF4DMon, 28 Sep 2020 03:17:16 GMT\"0x8D8635D0084A53B\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:17:17 GMT7newcontainer160126234811800748Mon, 28 Sep 2020 03:05:48 GMT\"0x8D8635B66537475\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248509809420Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB7F89648\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248544608083Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB82D9242\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126294120807116Mon, 28 Sep 2020 03:15:41 GMT\"0x8D8635CC7D518BB\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "responseHeaders": { + "content-type": "application/xml", + "date": "Mon, 28 Sep 2020 03:17:47 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "2ed4e528-ffe1-4c70-8630-ef20d593bdd4", + "x-ms-request-id": "d3d3df0a-a01e-009c-2845-95c3c0000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/newcontainer160126306811600750", + "query": { + "restype": "container", + "comp": "undelete" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Mon, 28 Sep 2020 03:17:48 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1b79c00c-fb02-4ad4-a65e-7724075ef673", + "x-ms-request-id": "d3d3df98-a01e-009c-2045-95c3c0000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "container": "container160126303601800919", + "newcontainer": "newcontainer160126306811600750" + }, + "newDate": {} + }, + "hash": "abb379982ab8a7e39f634206938e3b53" +} \ No newline at end of file diff --git a/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_arrow_output_configurations_for_timestampms.js b/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_arrow_output_configurations_for_timestampms.js new file mode 100644 index 000000000000..b94b3e8afb01 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobclient_nodejs_only/recording_query_should_work_with_arrow_output_configurations_for_timestampms.js @@ -0,0 +1,123 @@ +let nock = require('nock'); + +module.exports.hash = "6dcc9746edd52180ffb83408ed333065"; + +module.exports.testInfo = {"uniqueName":{"container":"container160126471904604167","blob":"blob160126472072205618"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126471904604167') + .query(true) + .reply(201, "", [ + 'Transfer-Encoding', + 'chunked', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:45:20 GMT', + 'ETag', + '"0x8D86360EC5038AA"', + 'x-ms-request-id', + '953eed2d-101e-0001-2549-950155000000', + 'x-ms-client-request-id', + '1de26084-09a0-4c10-8095-e322e79e6358', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:45:20 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126471904604167/blob160126472072205618', "Hello World") + .reply(201, "", [ + 'Transfer-Encoding', + 'chunked', + 'Content-MD5', + 'sQqNsWTgdUEFt6mb5y4/5Q==', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:45:20 GMT', + 'ETag', + '"0x8D86360EC7FF71D"', + 'x-ms-request-id', + '953eed31-101e-0001-2649-950155000000', + 'x-ms-client-request-id', + 'a1be0774-3c6c-4a3f-a34a-7a5105af80e4', + 'x-ms-version', + '2020-02-10', + 'x-ms-content-crc64', + 'YeJLfssylmU=', + 'x-ms-request-server-encrypted', + 'false', + 'Date', + 'Mon, 28 Sep 2020 03:45:20 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126471904604167/blob160126472072205618', "100,200,300,400\n150,250,350,450\n") + .reply(201, "", [ + 'Transfer-Encoding', + 'chunked', + 'Content-MD5', + 'v9C7YWQTetukQaGSOQcgRQ==', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:45:21 GMT', + 'ETag', + '"0x8D86360ECB02EFC"', + 'x-ms-request-id', + '953eed32-101e-0001-2749-950155000000', + 'x-ms-client-request-id', + '94752325-c8e4-41ac-9924-461ecff2b9a8', + 'x-ms-version', + '2020-02-10', + 'x-ms-content-crc64', + 'gema9E3+zEY=', + 'x-ms-request-server-encrypted', + 'false', + 'Date', + 'Mon, 28 Sep 2020 03:45:20 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/container160126471904604167/blob160126472072205618', "SQLselect * from BlobStoragearrowtimestamp[ms]") + .query(true) + .reply(200, Buffer.from("4f626a0102166176726f2e736368656d61be1e5b0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e726573756c7444617461222c0a2020202022646f63223a2022486f6c647320726573756c74206461746120696e2074686520666f726d61742073706563696669656420666f72207468697320717565727920284353562c204a534f4e2c206574632e292e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a202264617461222c0a20202020202020202274797065223a20226279746573220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e6572726f72222c0a2020202022646f63223a2022416e206572726f722074686174206f63637572726564207768696c652070726f63657373696e67207468652071756572792e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a2022666174616c222c0a20202020202020202274797065223a2022626f6f6c65616e222c0a202020202020202022646f63223a2022496620747275652c2074686973206572726f722070726576656e747320667572746865722071756572792070726f63657373696e672e20204d6f726520726573756c742064617461206d61792062652072657475726e65642c20627574207468657265206973206e6f2067756172616e746565207468617420616c6c206f6620746865206f726967696e616c20646174612077696c6c2062652070726f6365737365642e202049662066616c73652c2074686973206572726f7220646f6573206e6f742070726576656e7420667572746865722071756572792070726f63657373696e672e220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a20226e616d65222c0a20202020202020202274797065223a2022737472696e67222c0a202020202020202022646f63223a2022546865206e616d65206f6620746865206572726f72220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a20226465736372697074696f6e222c0a20202020202020202274797065223a2022737472696e67222c0a202020202020202022646f63223a202241206465736372697074696f6e206f6620746865206572726f72220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a2022706f736974696f6e222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520626c6f62206f666673657420617420776869636820746865206572726f72206f63637572726564220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e70726f6772657373222c0a2020202022646f63223a2022496e666f726d6174696f6e2061626f7574207468652070726f6772657373206f6620746865207175657279222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a202262797465735363616e6e6564222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a2022546865206e756d626572206f6620627974657320746861742068617665206265656e207363616e6e6564220a2020202020207d2c0a2020202020207b0a2020202020202020226e616d65223a2022746f74616c4279746573222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520746f74616c206e756d626572206f6620627974657320746f206265207363616e6e656420696e2074686973207175657279220a2020202020207d0a202020205d0a20207d2c0a20207b0a202020202274797065223a20227265636f7264222c0a20202020226e616d65223a2022636f6d2e6d6963726f736f66742e617a7572652e73746f726167652e7175657279426c6f62436f6e74656e74732e656e64222c0a2020202022646f63223a202253656e74206173207468652066696e616c206d657373616765206f662074686520726573706f6e73652c20696e6469636174696e67207468617420616c6c20726573756c74732068617665206265656e2073656e742e222c0a20202020226669656c6473223a205b0a2020202020207b0a2020202020202020226e616d65223a2022746f74616c4279746573222c0a20202020202020202274797065223a20226c6f6e67222c0a202020202020202022646f63223a202254686520746f74616c206e756d626572206f6620627974657320746f206265207363616e6e656420696e2074686973207175657279220a2020202020207d0a202020205d0a20207d0a5d0a00c8de5ff1a9bfc040bace30a29b8861d102f60300f003ffffffff780000001000000000000a000c000600050008000a000000000103000c000000080008000000040008000000040000000100000014000000100014000800060007000c0000001000100000000000010a2000000014000000040000000000000000000600080006000600000000000100010000003100000000000000ffffffff700000001000000000000a000e000600050008000a000000000303001000000000000a000c000000040008000a0000003000000004000000020000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000c8de5ff1a9bfc040bace30a29b8861d102040000c8de5ff1a9bfc040bace30a29b8861d1028e01020116436c69656e744572726f726e4e756d626572206f6620636f6c756d6e7320696e2074686520726f7720646f6573206e6f74206d617463682074686520736368656d612e00c8de5ff1a9bfc040bace30a29b8861d10206044040c8de5ff1a9bfc040bace30a29b8861d102040640c8de5ff1a9bfc040bace30a29b8861d1", "hex"), [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'avro/binary', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:45:21 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8D86360ECB02EFC"', + 'x-ms-creation-time', + 'Mon, 28 Sep 2020 03:45:20 GMT', + 'x-ms-lease-state', + 'available', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-request-id', + '953eed33-101e-0001-2849-950155000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '259e9e32-cca4-403d-b912-59aeb9522db9', + 'Date', + 'Mon, 28 Sep 2020 03:45:21 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container160126471904604167') + .query(true) + .reply(202, "", [ + 'Transfer-Encoding', + 'chunked', + 'x-ms-request-id', + '4e5a5f6e-901e-0002-4e49-95f235000000', + 'x-ms-client-request-id', + '8521c0d3-c4f6-4417-82ab-29dee21f9340', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:45:22 GMT' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container.js b/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container.js new file mode 100644 index 000000000000..9f719d617fb1 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container.js @@ -0,0 +1,87 @@ +let nock = require('nock'); + +module.exports.hash = "1a05718a0ff21b8797d5b152061afbea"; + +module.exports.testInfo = {"uniqueName":{"container":"container160126287722103166"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126287722103166') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:14:38 GMT', + 'ETag', + '"0x8D8635CA25BAEF0"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6bbe3-e01e-0024-0145-959806000000', + 'x-ms-client-request-id', + '2360d180-02e7-4905-ad11-755ff7bc749f', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:14:37 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container160126287722103166') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6bc0a-e01e-0024-1e45-959806000000', + 'x-ms-client-request-id', + 'c56253b3-3ac8-4eb6-a6a2-05b1b0b68dfd', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:14:38 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "container160126084293406905true01D69540C360196EMon, 28 Sep 2020 02:40:44 GMT\"0x8D86357E5D6E2D3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:40:44 GMT6container160126106381401561true01D6954159845195Mon, 28 Sep 2020 02:44:56 GMT\"0x8D863587BFB5C7E\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:45:17 GMT7container160126138854301057Mon, 28 Sep 2020 02:52:20 GMT\"0x8D8635984BFED93\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126156070606689true01D695426F2D1935Mon, 28 Sep 2020 02:52:41 GMT\"0x8D8635991A3D4C3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:52:42 GMT7container160126163636303463Mon, 28 Sep 2020 02:54:29 GMT\"0x8D86359D1773488\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126189495206143Mon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6B7F32AC\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126192762308290true01D695434939B1EDMon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6BB07DB9\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:58:48 GMT7container160126192762308290true01D695435B799FC5Mon, 28 Sep 2020 02:59:18 GMT\"0x8D8635A7DEFF0A5\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:59:18 GMT7container160126214436904243true01D69543CB1B180EMon, 28 Sep 2020 03:02:25 GMT\"0x8D8635AED911531\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:02:26 GMT7container160126287722103166true01D695457FE6286FMon, 28 Sep 2020 03:14:38 GMT\"0x8D8635CA25BAEF0\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:14:38 GMT7newcontainer160126234811800748Mon, 28 Sep 2020 03:05:48 GMT\"0x8D8635B66537475\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248509809420Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB7F89648\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248544608083Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB82D9242\"unlockedavailable$account-encryption-keyfalsefalsefalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6d002-e01e-0024-4c45-959806000000', + 'x-ms-client-request-id', + 'e670009f-9c91-47e9-ae52-18e3663c0c14', + 'x-ms-version', + '2020-02-10', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Mon, 28 Sep 2020 03:15:08 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126287722103166') + .query(true) + .reply(201, "", [ + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6d05e-e01e-0024-1d45-959806000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '3a90c421-d61a-47ba-af6b-2b88ad37b77d', + 'Date', + 'Mon, 28 Sep 2020 03:15:09 GMT', + 'Content-Length', + '0' +]); diff --git a/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container_to_a_new_name.js b/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container_to_a_new_name.js new file mode 100644 index 000000000000..6ea93ac38201 --- /dev/null +++ b/sdk/storage/storage-blob/recordings/node/blobserviceclient/recording_restore_container_to_a_new_name.js @@ -0,0 +1,87 @@ +let nock = require('nock'); + +module.exports.hash = "5bfeb55e47a68f2fc0cd9636c26ca427"; + +module.exports.testInfo = {"uniqueName":{"container":"container160126290998402953","newcontainer":"newcontainer160126294120807116"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/container160126290998402953') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Mon, 28 Sep 2020 03:15:10 GMT', + 'ETag', + '"0x8D8635CB538BE26"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6d09a-e01e-0024-4e45-959806000000', + 'x-ms-client-request-id', + 'd41f9461-ec86-457f-a59c-d8e160ee0f32', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:15:09 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/container160126290998402953') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6d0eb-e01e-0024-1945-959806000000', + 'x-ms-client-request-id', + '76bb088d-9d9a-413b-a6d2-c83beaace12e', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 03:15:09 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "container160126084293406905true01D69540C360196EMon, 28 Sep 2020 02:40:44 GMT\"0x8D86357E5D6E2D3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:40:44 GMT6container160126106381401561true01D6954159845195Mon, 28 Sep 2020 02:44:56 GMT\"0x8D863587BFB5C7E\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:45:17 GMT7container160126138854301057Mon, 28 Sep 2020 02:52:20 GMT\"0x8D8635984BFED93\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126156070606689true01D695426F2D1935Mon, 28 Sep 2020 02:52:41 GMT\"0x8D8635991A3D4C3\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:52:42 GMT7container160126163636303463Mon, 28 Sep 2020 02:54:29 GMT\"0x8D86359D1773488\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126189495206143Mon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6B7F32AC\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126192762308290true01D695434939B1EDMon, 28 Sep 2020 02:58:47 GMT\"0x8D8635A6BB07DB9\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:58:48 GMT7container160126192762308290true01D695435B799FC5Mon, 28 Sep 2020 02:59:18 GMT\"0x8D8635A7DEFF0A5\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 02:59:18 GMT7container160126214436904243true01D69543CB1B180EMon, 28 Sep 2020 03:02:25 GMT\"0x8D8635AED911531\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:02:26 GMT7container160126287722103166Mon, 28 Sep 2020 03:15:09 GMT\"0x8D8635CB50497D2\"unlockedavailable$account-encryption-keyfalsefalsefalsecontainer160126290998402953true01D6954592C1FDF6Mon, 28 Sep 2020 03:15:10 GMT\"0x8D8635CB538BE26\"unlockedexpired$account-encryption-keyfalsefalsefalseMon, 28 Sep 2020 03:15:10 GMT7newcontainer160126234811800748Mon, 28 Sep 2020 03:05:48 GMT\"0x8D8635B66537475\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248509809420Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB7F89648\"unlockedavailable$account-encryption-keyfalsefalsefalsenewcontainer160126248544608083Mon, 28 Sep 2020 03:08:05 GMT\"0x8D8635BB82D9242\"unlockedavailable$account-encryption-keyfalsefalsefalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6f2ad-e01e-0024-7945-959806000000', + 'x-ms-client-request-id', + '1bad920a-73b3-4dee-809b-849d257e0a1e', + 'x-ms-version', + '2020-02-10', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Mon, 28 Sep 2020 03:15:40 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/newcontainer160126294120807116') + .query(true) + .reply(201, "", [ + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'bbe6f33e-e01e-0024-7f45-959806000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '1d198345-d9bb-4447-b270-79afa8f7d6e0', + 'Date', + 'Mon, 28 Sep 2020 03:15:40 GMT', + 'Content-Length', + '0' +]); diff --git a/sdk/storage/storage-blob/review/storage-blob.api.md b/sdk/storage/storage-blob/review/storage-blob.api.md index 2fc23eec9775..6348bb28591d 100644 --- a/sdk/storage/storage-blob/review/storage-blob.api.md +++ b/sdk/storage/storage-blob/review/storage-blob.api.md @@ -1045,7 +1045,7 @@ export class BlobServiceClient extends StorageClient { getUserDelegationKey(startsOn: Date, expiresOn: Date, options?: ServiceGetUserDelegationKeyOptions): Promise; listContainers(options?: ServiceListContainersOptions): PagedAsyncIterableIterator; setProperties(properties: BlobServiceProperties, options?: ServiceSetPropertiesOptions): Promise; - undeleteContainer(deletedContainerName: string, destinationContainerName?: string, options?: ContainerUndeleteOptions): Promise<{ + undeleteContainer(deletedContainerName: string, deletedContainerVersion: string, options?: ServiceUndeleteContainerOptions): Promise<{ containerClient: ContainerClient; containerUndeleteResponse: ContainerUndeleteResponse; }>; @@ -1908,12 +1908,6 @@ export interface ContainerUndeleteHeaders { version?: string; } -// @public -export interface ContainerUndeleteOptions extends CommonOptions { - abortSignal?: AbortSignalLike; - deletedContainerVersion?: string; -} - // @public export type ContainerUndeleteResponse = ContainerUndeleteHeaders & { _response: coreHttp.HttpResponse & { @@ -2842,6 +2836,12 @@ export type ServiceSubmitBatchResponseModel = ServiceSubmitBatchHeaders & { }; }; +// @public +export interface ServiceUndeleteContainerOptions extends CommonOptions { + abortSignal?: AbortSignalLike; + destinationContainerName?: string; +} + // @public export interface SignedIdentifier { accessPolicy: { diff --git a/sdk/storage/storage-blob/sample.env b/sdk/storage/storage-blob/sample.env index 99294db65c63..4920b5bec3c3 100644 --- a/sdk/storage/storage-blob/sample.env +++ b/sdk/storage/storage-blob/sample.env @@ -21,4 +21,10 @@ AZURE_CLIENT_SECRET= # Our tests assume that TEST_MODE is "playback" by default. You can # change it to "record" to generate new recordings, or "live" to bypass the recorder entirely. -# TEST_MODE=playback \ No newline at end of file +# TEST_MODE=playback + +# Optional, used for testing container soft delete. +CONTAINER_SOFT_DELETE_ACCOUNT_NAME= +CONTAINER_SOFT_DELETE_ACCOUNT_KEY= +CONTAINER_SOFT_DELETE_STORAGE_CONNECTION_STRING= +CONTAINER_SOFT_DELETE_ACCOUNT_SAS= diff --git a/sdk/storage/storage-blob/src/BlobServiceClient.ts b/sdk/storage/storage-blob/src/BlobServiceClient.ts index eb236ff53740..160c2804e9cf 100644 --- a/sdk/storage/storage-blob/src/BlobServiceClient.ts +++ b/sdk/storage/storage-blob/src/BlobServiceClient.ts @@ -326,24 +326,25 @@ export declare type ServiceGetUserDelegationKeyResponse = UserDelegationKey & * Options to configure {@link BlobServiceClient.undeleteContainer} operation. * * @export - * @interface ContainerUndeleteOptions + * @interface ServiceUndeleteContainerOptions */ -export interface ContainerUndeleteOptions extends CommonOptions { +export interface ServiceUndeleteContainerOptions extends CommonOptions { /** * An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation. * For example, use the @azure/abort-controller to create an `AbortSignal`. * * @type {AbortSignalLike} - * @memberof ContainerUndeleteOptions + * @memberof ServiceUndeleteContainerOptions */ abortSignal?: AbortSignalLike; /** - * Optional. Specifies the version of the deleted container to restore. + * Optional. Specifies the new name of the restored container. + * Will use its original name if this is not specified. * * @type {string} - * @memberof ContainerUndeleteOptions + * @memberof ServiceUndeleteContainerOptions */ - deletedContainerVersion?: string; + destinationContainerName?: string; } /** @@ -576,14 +577,14 @@ export class BlobServiceClient extends StorageClient { * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container. * * @param {string} deletedContainerName Name of the previously deleted container. - * @param {ContainerUndeleteOptions} [options] Options to configure Container undelete operation. - * @returns {Promise} Container deletion response. + * @param {string} deletedContainerVersion Version of the previously deleted container, used to uniquely identify the deleted container. + * @returns {Promise} Container deletion response. * @memberof BlobServiceClient */ public async undeleteContainer( deletedContainerName: string, - destinationContainerName?: string, - options: ContainerUndeleteOptions = {} + deletedContainerVersion: string, + options: ServiceUndeleteContainerOptions = {} ): Promise<{ containerClient: ContainerClient; containerUndeleteResponse: ContainerUndeleteResponse; @@ -594,11 +595,13 @@ export class BlobServiceClient extends StorageClient { ); try { const containerClient = this.getContainerClient( - destinationContainerName || deletedContainerName + options.destinationContainerName || deletedContainerName ); - const container = new Container((containerClient as any).storageClientContext); - const containerUndeleteResponse = await container.restore({ + // Hack to access a protected member. + const containerContext = new Container(containerClient["storageClientContext"]); + const containerUndeleteResponse = await containerContext.restore({ deletedContainerName, + deletedContainerVersion, ...options, tracingOptions: { ...options!.tracingOptions, spanOptions } }); diff --git a/sdk/storage/storage-blob/test/blobclient.spec.ts b/sdk/storage/storage-blob/test/blobclient.spec.ts index 9e32fff8cb9a..de5319471f2a 100644 --- a/sdk/storage/storage-blob/test/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobclient.spec.ts @@ -828,6 +828,22 @@ describe("BlobClient", () => { await checkRehydratePriority("Standard"); }); + // Preview in STG74, limited regions and customers + it.skip("lastAccessed returned", async () => { + const downloadRes = await blockBlobClient.download(); + // assert.ok(downloadRes.lastAccessed); + console.log(downloadRes.lastAccessed); + + const getPropertiesRes = await blockBlobClient.getProperties(); + // assert.ok(getPropertiesRes.lastAccessed); + console.log(getPropertiesRes); + + for await (const blobItem of containerClient.listBlobsFlat()) { + console.log(blobItem.properties); + // assert.ok(blobItem.properties.lastAccessedOn); + } + }); + describe("conditional tags", () => { const tags = { tag1: "val1", diff --git a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts index 39350c1dc0f9..73aab11977f1 100644 --- a/sdk/storage/storage-blob/test/blobserviceclient.spec.ts +++ b/sdk/storage/storage-blob/test/blobserviceclient.spec.ts @@ -5,6 +5,7 @@ import { BlobServiceClient } from "../src"; import { getAlternateBSU, getBSU, + getGenericBSU, getSASConnectionStringFromEnvironment, getTokenBSU, recorderEnvSetup, @@ -561,4 +562,74 @@ describe("BlobServiceClient", () => { assert.equal(staticWebsite?.errorDocument404Path, errorDocument404Path); assert.equal(staticWebsite?.defaultIndexDocumentPath, defaultIndexDocumentPath); }); + + it("restore container", async function() { + let blobServiceClient: BlobServiceClient; + try { + blobServiceClient = getGenericBSU("CONTAINER_SOFT_DELETE_"); + } catch (err) { + this.skip(); + } + + const containerName = recorder.getUniqueName("container"); + const containerClient = blobServiceClient.getContainerClient(containerName); + + await containerClient.create(); + await containerClient.delete(); + + await delay(30 * 1000); + + for await (const containerItem of blobServiceClient.listContainers({ includeDeleted: true })) { + if (containerItem.deleted && containerItem.name === containerName) { + // check list container response + assert.ok(containerItem.version); + assert.ok(containerItem.properties.deletedOn); + assert.ok(containerItem.properties.remainingRetentionDays); + + const restoreRes = await blobServiceClient.undeleteContainer( + containerName, + containerItem.version! + ); + assert.equal(restoreRes.containerClient.containerName, containerName); + break; + } + } + }); + + it("restore container to a new name", async function() { + let blobServiceClient: BlobServiceClient; + try { + blobServiceClient = getGenericBSU("CONTAINER_SOFT_DELETE_"); + } catch (err) { + this.skip(); + } + + const containerName = recorder.getUniqueName("container"); + const containerClient = blobServiceClient.getContainerClient(containerName); + + await containerClient.create(); + await containerClient.delete(); + await delay(30 * 1000); + + for await (const containerItem of blobServiceClient.listContainers({ includeDeleted: true })) { + if (containerItem.deleted && containerItem.name === containerName) { + // check list container response + assert.ok(containerItem.version); + assert.ok(containerItem.properties.deletedOn); + assert.ok(containerItem.properties.remainingRetentionDays); + + const newContainerName = recorder.getUniqueName("newcontainer"); + const restoreRes2 = await blobServiceClient.undeleteContainer( + containerName, + containerItem.version!, + { + destinationContainerName: newContainerName + } + ); + assert.equal(restoreRes2.containerClient.containerName, newContainerName); + + break; + } + } + }); }); diff --git a/sdk/storage/storage-blob/test/node/blobclient.spec.ts b/sdk/storage/storage-blob/test/node/blobclient.spec.ts index 68f9bfc0b7d5..229dbbad000a 100644 --- a/sdk/storage/storage-blob/test/node/blobclient.spec.ts +++ b/sdk/storage/storage-blob/test/node/blobclient.spec.ts @@ -667,4 +667,20 @@ describe("BlobClient Node.js only", () => { "ffffffff800000001000000000000a000c000600050008000a000000000103000c000000080008000000040008000000040000000100000014000000100014000800060007000c000000100010000000000001072400000014000000040000000000000008000c0004000800080000000400000002000000040000006e616d650000000000000000ffffffff700000001000000000000a000e000600050008000a000000000303001000000000000a000c000000040008000a0000003000000004000000020000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000" ); }); + + it("query should work with arrow output configurations for timestamp[ms]", async function() { + const csvContent = "100,200,300,400\n150,250,350,450\n"; + await blockBlobClient.upload(csvContent, csvContent.length); + + await blockBlobClient.query("select * from BlobStorage", { + outputTextConfiguration: { + kind: "arrow", + schema: [ + { + type: "timestamp[ms]" + } + ] + } + }); + }); }); diff --git a/sdk/storage/storage-blob/test/utils/testutils.common.ts b/sdk/storage/storage-blob/test/utils/testutils.common.ts index c93bc94402e9..06c37b34c4d9 100644 --- a/sdk/storage/storage-blob/test/utils/testutils.common.ts +++ b/sdk/storage/storage-blob/test/utils/testutils.common.ts @@ -31,7 +31,11 @@ export const recorderEnvSetup: RecorderEnvironmentSetup = { ORS_DEST_ACCOUNT_NAME: `${mockAccountName1}`, ORS_DEST_ACCOUNT_KEY: `${mockAccountKey}`, ORS_DEST_ACCOUNT_SAS: `${mockAccountKey}`, - ORS_DEST_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockAccountName1};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net` + ORS_DEST_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockAccountName1};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`, + CONTAINER_SOFT_DELETE_ACCOUNT_NAME: `${mockAccountName}`, + CONTAINER_SOFT_DELETE_ACCOUNT_KEY: `${mockAccountKey}`, + CONTAINER_SOFT_DELETE_ACCOUNT_SAS: `${mockAccountKey}`, + CONTAINER_SOFT_DELETE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net` }, customizationsOnRecordings: [ // Used in record mode diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only/recording_construct_sasqueryparameters_with_a_option_bag.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only/recording_construct_sasqueryparameters_with_a_option_bag.js new file mode 100644 index 000000000000..c7b887426215 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only/recording_construct_sasqueryparameters_with_a_option_bag.js @@ -0,0 +1,5 @@ +let nock = require('nock'); + +module.exports.hash = "dfb5256fbffeadfe6df18dddf4c3fc5b"; + +module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_for_directory_should_work_for_permissions_m_e_o_p.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_for_directory_should_work_for_permissions_m_e_o_p.js new file mode 100644 index 000000000000..b08cd0020c6c --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_for_directory_should_work_for_permissions_m_e_o_p.js @@ -0,0 +1,161 @@ +let nock = require('nock'); + +module.exports.hash = "c632b8f565a1f09ddd0d399c60fc04aa"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119116256900728","directory":"directory160119116309402910","file":"file160119116449005138"},"newDate":{"now":"2020-09-27T07:19:21.139Z","tmr":"2020-09-27T07:19:21.140Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/', "2020-09-27T06:19:21Z2020-10-02T07:19:21Z") + .query(true) + .reply(200, "1ce13278-a083-4d15-8796-de39717793e172f988bf-86f1-41af-91ab-2d7cd011db472020-09-27T06:19:21Z2020-10-02T07:19:21Zb2020-02-10l4kTXsRyr0o+LQCeJFCYgeIHfdbKrPqfwDeQzdtzjtw=", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '01da158f-b01e-0095-069e-94a515000000', + 'x-ms-client-request-id', + '37bb5e48-dd76-4402-b71a-19ef6c02c364', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:19:21 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119116256900728') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 07:19:22 GMT', + 'ETag', + '"0x8D862B5A87340F9"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '01da15ac-b01e-0095-1b9e-94a515000000', + 'x-ms-client-request-id', + '0922c281-181c-460c-9a85-9df62e3479c5', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:19:22 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119116256900728/directory160119116309402910') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'ETag', + '"0x8D862B5A965E89F"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '6168ec27-901f-0082-239e-940c1e000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '9b4b8f35-60d0-45ad-837b-424cf18e27fc', + 'Date', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119116256900728/directory160119116309402910/file160119116449005138') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'ETag', + '"0x8D862B5A9950CAE"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '6168ec33-901f-0082-2e9e-940c1e000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'f8dbc4ca-1d77-466f-bf4b-49de6aec966e', + 'Date', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem160119116256900728/directory160119116309402910') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'ETag', + '"0x8D862B5A965E89F"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-owner', + '1ce13278-a083-4d15-8796-de39717793e1', + 'x-ms-group', + '1ce13278-a083-4d15-8796-de39717793e1', + 'x-ms-permissions', + 'rwxr-x---', + 'x-ms-acl', + 'user::rwx,group::r-x,other::---', + 'x-ms-request-id', + '6168ec34-901f-0082-2f9e-940c1e000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'c253ee46-9f26-450a-bb48-0b3b7958fdf0', + 'Date', + 'Sun, 27 Sep 2020 07:19:24 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119116256900728/directory160119116309402910') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:19:24 GMT', + 'ETag', + '"0x8D862B5A965E89F"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '549fca7e-301f-0040-509e-944a98000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'dff76112-3a80-46cf-81b6-973d7d21ddb1', + 'Date', + 'Sun, 27 Sep 2020 07:19:25 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119116256900728') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '01da173b-b01e-0095-389e-94a515000000', + 'x-ms-client-request-id', + '63894e3c-0bd7-4be0-ab5a-37b4b4ea38c4', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:19:25 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_agentobjectid_preauthorizedagentobjectid.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_agentobjectid_preauthorizedagentobjectid.js new file mode 100644 index 000000000000..b53f123829d8 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_agentobjectid_preauthorizedagentobjectid.js @@ -0,0 +1,199 @@ +let nock = require('nock'); + +module.exports.hash = "3989fdb0b96130e65077bdaf1ec162cc"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119534928207862","directory":"directory160119535006806265","file":"file160119535129300958","newFile":"newFile160119535219701256"},"newDate":{"now":"2020-09-27T08:29:07.896Z","tmr":"2020-09-27T08:29:07.899Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/', "2020-09-27T07:29:07Z2020-10-02T08:29:07Z") + .query(true) + .reply(200, "1ce13278-a083-4d15-8796-de39717793e172f988bf-86f1-41af-91ab-2d7cd011db472020-09-27T07:29:07Z2020-10-02T08:29:07Zb2020-02-10n7l+WyBU729HYlmsyySs+b1doLOdUjpiyNGwih71kdA=", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3a8db1f9-e01e-0088-4ba8-94a8a9000000', + 'x-ms-client-request-id', + '94edd8a1-7450-4b2f-b1f4-a9f3b9972568', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:29:09 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 08:29:09 GMT', + 'ETag', + '"0x8D862BF680168AD"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3a8db24b-e01e-0088-7ba8-94a8a9000000', + 'x-ms-client-request-id', + '116e3845-066b-48f9-8860-015fd152ec8f', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:29:09 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862/directory160119535006806265') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:29:11 GMT', + 'ETag', + '"0x8D862BF68EA46EC"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '4e38adcf-201f-0001-80a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'b9e61ccd-859d-4ac2-8e77-373c75e355e0', + 'Date', + 'Sun, 27 Sep 2020 08:29:10 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862/directory160119535006806265/file160119535129300958') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:29:11 GMT', + 'ETag', + '"0x8D862BF692346C1"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '4e38add0-201f-0001-01a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '13bc96e3-4e77-4654-aafc-f4410bcb5eb3', + 'Date', + 'Sun, 27 Sep 2020 08:29:10 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119534928207862/%2F') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:29:09 GMT', + 'ETag', + '"0x8D862BF682FEFE2"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '4e38add2-201f-0001-03a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'b3bc8ae1-c329-4c40-972a-8344e7638b0c', + 'Date', + 'Sun, 27 Sep 2020 08:29:11 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862/newFile160119535219701256') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:29:12 GMT', + 'ETag', + '"0x8D862BF69C60FD2"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '4e38add4-201f-0001-05a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '8ad6f1e6-ebc3-490a-a66c-43a44547afe3', + 'Date', + 'Sun, 27 Sep 2020 08:29:11 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862/newFile160119535219701256') + .query(true) + .reply(403, {"error":{"code":"AuthorizationPermissionMismatch","message":"This request is not authorized to perform this operation using this permission.\nRequestId:4e38add5-201f-0001-06a8-94127c000000\nTime:2020-09-27T08:29:12.9183732Z"}}, [ + 'Content-Length', + '227', + 'Content-Type', + 'application/json;charset=utf-8', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-error-code', + 'AuthorizationPermissionMismatch', + 'x-ms-request-id', + '4e38add5-201f-0001-06a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '081286cf-8a72-4c92-8ae4-ca8c9a2b7891', + 'Date', + 'Sun, 27 Sep 2020 08:29:12 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119534928207862/newFile160119535219701256') + .query(true) + .reply(409, {"error":{"code":"PathAlreadyExists","message":"The specified path already exists.\nRequestId:4e38add6-201f-0001-07a8-94127c000000\nTime:2020-09-27T08:29:13.2576143Z"}}, [ + 'Content-Length', + '168', + 'Content-Type', + 'application/json;charset=utf-8', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-error-code', + 'PathAlreadyExists', + 'x-ms-request-id', + '4e38add6-201f-0001-07a8-94127c000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '0dbc702c-fb99-41c3-bbda-16eddd89e264', + 'Date', + 'Sun, 27 Sep 2020 08:29:12 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119534928207862') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3a8db511-e01e-0088-44a8-94a8a9000000', + 'x-ms-client-request-id', + 'b0b4dd4a-93cd-4dde-88e7-d15c2271455d', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:29:13 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_correlationid.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_correlationid.js new file mode 100644 index 000000000000..acd90fb18815 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_delegation_sas/recording_generateuserdelegationsas_should_work_with_correlationid.js @@ -0,0 +1,129 @@ +let nock = require('nock'); + +module.exports.hash = "9bcada1e1c90bd5e6d1bdb8e5fa637b4"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119597598007601","directory":"directory160119597641207244","file":"file160119597792806566"},"newDate":{"now":"2020-09-27T08:39:34.507Z","tmr":"2020-09-27T08:39:34.508Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .post('/', "2020-09-27T07:39:34Z2020-10-02T08:39:34Z") + .query(true) + .reply(200, "1ce13278-a083-4d15-8796-de39717793e172f988bf-86f1-41af-91ab-2d7cd011db472020-09-27T07:39:34Z2020-10-02T08:39:34Zb2020-02-10UqyKLG9BCI93ihy03vAzqHDOf1yE/ljQ1+SobVbO1tU=", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1b1d61a4-f01e-003d-51a9-943bbb000000', + 'x-ms-client-request-id', + '710bf4c1-4023-48b0-8e8f-9f39ae2eae92', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:39:35 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119597598007601') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 08:39:36 GMT', + 'ETag', + '"0x8D862C0DD7905C7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1b1d61e0-f01e-003d-7da9-943bbb000000', + 'x-ms-client-request-id', + '4c8b5dfc-bcee-4c71-aca0-d260c0287314', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:39:36 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119597598007601/directory160119597641207244') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:39:37 GMT', + 'ETag', + '"0x8D862C0DE67DAFD"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '33e3a1f6-101f-0057-7ca9-94e393000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '7b67d1f1-cc31-4e36-8336-939bc3908800', + 'Date', + 'Sun, 27 Sep 2020 08:39:37 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119597598007601/directory160119597641207244/file160119597792806566') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 08:39:38 GMT', + 'ETag', + '"0x8D862C0DEA4F54D"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '33e3a1f7-101f-0057-7da9-94e393000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '56895691-579b-4230-8ab3-a58f39b4c9ef', + 'Date', + 'Sun, 27 Sep 2020 08:39:37 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .get('/filesystem160119597598007601') + .query(true) + .reply(200, {"paths":[{"contentLength":"0","creationTime":"132456695777516285","etag":"0x8D862C0DE67DAFD","group":"1ce13278-a083-4d15-8796-de39717793e1","isDirectory":"true","lastModified":"Sun, 27 Sep 2020 08:39:37 GMT","name":"directory160119597641207244","owner":"1ce13278-a083-4d15-8796-de39717793e1","permissions":"rwxr-x---"}]}, [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/json;charset=utf-8', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '33e3a1f9-101f-0057-7fa9-94e393000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'fa21bb63-ab4b-478c-bb08-fc778074b83c', + 'Date', + 'Sun, 27 Sep 2020 08:39:38 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119597598007601') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1b1d63e6-f01e-003d-77a9-943bbb000000', + 'x-ms-client-request-id', + 'a00f26d0-3f9c-4325-a614-29826a2ef10f', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 08:39:39 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_could_calculate_directory_depth.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_could_calculate_directory_depth.js new file mode 100644 index 000000000000..2d970261877f --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_could_calculate_directory_depth.js @@ -0,0 +1,137 @@ +let nock = require('nock'); + +module.exports.hash = "f5618eb4b00f99d8fbe537045b47c869"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119778328205800","directory":"directory160119778601405130","file":"file160119778728208354"},"newDate":{"now":"2020-09-27T09:09:47.683Z","tmr":"2020-09-27T09:09:47.686Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119778328205800') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 09:09:44 GMT', + 'ETag', + '"0x8D862C51351C59F"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '775dc43f-001e-0090-22ad-9477ce000000', + 'x-ms-client-request-id', + '88f199dc-4197-4239-acd4-3077c0bb23ac', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 09:09:44 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119778328205800/directory160119778601405130') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'ETag', + '"0x8D862C514DB4881"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '595272f6-901f-0049-09ad-940f4b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '81d7508e-5e3a-4e29-814b-43ac0e185692', + 'Date', + 'Sun, 27 Sep 2020 09:09:46 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119778328205800/directory160119778601405130/file160119778728208354') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'ETag', + '"0x8D862C51518BDA4"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '595272f7-901f-0049-0aad-940f4b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '5aa3b393-c51d-46ea-a66c-6479eaecd67d', + 'Date', + 'Sun, 27 Sep 2020 09:09:46 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119778328205800/directory160119778601405130') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'ETag', + '"0x8D862C514DB4881"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '595272fb-901f-0049-0ead-940f4b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'bb4eee24-07df-44b9-b8bf-952c6f662436', + 'Date', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119778328205800/directory160119778601405130') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'ETag', + '"0x8D862C514DB4881"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '595272fd-901f-0049-10ad-940f4b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '10b5e382-4343-40e1-a2de-e8759b15b9df', + 'Date', + 'Sun, 27 Sep 2020 09:09:47 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119778328205800') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '775dc555-001e-0090-7aad-9477ce000000', + 'x-ms-client-request-id', + 'e3082b9f-9edc-482a-bb90-feeeeb405588', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 09:09:47 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_directory_should_work_for_permissions_m_e_o_p.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_directory_should_work_for_permissions_m_e_o_p.js new file mode 100644 index 000000000000..4dd8bcc83825 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_directory_should_work_for_permissions_m_e_o_p.js @@ -0,0 +1,141 @@ +let nock = require('nock'); + +module.exports.hash = "d63dd630beb0486fd25c48dc18b61be9"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119085691006060","directory":"directory160119085896407057","file":"file160119086034900504"},"newDate":{"now":"2020-09-27T07:14:20.727Z","tmr":"2020-09-27T07:14:20.729Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119085691006060') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:18 GMT', + 'ETag', + '"0x8D862B4F30F7910"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3950febe-a01e-001f-369d-94fea4000000', + 'x-ms-client-request-id', + '60045a93-3c91-4eca-954b-0128d8c130e2', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:18 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119085691006060/directory160119085896407057') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'ETag', + '"0x8D862B4F41BA203"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '73d0580c-e01f-0043-5c9d-94abfc000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '2ff267b5-f5a7-44c6-b69c-cdae4e496db1', + 'Date', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119085691006060/directory160119085896407057/file160119086034900504') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'ETag', + '"0x8D862B4F454A259"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '73d0580d-e01f-0043-5d9d-94abfc000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'cb719bb9-762e-4bd6-aaed-b504714d9214', + 'Date', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem160119085691006060/directory160119085896407057') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'ETag', + '"0x8D862B4F41BA203"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rwxr-x---', + 'x-ms-acl', + 'user::rwx,group::r-x,other::---', + 'x-ms-request-id', + '73d0580e-e01f-0043-5e9d-94abfc000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'f56a21b5-94c5-42a0-bcf4-17145b4ce706', + 'Date', + 'Sun, 27 Sep 2020 07:14:20 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119085691006060/directory160119085896407057') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:20 GMT', + 'ETag', + '"0x8D862B4F41BA203"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + 'd79f91d8-401f-005a-6c9d-942b47000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '6f3969ba-0dfd-4376-b42f-51c5dba576cd', + 'Date', + 'Sun, 27 Sep 2020 07:14:21 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119085691006060') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3951014c-a01e-001f-3a9d-94fea4000000', + 'x-ms-client-request-id', + 'c894f05d-5ed9-4657-8957-5ab62459e5cd', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:21 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_file_should_work_for_permissions_m_e_o_p.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_file_should_work_for_permissions_m_e_o_p.js new file mode 100644 index 000000000000..71abec903441 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_file_should_work_for_permissions_m_e_o_p.js @@ -0,0 +1,141 @@ +let nock = require('nock'); + +module.exports.hash = "39f7c5fcace29f8de1b67dc28f7ed4f6"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119086295008444","directory":"directory160119086329007780","file":"file160119086365704236"},"newDate":{"now":"2020-09-27T07:14:24.025Z","tmr":"2020-09-27T07:14:24.026Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086295008444') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:23 GMT', + 'ETag', + '"0x8D862B4F5DADB98"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '3951018b-a01e-001f-6c9d-94fea4000000', + 'x-ms-client-request-id', + 'a006ad22-f730-44d0-b9c1-2a22121094ac', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:22 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086295008444/directory160119086329007780') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:23 GMT', + 'ETag', + '"0x8D862B4F613F1CD"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd79f91db-401f-005a-6e9d-942b47000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '52ce7a5d-fca8-4500-a2fb-29ef5dc5656d', + 'Date', + 'Sun, 27 Sep 2020 07:14:22 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086295008444/directory160119086329007780/file160119086365704236') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:23 GMT', + 'ETag', + '"0x8D862B4F64C2D26"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd79f91e0-401f-005a-739d-942b47000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '47de2d9a-cacd-4beb-b7d6-5361d535a1bc', + 'Date', + 'Sun, 27 Sep 2020 07:14:22 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem160119086295008444/directory160119086329007780/file160119086365704236') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:23 GMT', + 'ETag', + '"0x8D862B4F64C2D26"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rw-r-----', + 'x-ms-acl', + 'user::rw-,group::r--,other::---', + 'x-ms-request-id', + 'd79f91e2-401f-005a-759d-942b47000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'e2dd6f54-a0ad-426c-b0ee-c950f2ee5767', + 'Date', + 'Sun, 27 Sep 2020 07:14:23 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119086295008444/directory160119086329007780/file160119086365704236') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:23 GMT', + 'ETag', + '"0x8D862B4F64C2D26"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '0453a43a-301f-007f-389d-94823b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '26bd1ab0-8b60-4188-bfa4-25b45030e1b4', + 'Date', + 'Sun, 27 Sep 2020 07:14:25 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119086295008444') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '395102a8-a01e-001f-499d-94fea4000000', + 'x-ms-client-request-id', + '43c13ad8-62bd-415f-a6d8-1456e23c2c28', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:25 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_filesystem_should_work_for_permissions_m_e_o_p.js b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_filesystem_should_work_for_permissions_m_e_o_p.js new file mode 100644 index 000000000000..c0b4f9905e10 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/shared_access_signature_sas_generation_nodejs_only_for_directory_sas/recording_generatedatalakesasqueryparameters_for_filesystem_should_work_for_permissions_m_e_o_p.js @@ -0,0 +1,141 @@ +let nock = require('nock'); + +module.exports.hash = "b38b2cb51a8273c8fbf7c281a4514192"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem160119086619304249","directory":"directory160119086654005398","file":"file160119086686203124"},"newDate":{"now":"2020-09-27T07:14:27.215Z","tmr":"2020-09-27T07:14:27.215Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086619304249') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'ETag', + '"0x8D862B4F7CA5BF6"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '395102c5-a01e-001f-5d9d-94fea4000000', + 'x-ms-client-request-id', + '0a372421-a47f-49fa-9b6c-a17cf51ab37f', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:25 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086619304249/directory160119086654005398') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'ETag', + '"0x8D862B4F7FE0B9B"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '0453a43d-301f-007f-3b9d-94823b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '67f96a25-8d78-469a-87f9-6147181d946a', + 'Date', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem160119086619304249/directory160119086654005398/file160119086686203124') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:27 GMT', + 'ETag', + '"0x8D862B4F83324D1"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '0453a43e-301f-007f-3c9d-94823b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'a09969f8-9da0-4d70-bcb7-bbc1a51716f2', + 'Date', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem160119086619304249/directory160119086654005398') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'ETag', + '"0x8D862B4F7FE0B9B"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-owner', + '$superuser', + 'x-ms-group', + '$superuser', + 'x-ms-permissions', + 'rwxr-x---', + 'x-ms-acl', + 'user::rwx,group::r-x,other::---', + 'x-ms-request-id', + '0453a43f-301f-007f-3d9d-94823b000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + '40936cc9-fcf3-49ae-aee3-79380df3249f', + 'Date', + 'Sun, 27 Sep 2020 07:14:26 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem160119086619304249/directory160119086654005398') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Sun, 27 Sep 2020 07:14:26 GMT', + 'ETag', + '"0x8D862B4F7FE0B9B"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-namespace-enabled', + 'true', + 'x-ms-request-id', + '8545d695-c01f-008f-809d-94c4ca000000', + 'x-ms-version', + '2020-02-10', + 'x-ms-client-request-id', + 'd22fbe54-4abf-4a01-83bd-3464357fbc97', + 'Date', + 'Sun, 27 Sep 2020 07:14:28 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem160119086619304249') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '39510413-a01e-001f-699d-94fea4000000', + 'x-ms-client-request-id', + '1dfe0bb7-613d-419b-924c-a76c8b0d9d97', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 07:14:28 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md index ce14785ab425..a0ffd4bcdf0e 100644 --- a/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md +++ b/sdk/storage/storage-file-datalake/review/storage-file-datalake.api.md @@ -7,7 +7,7 @@ import { AbortSignalLike } from '@azure/abort-controller'; import { BaseRequestPolicy } from '@azure/core-http'; import { BlobLeaseClient } from '@azure/storage-blob'; -import { BlobQueryArrowField } from '@azure/storage-blob'; +import { BlobQueryArrowConfiguration } from '@azure/storage-blob'; import * as coreHttp from '@azure/core-http'; import { deserializationPolicy } from '@azure/core-http'; import { HttpHeaders } from '@azure/core-http'; @@ -261,10 +261,10 @@ export class DataLakeSASPermissions { create: boolean; delete: boolean; execute: boolean; + manageAccessControl: boolean; + manageOwnership: boolean; move: boolean; - ownership: boolean; static parse(permissions: string): DataLakeSASPermissions; - permission: boolean; read: boolean; toString(): string; write: boolean; @@ -272,7 +272,7 @@ export class DataLakeSASPermissions { // @public export interface DataLakeSASSignatureValues { - authorizedUserObjectId?: string; + agentObjectId?: string; cacheControl?: string; contentDisposition?: string; contentEncoding?: string; @@ -287,10 +287,10 @@ export interface DataLakeSASSignatureValues { isDirectory?: boolean; pathName?: string; permissions?: DataLakeSASPermissions; + preauthorizedAgentObjectId?: string; protocol?: SASProtocol; snapshotTime?: string; startsOn?: Date; - unauthorizedUserObjectId?: string; version?: string; } @@ -389,10 +389,7 @@ export interface FileParallelUploadOptions extends CommonOptions { } // @public -export interface FileQueryArrowConfiguration { - kind: "arrow"; - schema: BlobQueryArrowField[]; -} +export type FileQueryArrowConfiguration = BlobQueryArrowConfiguration; // @public export interface FileQueryCsvTextConfiguration { @@ -766,10 +763,10 @@ export class FileSystemSASPermissions { delete: boolean; execute: boolean; list: boolean; + manageAccessControl: boolean; + manageOwnership: boolean; move: boolean; - ownership: boolean; static parse(permissions: string): FileSystemSASPermissions; - permission: boolean; read: boolean; toString(): string; write: boolean; @@ -1598,16 +1595,21 @@ export enum SASProtocol { // @public export class SASQueryParameters { - constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startsOn?: Date, expiresOn?: Date, ipRange?: SasIPRange, identifier?: string, resource?: string, cacheControl?: string, contentDisposition?: string, contentEncoding?: string, contentLanguage?: string, contentType?: string, userDelegationKey?: UserDelegationKey, directoryDepth?: number, authorizedUserObjectId?: string, unauthorizedUserObjectId?: string, correlationId?: string); + constructor(version: string, signature: string, permissions?: string, services?: string, resourceTypes?: string, protocol?: SASProtocol, startsOn?: Date, expiresOn?: Date, ipRange?: SasIPRange, identifier?: string, resource?: string, cacheControl?: string, contentDisposition?: string, contentEncoding?: string, contentLanguage?: string, contentType?: string, userDelegationKey?: UserDelegationKey, directoryDepth?: number, preauthorizedAgentObjectId?: string, agentObjectId?: string, correlationId?: string); + constructor(version: string, signature: string, options?: SASQueryParametersOptions); + readonly agentObjectId?: string; readonly cacheControl?: string; readonly contentDisposition?: string; readonly contentEncoding?: string; readonly contentLanguage?: string; readonly contentType?: string; + readonly correlationId?: string; + readonly directoryDepth?: number; readonly expiresOn?: Date; readonly identifier?: string; get ipRange(): SasIPRange | undefined; readonly permissions?: string; + readonly preauthorizedAgentObjectId?: string; readonly protocol?: SASProtocol; readonly resource?: string; readonly resourceTypes?: string; @@ -1618,6 +1620,29 @@ export class SASQueryParameters { readonly version: string; } +// @public +export interface SASQueryParametersOptions { + agentObjectId?: string; + cacheControl?: string; + contentDisposition?: string; + contentEncoding?: string; + contentLanguage?: string; + contentType?: string; + correlationId?: string; + directoryDepth?: number; + expiresOn?: Date; + identifier?: string; + ipRange?: SasIPRange; + permissions?: string; + preauthorizedAgentObjectId?: string; + protocol?: SASProtocol; + resource?: string; + resourceTypes?: string; + services?: string; + startsOn?: Date; + userDelegationKey?: UserDelegationKey; +} + // @public (undocumented) export interface ServiceGetUserDelegationKeyHeaders { // (undocumented) diff --git a/sdk/storage/storage-file-datalake/src/models.ts b/sdk/storage/storage-file-datalake/src/models.ts index 542ebbd88606..b4348cfcd647 100644 --- a/sdk/storage/storage-file-datalake/src/models.ts +++ b/sdk/storage/storage-file-datalake/src/models.ts @@ -7,10 +7,18 @@ import { LeaseAccessConditions, ModifiedAccessConditions as ModifiedAccessConditionsModel, UserDelegationKeyModel, - BlobQueryArrowField + BlobQueryArrowConfiguration } from "@azure/storage-blob"; export type ModifiedAccessConditions = Omit; +/** + * Options to query file with Apache Arrow format. Only valid for {@link FileQueryOptions.outputTextConfiguration}. + * + * @export + * @interface FileQueryArrowConfiguration + */ +export type FileQueryArrowConfiguration = BlobQueryArrowConfiguration; + import { FileSystemListPathsHeaders, PathCreateResponse, @@ -1280,30 +1288,6 @@ export interface FileQueryCsvTextConfiguration { hasHeaders?: boolean; } -/** - * Options to query file with Apache Arrow format. Only valid for {@link FileQueryOptions.outputTextConfiguration}. - * - * @export - * @interface FileQueryArrowConfiguration - */ -export interface FileQueryArrowConfiguration { - /** - * Kind. - * - * @type {"arrow"} - * @memberof FileQueryArrowConfiguration - */ - kind: "arrow"; - - /** - * List of {@link BlobQueryArrowField} describing the schema of the data. - * - * @type {BlobQueryArrowField[]} - * @memberof FileQueryArrowConfiguration - */ - schema: BlobQueryArrowField[]; -} - /** * File query error type. * diff --git a/sdk/storage/storage-file-datalake/src/sas/DataLakeSASPermissions.ts b/sdk/storage/storage-file-datalake/src/sas/DataLakeSASPermissions.ts index fbb7a25b3775..146d7806abd8 100644 --- a/sdk/storage/storage-file-datalake/src/sas/DataLakeSASPermissions.ts +++ b/sdk/storage/storage-file-datalake/src/sas/DataLakeSASPermissions.ts @@ -50,10 +50,10 @@ export class DataLakeSASPermissions { blobSASPermissions.execute = true; break; case "o": - blobSASPermissions.ownership = true; + blobSASPermissions.manageOwnership = true; break; case "p": - blobSASPermissions.permission = true; + blobSASPermissions.manageAccessControl = true; break; default: throw new RangeError(`Invalid permission: ${char}`); @@ -120,20 +120,23 @@ export class DataLakeSASPermissions { public execute: boolean = false; /** - * Specifies Ownership access granted. + * Specifies Ownership access granted, which allows the caller to set owner, owning group, + * or act as the owner when renaming or deleting a blob (file or directory) within a folder + * that has the sticky bit set. * * @type {boolean} * @memberof DirectorySASPermissions */ - public ownership: boolean = false; + public manageOwnership: boolean = false; /** - * Specifies Permission access granted. + * Specifies Permission access granted, which allows the caller to set permissions and + * POSIX ACLs on blobs (files and directories). * * @type {boolean} * @memberof DirectorySASPermissions */ - public permission: boolean = false; + public manageAccessControl: boolean = false; /** * Converts the given permissions to a string. Using this method will guarantee the permissions are in an @@ -165,10 +168,10 @@ export class DataLakeSASPermissions { if (this.execute) { permissions.push("e"); } - if (this.ownership) { + if (this.manageOwnership) { permissions.push("o"); } - if (this.permission) { + if (this.manageAccessControl) { permissions.push("p"); } return permissions.join(""); diff --git a/sdk/storage/storage-file-datalake/src/sas/DataLakeSASSignatureValues.ts b/sdk/storage/storage-file-datalake/src/sas/DataLakeSASSignatureValues.ts index b3858df08803..e986051cad7e 100644 --- a/sdk/storage/storage-file-datalake/src/sas/DataLakeSASSignatureValues.ts +++ b/sdk/storage/storage-file-datalake/src/sas/DataLakeSASSignatureValues.ts @@ -98,9 +98,8 @@ export interface DataLakeSASSignatureValues { isDirectory?: boolean; /** - * Optional. Beginning in version 2020-02-10, indicate the depth of the directory - * specified in the canonicalizedresource field of the string-to-sign. The depth of the directory is the number of directories - * beneath the root folder. + * Optional. Beginning in version 2020-02-10, indicate the depth of the directory specified in the canonicalizedresource field of the string-to-sign. + * The depth of the directory is the number of directories beneath the root folder. * * @type {number} * @memberof DataLakeSASSignatureValues @@ -109,26 +108,26 @@ export interface DataLakeSASSignatureValues { /** * Optional. Beginning in version 2020-02-10, specifies the Authorized AAD Object Id in GUID format. The AAD Object ID of a user - * authorized by the owner of the User Delegation Key to perform the action granted by the SAS. The Azure Storage service will + * authorized by the owner of the user delegation key to perform the action granted by the SAS. The Azure Storage service will * ensure that the owner of the user delegation key has the required permissions before granting access but no additional permission - * check for the user specified in this value will be performed. This cannot be used in conjuction with {@link unauthorizedUserObjectId}. + * check for the user specified in this value will be performed. This cannot be used in conjuction with {@link agentObjectId}. * This is only used for User Delegation SAS. * * @type {string} * @memberof DataLakeSASSignatureValues */ - authorizedUserObjectId?: string; + preauthorizedAgentObjectId?: string; /** * Optional. Beginning in version 2020-02-10, specifies the Unauthorized AAD Object Id in GUID format. The AAD Object Id of a user that is assumed - * to be unauthorized by the owner of the User Delegation Key. The Azure Storage Service will perform an additional POSIX ACL check to determine - * if the user is authorized to perform the requested operation. This cannot be used in conjuction with {@link authorizedUserObjectId}. + * to be unauthorized by the owner of the user delegation key. The Azure Storage Service will perform an additional POSIX ACL check to determine + * if the user is authorized to perform the requested operation. This cannot be used in conjuction with {@link preauthorizedAgentObjectId}. * This is only used for User Delegation SAS. * * @type {string} * @memberof DataLakeSASSignatureValues */ - unauthorizedUserObjectId?: string; + agentObjectId?: string; /** * Optional. Beginning in version 2020-02-10, this is a GUID value that will be logged in the storage diagnostic logs and can be used to @@ -680,8 +679,8 @@ function generateBlobSASQueryParametersUDK20181109( : "", userDelegationKeyCredential.userDelegationKey.signedService, userDelegationKeyCredential.userDelegationKey.signedVersion, - dataLakeSASSignatureValues.authorizedUserObjectId, - dataLakeSASSignatureValues.unauthorizedUserObjectId, + dataLakeSASSignatureValues.preauthorizedAgentObjectId, + dataLakeSASSignatureValues.agentObjectId, dataLakeSASSignatureValues.correlationId, dataLakeSASSignatureValues.ipRange ? ipRangeToString(dataLakeSASSignatureValues.ipRange) : "", dataLakeSASSignatureValues.protocol ? dataLakeSASSignatureValues.protocol : "", @@ -716,8 +715,8 @@ function generateBlobSASQueryParametersUDK20181109( dataLakeSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, dataLakeSASSignatureValues.directoryDepth, - dataLakeSASSignatureValues.authorizedUserObjectId, - dataLakeSASSignatureValues.unauthorizedUserObjectId, + dataLakeSASSignatureValues.preauthorizedAgentObjectId, + dataLakeSASSignatureValues.agentObjectId, dataLakeSASSignatureValues.correlationId ); } @@ -771,28 +770,28 @@ function SASSignatureValuesSanityCheckAndAutofill( dataLakeSASSignatureValues.permissions && (dataLakeSASSignatureValues.permissions.move || dataLakeSASSignatureValues.permissions.execute || - dataLakeSASSignatureValues.permissions.ownership || - dataLakeSASSignatureValues.permissions.permission) + dataLakeSASSignatureValues.permissions.manageOwnership || + dataLakeSASSignatureValues.permissions.manageAccessControl) ) { throw RangeError("'version' must be >= '2020-02-10' when providing m, e, o or p permission."); } if ( version < "2020-02-10" && - (dataLakeSASSignatureValues.authorizedUserObjectId || - dataLakeSASSignatureValues.unauthorizedUserObjectId || + (dataLakeSASSignatureValues.preauthorizedAgentObjectId || + dataLakeSASSignatureValues.agentObjectId || dataLakeSASSignatureValues.correlationId) ) { throw RangeError( - "'version' must be >= '2020-02-10' when providing 'authorizedUserObjectId', 'unauthorizedUserObjectId' or 'correlationId'." + "'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId', 'agentObjectId' or 'correlationId'." ); } if ( - dataLakeSASSignatureValues.authorizedUserObjectId && - dataLakeSASSignatureValues.unauthorizedUserObjectId + dataLakeSASSignatureValues.preauthorizedAgentObjectId && + dataLakeSASSignatureValues.agentObjectId ) { throw RangeError( - "'authorizedUserObjectId' or 'unauthorizedUserObjectId' shouldn't be specified at the same time." + "'preauthorizedAgentObjectId' or 'agentObjectId' shouldn't be specified at the same time." ); } diff --git a/sdk/storage/storage-file-datalake/src/sas/FileSystemSASPermissions.ts b/sdk/storage/storage-file-datalake/src/sas/FileSystemSASPermissions.ts index 44fc86deafa5..2a97878c5443 100644 --- a/sdk/storage/storage-file-datalake/src/sas/FileSystemSASPermissions.ts +++ b/sdk/storage/storage-file-datalake/src/sas/FileSystemSASPermissions.ts @@ -51,10 +51,10 @@ export class FileSystemSASPermissions { containerSASPermissions.execute = true; break; case "o": - containerSASPermissions.ownership = true; + containerSASPermissions.manageOwnership = true; break; case "p": - containerSASPermissions.permission = true; + containerSASPermissions.manageAccessControl = true; break; default: throw new RangeError(`Invalid permission ${char}`); @@ -129,20 +129,23 @@ export class FileSystemSASPermissions { public execute: boolean = false; /** - * Specifies Ownership access granted. + * Specifies Ownership access granted, which allows the caller to set owner, owning group, + * or act as the owner when renaming or deleting a blob (file or directory) within a folder + * that has the sticky bit set. * * @type {boolean} * @memberof DirectorySASPermissions */ - public ownership: boolean = false; + public manageOwnership: boolean = false; /** - * Specifies Permission access granted. + * Specifies Permission access granted, which allows the caller to set permissions and + * POSIX ACLs on blobs (files and directories). * * @type {boolean} * @memberof DirectorySASPermissions */ - public permission: boolean = false; + public manageAccessControl: boolean = false; /** * Converts the given permissions to a string. Using this method will guarantee the permissions are in an @@ -180,10 +183,10 @@ export class FileSystemSASPermissions { if (this.execute) { permissions.push("e"); } - if (this.ownership) { + if (this.manageOwnership) { permissions.push("o"); } - if (this.permission) { + if (this.manageAccessControl) { permissions.push("p"); } return permissions.join(""); diff --git a/sdk/storage/storage-file-datalake/src/sas/SASQueryParameters.ts b/sdk/storage/storage-file-datalake/src/sas/SASQueryParameters.ts index 30df58d80009..caf69cf81d45 100644 --- a/sdk/storage/storage-file-datalake/src/sas/SASQueryParameters.ts +++ b/sdk/storage/storage-file-datalake/src/sas/SASQueryParameters.ts @@ -22,6 +22,160 @@ export enum SASProtocol { HttpsAndHttp = "https,http" } +/** + * Options interfac to construct {@link SASQueryParameters}. + * + * @export + * @interface SASQueryParametersOptions + */ +export interface SASQueryParametersOptions { + /** + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + permissions?: string; + /** + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + services?: string; + /** + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + resourceTypes?: string; + /** + * Optional. The allowed HTTP protocol(s). + * + * @type {SASProtocol} + * @memberof SASQueryParametersOptions + */ + protocol?: SASProtocol; + /** + * Optional. The start time for this SAS token. + * + * @type {Date} + * @memberof SASQueryParametersOptions + */ + startsOn?: Date; + /** + * Optional only when identifier is provided. The expiry time for this SAS token. + * + * @type {Date} + * @memberof SASQueryParametersOptions + */ + expiresOn?: Date; + /** + * Optional. IP ranges allowed in this SAS. + * + * @type {SasIPRange} + * @memberof SASQueryParametersOptions + */ + ipRange?: SasIPRange; + /** + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://docs.microsoft.com/en-us/rest/api/storageservices/establishing-a-stored-access-policy + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + identifier?: string; + /** + * Optional. The storage container or blob (only for {@link BlobSASSignatureValues}). + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + resource?: string; + /** + * Value for cache-control header in Blob/File Service SAS. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + cacheControl?: string; + /** + * Value for content-disposition header in Blob/File Service SAS. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + contentDisposition?: string; + /** + * Value for content-encoding header in Blob/File Service SAS. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + contentEncoding?: string; + /** + * Value for content-length header in Blob/File Service SAS. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + contentLanguage?: string; + /** + * Value for content-type header in Blob/File Service SAS. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + contentType?: string; + /** + * User delegation key properties. + * + * @type {UserDelegationKey} + * @memberof SASQueryParametersOptions + */ + userDelegationKey?: UserDelegationKey; + /** + * Indicate the depth of the directory specified in the canonicalizedresource field of the string-to-sign. + * The depth of the directory is the number of directories beneath the root folder. + * + * @type {number} + * @memberof SASQueryParametersOptions + */ + directoryDepth?: number; + /** + * Authorized AAD Object Id in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key + * to perform the action granted by the SAS. The Azure Storage service will ensure that the owner of the user delegation key + * has the required permissions before granting access but no additional permission check for the user specified in + * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + preauthorizedAgentObjectId?: string; + /** + * Unauthorized AAD Object Id in GUID format. The AAD Object Id of a user that is assumed to be unauthorized by the owner of the User Delegation Key. + * The Azure Storage Service will perform an additional POSIX ACL check to determine if the user is authorized to perform the requested operation. + * This cannot be used in conjuction with {@link signedAuthorizedUserObjectId}. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + agentObjectId?: string; + /** + * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access. + * + * @type {string} + * @memberof SASQueryParametersOptions + */ + correlationId?: string; +} + /** * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues} @@ -234,11 +388,10 @@ export class SASQueryParameters { * Indicate the depth of the directory specified in the canonicalizedresource field of the string-to-sign. * The depth of the directory is the number of directories beneath the root folder. * - * @private * @type {number} * @memberof SASQueryParameters */ - private readonly directoryDepth?: number; + public readonly directoryDepth?: number; /** * Authorized AAD Object Id in GUID format. The AAD Object ID of a user authorized by the owner of the User Delegation Key @@ -246,22 +399,20 @@ export class SASQueryParameters { * has the required permissions before granting access but no additional permission check for the user specified in * this value will be performed. This cannot be used in conjuction with {@link signedUnauthorizedUserObjectId}. * - * @private * @type {string} * @memberof SASQueryParameters */ - private readonly authorizedUserObjectId?: string; + public readonly preauthorizedAgentObjectId?: string; /** * Unauthorized AAD Object Id in GUID format. The AAD Object Id of a user that is assumed to be unauthorized by the owner of the User Delegation Key. * The Azure Storage Service will perform an additional POSIX ACL check to determine if the user is authorized to perform the requested operation. * This cannot be used in conjuction with {@link signedAuthorizedUserObjectId}. * - * @private * @type {string} * @memberof SASQueryParameters */ - private readonly unauthorizedUserObjectId?: string; + public readonly agentObjectId?: string; /** * A GUID value that will be logged in the storage diagnostic logs and can be used to correlate SAS generation with storage resource access. @@ -269,7 +420,7 @@ export class SASQueryParameters { * @type {string} * @memberof SASQueryParameters */ - private readonly correlationId?: string; + public readonly correlationId?: string; /** * Optional. IP range allowed for this SAS. @@ -329,38 +480,105 @@ export class SASQueryParameters { contentType?: string, userDelegationKey?: UserDelegationKey, directoryDepth?: number, - authorizedUserObjectId?: string, - unauthorizedUserObjectId?: string, + preauthorizedAgentObjectId?: string, + agentObjectId?: string, + correlationId?: string + ); + + /** + * Creates an instance of SASQueryParameters. + * + * @param {string} version Representing the storage version + * @param {string} signature Representing the signature for the SAS token + * @param {SASQueryParametersOptions} [options] Optional. Options to construct the SASQueryParameters. + * @memberof SASQueryParameters + */ + constructor(version: string, signature: string, options?: SASQueryParametersOptions); + + constructor( + version: string, + signature: string, + permissionsOrOptions?: string | SASQueryParametersOptions, + services?: string, + resourceTypes?: string, + protocol?: SASProtocol, + startsOn?: Date, + expiresOn?: Date, + ipRange?: SasIPRange, + identifier?: string, + resource?: string, + cacheControl?: string, + contentDisposition?: string, + contentEncoding?: string, + contentLanguage?: string, + contentType?: string, + userDelegationKey?: UserDelegationKey, + directoryDepth?: number, + preauthorizedAgentObjectId?: string, + agentObjectId?: string, correlationId?: string ) { this.version = version; - this.services = services; - this.resourceTypes = resourceTypes; - this.expiresOn = expiresOn; - this.permissions = permissions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.identifier = identifier; - this.resource = resource; this.signature = signature; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType; - this.directoryDepth = directoryDepth; - this.authorizedUserObjectId = authorizedUserObjectId; - this.unauthorizedUserObjectId = unauthorizedUserObjectId; - this.correlationId = correlationId; - - if (userDelegationKey) { - this.signedOid = userDelegationKey.signedObjectId; - this.signedTenantId = userDelegationKey.signedTenantId; - this.signedStartsOn = userDelegationKey.signedStartsOn; - this.signedExpiresOn = userDelegationKey.signedExpiresOn; - this.signedService = userDelegationKey.signedService; - this.signedVersion = userDelegationKey.signedVersion; + + if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== "string") { + // SASQueryParametersOptions + const options = permissionsOrOptions; + this.services = options.services; + this.resourceTypes = options.resourceTypes; + this.expiresOn = options.expiresOn; + this.permissions = options.permissions; + this.protocol = options.protocol; + this.startsOn = options.startsOn; + this.ipRangeInner = options.ipRange; + this.identifier = options.identifier; + this.resource = options.resource; + this.cacheControl = options.cacheControl; + this.contentDisposition = options.contentDisposition; + this.contentEncoding = options.contentEncoding; + this.contentLanguage = options.contentLanguage; + this.contentType = options.contentType; + this.directoryDepth = options.directoryDepth; + this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId; + this.agentObjectId = options.agentObjectId; + this.correlationId = options.correlationId; + + if (options.userDelegationKey) { + this.signedOid = options.userDelegationKey.signedObjectId; + this.signedTenantId = options.userDelegationKey.signedTenantId; + this.signedStartsOn = options.userDelegationKey.signedStartsOn; + this.signedExpiresOn = options.userDelegationKey.signedExpiresOn; + this.signedService = options.userDelegationKey.signedService; + this.signedVersion = options.userDelegationKey.signedVersion; + } + } else { + this.services = services; + this.resourceTypes = resourceTypes; + this.expiresOn = expiresOn; + this.permissions = permissionsOrOptions; + this.protocol = protocol; + this.startsOn = startsOn; + this.ipRangeInner = ipRange; + this.identifier = identifier; + this.resource = resource; + this.cacheControl = cacheControl; + this.contentDisposition = contentDisposition; + this.contentEncoding = contentEncoding; + this.contentLanguage = contentLanguage; + this.contentType = contentType; + this.directoryDepth = directoryDepth; + this.preauthorizedAgentObjectId = preauthorizedAgentObjectId; + this.agentObjectId = agentObjectId; + this.correlationId = correlationId; + + if (userDelegationKey) { + this.signedOid = userDelegationKey.signedObjectId; + this.signedTenantId = userDelegationKey.signedTenantId; + this.signedStartsOn = userDelegationKey.signedStartsOn; + this.signedExpiresOn = userDelegationKey.signedExpiresOn; + this.signedService = userDelegationKey.signedService; + this.signedVersion = userDelegationKey.signedVersion; + } } } @@ -493,10 +711,10 @@ export class SASQueryParameters { this.tryAppendQueryParameter(queries, param, this.directoryDepth?.toString()); break; case "saoid": - this.tryAppendQueryParameter(queries, param, this.authorizedUserObjectId); + this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId); break; case "suoid": - this.tryAppendQueryParameter(queries, param, this.unauthorizedUserObjectId); + this.tryAppendQueryParameter(queries, param, this.agentObjectId); break; case "scid": this.tryAppendQueryParameter(queries, param, this.correlationId); diff --git a/sdk/storage/storage-file-datalake/test/node/sas.spec.ts b/sdk/storage/storage-file-datalake/test/node/sas.spec.ts index a9a755834001..548f61031b34 100644 --- a/sdk/storage/storage-file-datalake/test/node/sas.spec.ts +++ b/sdk/storage/storage-file-datalake/test/node/sas.spec.ts @@ -17,20 +17,17 @@ import { newPipeline, PathAccessControlItem, PathPermissions, - StorageSharedKeyCredential + StorageSharedKeyCredential, + SASQueryParameters } from "../../src"; import { DataLakeFileClient } from "../../src/"; import { SASProtocol } from "../../src/sas/SASQueryParameters"; import { getDataLakeServiceClient, - // getDataLakeServiceClientWithDefualtCredential, getTokenDataLakeServiceClient, recorderEnvSetup } from "../utils"; -import { setLogLevel } from "@azure/logger"; -setLogLevel("info"); - describe("Shared Access Signature (SAS) generation Node.js only", () => { let recorder: Recorder; let serviceClient: DataLakeServiceClient; @@ -629,9 +626,54 @@ describe("Shared Access Signature (SAS) generation Node.js only", () => { await fileSystemClient.delete(); }); + + it("construct SASQueryParameters with a option bag", async () => { + // no option and optional parameters + const sasQP = new SASQueryParameters("2020-02-10", "signature"); + assert.equal(sasQP.toString(), "sv=2020-02-10&sig=signature"); + + const sasQP2 = new SASQueryParameters("2020-02-10", "signature", { + permissions: "permissions", + correlationId: "correlationId", + directoryDepth: 2, + preauthorizedAgentObjectId: "preauthorizedAgentObjectId" + }); + assert.equal( + sasQP2.toString(), + "sv=2020-02-10&sp=permissions&sig=signature&sdd=2&saoid=preauthorizedAgentObjectId&scid=correlationId" + ); + + const sasQP3 = new SASQueryParameters( + "2020-02-10", + "signature", + "permissions", + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + 2, + "preauthorizedAgentObjectId", + undefined, + "correlationId" + ); + assert.equal( + sasQP3.toString(), + "sv=2020-02-10&sp=permissions&sig=signature&sdd=2&saoid=preauthorizedAgentObjectId&scid=correlationId" + ); + }); }); -describe("Shared Access Signature (SAS) generation Node.js only for permissions m, e, o, p", () => { +describe("Shared Access Signature (SAS) generation Node.js only for directory SAS", () => { let recorder: Recorder; let serviceClient: DataLakeServiceClient; let fileSystemClient: DataLakeFileSystemClient; @@ -661,39 +703,6 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions } }; - // const acl: PathAccessControlItem[] = [ - // { - // accessControlType: "user", - // entityId: "", - // defaultScope: false, - // permissions: { - // read: true, - // write: true, - // execute: true - // } - // }, - // { - // accessControlType: "group", - // entityId: "", - // defaultScope: false, - // permissions: { - // read: true, - // write: false, - // execute: true - // } - // }, - // { - // accessControlType: "other", - // entityId: "", - // defaultScope: false, - // permissions: { - // read: false, - // write: true, - // execute: false - // } - // } - // ]; - beforeEach(async function() { recorder = record(this, recorderEnvSetup); serviceClient = getDataLakeServiceClient(); @@ -747,15 +756,6 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions newPipeline(new AnonymousCredential()) ); - // Does not work yet. - // m - // const newFileName = recorder.getUniqueName("newfile"); - // await directoryClientwithSAS.move(newFileName); - - // o - // const guid = "ca761232ed4211cebacd00aa0057b223"; - // await directoryClientwithSAS.setAccessControl(acl, { owner: guid }); - // e await directoryClientwithSAS.getAccessControl(); @@ -763,6 +763,49 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions await directoryClientwithSAS.setPermissions(permissions); }); + function getDefualtDirctorySAS(directoryName: string): SASQueryParameters { + return generateDataLakeSASQueryParameters( + { + fileSystemName: fileSystemClient.name, + pathName: directoryName, + isDirectory: true, + expiresOn: tmr, + permissions: FileSystemSASPermissions.parse("racwdlmeop"), + protocol: SASProtocol.HttpsAndHttp, + startsOn: now, + version: "2020-02-10" + }, + sharedKeyCredential as StorageSharedKeyCredential + ); + } + + it("generateDataLakeSASQueryParameters could calculate directory depth", async () => { + const directorySAS = getDefualtDirctorySAS(directoryClient.name); + assert.equal(directorySAS.directoryDepth, 1); + const directoryClientwithSAS = new DataLakeDirectoryClient( + `${directoryClient.url}?${directorySAS}` + ); + await directoryClientwithSAS.setPermissions(permissions); + + // root directory, depth = 0 + const directorySAS2 = getDefualtDirctorySAS(""); + assert.equal(directorySAS2.directoryDepth, 0); + const directoryClientwithSAS2 = new DataLakeDirectoryClient( + `${directoryClient.url}?${directorySAS2}` + ); + await directoryClientwithSAS2.setPermissions(permissions); + + // "/d1/d2/", "d1/d2", "/d1/d2" depth = 2 + const directorySAS3 = getDefualtDirctorySAS("/d1/d2/"); + assert.equal(directorySAS3.directoryDepth, 2); + + const directorySAS4 = getDefualtDirctorySAS("d1/d2"); + assert.equal(directorySAS4.directoryDepth, 2); + + const directorySAS5 = getDefualtDirctorySAS("/d1/d2"); + assert.equal(directorySAS5.directoryDepth, 2); + }); + it("generateDataLakeSASQueryParameters for file should work for permissions m, e, o, p", async () => { const fileSAS = generateDataLakeSASQueryParameters( { @@ -783,15 +826,6 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions newPipeline(new AnonymousCredential()) ); - // Does not work yet. - // m - // const newFileName = recorder.getUniqueName("newfile"); - // await fileClientWithSAS.move(newFileName); - - // o - // const guid = "ca761232ed4211cebacd00aa0057b223"; - // await fileClientWithSAS.setAccessControl(acl, { owner: guid }); - // e await fileClientWithSAS.getAccessControl(); @@ -818,15 +852,6 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions newPipeline(new AnonymousCredential()) ); - // Does not work yet. - // m - // const newFileName = recorder.getUniqueName("newfile"); - // await directoryClientwithSAS.move(newFileName); - - // o - // const guid = "ca761232ed4211cebacd00aa0057b223"; - // await directoryClientwithSAS.setAccessControl(acl, { owner: guid }); - // e await directoryClientwithSAS.getAccessControl(); @@ -837,7 +862,7 @@ describe("Shared Access Signature (SAS) generation Node.js only for permissions describe("Shared Access Signature (SAS) generation Node.js only for delegation SAS", () => { let recorder: Recorder; - let serviceClient: DataLakeServiceClient; + let oauthServiceClient: DataLakeServiceClient; let fileSystemClient: DataLakeFileSystemClient; let directoryClient: DataLakeDirectoryClient; let fileClient: DataLakeFileClient; @@ -870,8 +895,9 @@ describe("Shared Access Signature (SAS) generation Node.js only for delegation S recorder = record(this, recorderEnvSetup); accountName = process.env["DFS_ACCOUNT_NAME"] || ""; try { - serviceClient = getTokenDataLakeServiceClient(); + oauthServiceClient = getTokenDataLakeServiceClient(); } catch (err) { + console.log(err); this.skip(); } @@ -879,10 +905,10 @@ describe("Shared Access Signature (SAS) generation Node.js only for delegation S now.setHours(now.getHours() - 1); tmr = recorder.newDate("tmr"); tmr.setDate(tmr.getDate() + 5); - userDelegationKey = await serviceClient.getUserDelegationKey(now, tmr); + userDelegationKey = await oauthServiceClient.getUserDelegationKey(now, tmr); const fileSystemName = recorder.getUniqueName("filesystem"); - fileSystemClient = serviceClient.getFileSystemClient(fileSystemName); + fileSystemClient = oauthServiceClient.getFileSystemClient(fileSystemName); await fileSystemClient.create(); const directoryName = recorder.getUniqueName("directory"); @@ -901,10 +927,12 @@ describe("Shared Access Signature (SAS) generation Node.js only for delegation S await recorder.stop(); }); - it.only("GenerateUserDelegationSAS for directory should work for permissions m, e, o, p", async () => { + it("GenerateUserDelegationSAS for directory should work for permissions m, e, o, p", async () => { const fileSystemSAS = generateDataLakeSASQueryParameters( { fileSystemName: fileSystemClient.name, + pathName: directoryClient.name, + isDirectory: true, expiresOn: tmr, permissions: FileSystemSASPermissions.parse("racwdlmeop") }, @@ -914,16 +942,6 @@ describe("Shared Access Signature (SAS) generation Node.js only for delegation S const sasURL = `${directoryClient.url}?${fileSystemSAS}`; const directoryClientwithSAS = new DataLakeDirectoryClient(sasURL); - - // Does not work yet. - // // m - // const newFileName = recorder.getUniqueName("newfile"); - // await directoryClientwithSAS.move(newFileName); - - // // o - // const guid = "ca761232ed4211cebacd00aa0057b223"; - // await directoryClientwithSAS.setAccessControl([], { owner: guid }); - // e await directoryClientwithSAS.getAccessControl(); @@ -931,46 +949,101 @@ describe("Shared Access Signature (SAS) generation Node.js only for delegation S await directoryClientwithSAS.setPermissions(permissions); }); - it("GenerateUserDelegationSAS should work with unauthorizedUserObjectId", async () => { - const guid = "b77d5205-ddb5-42e1-80ee-26c74a5e9333"; + it("GenerateUserDelegationSAS should work with agentObjectId, preauthorizedAgentObjectId", async () => { + const authorizedGuid = "b77d5205-ddb5-42e1-80ee-26c74a5e9333"; + const rootDirectoryClient = fileSystemClient.getDirectoryClient("/"); + const acl: PathAccessControlItem[] = [ + { + accessControlType: "user", + entityId: authorizedGuid, + defaultScope: false, + permissions: { + read: true, + write: true, + execute: true + } + } + ]; + await rootDirectoryClient.setAccessControl(acl); + const fileSystemSAS = generateDataLakeSASQueryParameters( { fileSystemName: fileSystemClient.name, expiresOn: tmr, permissions: FileSystemSASPermissions.parse("racwdlmeop"), - unauthorizedUserObjectId: guid + agentObjectId: authorizedGuid }, userDelegationKey, accountName ); - // const sasURL = `${fileClient.url}?${fileSystemSAS}`; - // const fileClientWithSAS = new DataLakeDirectoryClient(sasURL); + const newFileName = recorder.getUniqueName("newFile"); + const newFileClient = fileSystemClient.getFileClient(newFileName); + const newFileClientWithSAS = new DataLakeDirectoryClient( + `${newFileClient.url}?${fileSystemSAS}` + ); + await newFileClientWithSAS.createIfNotExists(); - // try { - // await fileClientWithSAS.exists(); - // } catch (err) { - // assert.deepStrictEqual(err.details.errorCode, "AuthorizationPermissionMismatch"); - // } + const unauthoriziedGuid = "7d53815c-1b73-49ab-b44d-002bfb890633"; - const acl: PathAccessControlItem[] = [ + // suoid for an unauthoriziedGuid + const fileSystemSAS2 = generateDataLakeSASQueryParameters( { - accessControlType: "user", - entityId: guid, - defaultScope: false, - permissions: { - read: true, - write: true, - execute: true - } - } - ]; - await directoryClient.setAccessControl(acl); + fileSystemName: fileSystemClient.name, + expiresOn: tmr, + permissions: FileSystemSASPermissions.parse("racwdlmeop"), + agentObjectId: unauthoriziedGuid + }, + userDelegationKey, + accountName + ); - console.log(await directoryClient.getAccessControl()); - const newfileClient = directoryClient.getFileClient(recorder.getUniqueName("newfile")); - const SASURL = `${newfileClient.url}?${fileSystemSAS}`; - const newFileClientWithSAS = new DataLakeFileClient(SASURL); - await newFileClientWithSAS.createIfNotExists(); + const newFileClientWithSAS2 = new DataLakeDirectoryClient( + `${newFileClient.url}?${fileSystemSAS2}` + ); + try { + await newFileClientWithSAS2.createIfNotExists(); + } catch (err) { + assert.deepStrictEqual(err.details.errorCode, "AuthorizationPermissionMismatch"); + } + + // saoid for an unauthoriziedGuid + const fileSystemSAS3 = generateDataLakeSASQueryParameters( + { + fileSystemName: fileSystemClient.name, + expiresOn: tmr, + permissions: FileSystemSASPermissions.parse("racwdlmeop"), + preauthorizedAgentObjectId: unauthoriziedGuid + }, + userDelegationKey, + accountName + ); + const newFileClientWithSAS3 = new DataLakeDirectoryClient( + `${newFileClient.url}?${fileSystemSAS3}` + ); + await newFileClientWithSAS3.createIfNotExists(); + }); + + it("GenerateUserDelegationSAS should work with correlationId", async () => { + const guid = "b77d5205-ddb5-42e1-80ee-26c74a5e9333"; + const fileSystemSAS = generateDataLakeSASQueryParameters( + { + fileSystemName: fileSystemClient.name, + expiresOn: tmr, + permissions: FileSystemSASPermissions.parse("racwdlmeop"), + correlationId: guid + }, + userDelegationKey, + accountName + ); + + const fileSystemClientWithSAS = new DataLakeFileSystemClient( + `${fileSystemClient.url}?${fileSystemSAS}` + ); + + await fileSystemClientWithSAS + .listPaths() + .byPage() + .next(); }); }); diff --git a/sdk/storage/storage-file-share/recordings/browsers/fileserviceclient_premium/recording_smb_multichannel.json b/sdk/storage/storage-file-share/recordings/browsers/fileserviceclient_premium/recording_smb_multichannel.json index bbe95845bb91..f4645581f452 100644 --- a/sdk/storage/storage-file-share/recordings/browsers/fileserviceclient_premium/recording_smb_multichannel.json +++ b/sdk/storage/storage-file-share/recordings/browsers/fileserviceclient_premium/recording_smb_multichannel.json @@ -2,7 +2,7 @@ "recordings": [ { "method": "PUT", - "url": "https://pf-fakestorageaccount.file.core.windows.net/", + "url": "https://fakestorageaccount.file.core.windows.net/", "query": { "restype": "service", "comp": "properties" @@ -11,31 +11,31 @@ "status": 202, "response": "", "responseHeaders": { - "date": "Thu, 10 Sep 2020 14:03:06 GMT", + "date": "Mon, 28 Sep 2020 05:37:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "934f892e-3e9b-44c9-8407-a50a3c40a43d", - "x-ms-request-id": "8db70106-201a-0042-1b7b-878fcc000000", + "x-ms-client-request-id": "232c2dcc-ff85-4f5e-ab7f-f74f903b46ae", + "x-ms-request-id": "a2efaa50-101a-0059-8059-95b1cf000000", "x-ms-version": "2020-02-10" } }, { "method": "GET", - "url": "https://pf-fakestorageaccount.file.core.windows.net/", + "url": "https://fakestorageaccount.file.core.windows.net/", "query": { "restype": "service", "comp": "properties" }, "requestBody": null, "status": 200, - "response": "1.0truefalsetrue31.0truefalsetrue3DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true", + "response": "1.0truetruetrue41.0truetruetrue3GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true", "responseHeaders": { "content-type": "application/xml", - "date": "Thu, 10 Sep 2020 14:03:07 GMT", + "date": "Mon, 28 Sep 2020 05:37:31 GMT", "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", "transfer-encoding": "chunked", - "x-ms-client-request-id": "d7ce9946-4739-4100-a4f5-8f31e13ebdc9", - "x-ms-request-id": "8db70110-201a-0042-1f7b-878fcc000000", + "x-ms-client-request-id": "d8ba73f8-abdc-4789-be1e-9e3800b647d1", + "x-ms-request-id": "a2efaa5a-101a-0059-0459-95b1cf000000", "x-ms-version": "2020-02-10" } } @@ -44,5 +44,5 @@ "uniqueName": {}, "newDate": {} }, - "hash": "0239648c88b551390876f693c87cb2ae" + "hash": "07d7182d263382fe7ddd0ab3d7ae7c76" } \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquire_a_broken_lease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquire_a_broken_lease.json new file mode 100644 index 000000000000..1637fe87c53a --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquire_a_broken_lease.json @@ -0,0 +1,192 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:12 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "078a80d8-07a4-4dbf-bf0c-221adaf2daf6", + "x-ms-request-id": "0ce68c4a-701a-0026-46df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:13 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "bac6af8c-e891-42ee-8cde-765720e45bb5", + "x-ms-lease-id": "a951739b-fdf4-4e2b-bb24-ce9d3ea40580", + "x-ms-request-id": "0ce68c4f-701a-0026-48df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:14 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8a4df4f7-952e-4fb8-95c2-932db5d74a06", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c51-701a-0026-49df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:14 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:13 GMT", + "x-ms-client-request-id": "63c66d0c-17f2-4f44-b5c5-c96d94ad98c7", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "broken", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "0ce68c55-701a-0026-4cdf-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:15 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "28454f99-57b2-4ee4-8b17-0f871c08ef33", + "x-ms-lease-id": "a951739b-fdf4-4e2b-bb24-ce9d3ea40580", + "x-ms-request-id": "0ce68c57-701a-0026-4ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:16 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:13 GMT", + "x-ms-client-request-id": "02ac1d5d-a6ca-41ed-9129-f07bb42e24c1", + "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": "0ce68c5a-701a-0026-4fdf-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:16 GMT", + "etag": "\"0x8D862F704189B36\"", + "last-modified": "Sun, 27 Sep 2020 15:07:13 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5fcf8cbc-0f2a-491f-a18f-361cf605f255", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c5d-701a-0026-52df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923329702973", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:17 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0df6a693-f351-4c58-8ba7-b8f56c20e883", + "x-ms-request-id": "0ce68c60-701a-0026-54df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121923329702973" + }, + "newDate": {} + }, + "hash": "9bb9ff27d1a7596192f2543142fdec37" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease.json new file mode 100644 index 000000000000..93411a9329bd --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease.json @@ -0,0 +1,121 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919298303771", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:33 GMT", + "etag": "\"0x8D862F6ECACACD9\"", + "last-modified": "Sun, 27 Sep 2020 15:06:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0e3a51c7-54b6-4c50-8a95-6d90f0e6e9ff", + "x-ms-request-id": "0ce68b9d-701a-0026-4edf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919298303771", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:34 GMT", + "etag": "\"0x8D862F6ECACACD9\"", + "last-modified": "Sun, 27 Sep 2020 15:06:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3350fd53-37f3-4473-b543-52357d4e2edf", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68ba1-701a-0026-50df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919298303771", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:35 GMT", + "etag": "\"0x8D862F6ECACACD9\"", + "last-modified": "Sun, 27 Sep 2020 15:06:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:06:34 GMT", + "x-ms-client-request-id": "df2e860d-67f8-4859-87d9-95137402b578", + "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": "0ce68ba5-701a-0026-53df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919298303771", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:35 GMT", + "etag": "\"0x8D862F6ECACACD9\"", + "last-modified": "Sun, 27 Sep 2020 15:06:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "32df462b-25a8-41c2-b114-2fd3f5cb6b52", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68ba9-701a-0026-56df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919298303771", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6be03c71-bc84-43d1-beda-c2284e2fdbb6", + "x-ms-request-id": "0ce68bac-701a-0026-58df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121919298303771" + }, + "newDate": {} + }, + "hash": "3271dde67c5296103fdf6f626ed60976" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.json new file mode 100644 index 000000000000..d665c8b10358 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.json @@ -0,0 +1,114 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920597404062", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:45 GMT", + "etag": "\"0x8D862F6F3CC2D1D\"", + "last-modified": "Sun, 27 Sep 2020 15:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fe3cb93c-6151-4719-a3fe-c1c8dc3a7040", + "x-ms-request-id": "0ce68bd4-701a-0026-73df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920597404062", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:46 GMT", + "etag": "\"0x8D862F6F3CC2D1D\"", + "last-modified": "Sun, 27 Sep 2020 15:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2e9a3c89-9e29-4cae-8b41-8c50b684b792", + "x-ms-lease-id": "c8e518e6-713b-4a65-b51b-bf4e611e36cf", + "x-ms-request-id": "0ce68bd7-701a-0026-75df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920597404062", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 409, + "response": "LeaseAlreadyPresentThere is already a lease present.\nRequestId:0ce68bd8-701a-0026-76df-9426be000000\nTime:2020-09-27T15:06:47.7005210Z", + "responseHeaders": { + "content-length": "221", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "92e1bd0e-d693-4e90-bbc9-6999816e2d0a", + "x-ms-error-code": "LeaseAlreadyPresent", + "x-ms-request-id": "0ce68bd8-701a-0026-76df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920597404062", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:47 GMT", + "etag": "\"0x8D862F6F3CC2D1D\"", + "last-modified": "Sun, 27 Sep 2020 15:06:46 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9525d7f0-d136-4a14-b815-ea5d3f34bb23", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68bdd-701a-0026-79df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920597404062", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:48 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3c203d19-b865-496e-ab67-42ea5bcdf7b3", + "x-ms-request-id": "0ce68bdf-701a-0026-7bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121920597404062" + }, + "newDate": {} + }, + "hash": "a7662e80063146772c80486996dac996" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.json new file mode 100644 index 000000000000..62196a34592e --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.json @@ -0,0 +1,115 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920940207206", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:49 GMT", + "etag": "\"0x8D862F6F5E227CF\"", + "last-modified": "Sun, 27 Sep 2020 15:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c87d8d67-9d9c-4bfa-8a1c-556ad1a4bb24", + "x-ms-request-id": "0ce68be2-701a-0026-7ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920940207206", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:49 GMT", + "etag": "\"0x8D862F6F5E227CF\"", + "last-modified": "Sun, 27 Sep 2020 15:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5cf1eae1-18af-4cdc-9c35-73e154a823ec", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68be6-701a-0026-7fdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920940207206", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:50 GMT", + "etag": "\"0x8D862F6F5E227CF\"", + "last-modified": "Sun, 27 Sep 2020 15:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "dc89bb50-c1e2-4958-8b64-deb0ad3ce3ae", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68be8-701a-0026-80df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920940207206", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:50 GMT", + "etag": "\"0x8D862F6F5E227CF\"", + "last-modified": "Sun, 27 Sep 2020 15:06:49 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0bdbd7f4-b12e-41b7-b054-fa764a05ba9f", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68bec-701a-0026-03df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920940207206", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:51 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "bff12c07-b9a0-4f2f-af0a-6bc7ac1332ae", + "x-ms-request-id": "0ce68bf0-701a-0026-06df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121920940207206" + }, + "newDate": {} + }, + "hash": "707c88c66dc0125c8dbd1488ab4ff604" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..3051d8245f1e --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_for_snapshot.json @@ -0,0 +1,150 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:37 GMT", + "etag": "\"0x8D862F6EEDB15F8\"", + "last-modified": "Sun, 27 Sep 2020 15:06:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "bb9ce5c1-e2dc-45d4-8875-17161012a8db", + "x-ms-request-id": "0ce68bae-701a-0026-5adf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "restype": "share", + "comp": "snapshot" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:38 GMT", + "etag": "\"0x8D862F6EEDB15F8\"", + "last-modified": "Sun, 27 Sep 2020 15:06:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "48a681f1-8333-4fe3-ae5a-5674b78890ea", + "x-ms-request-id": "0ce68bb2-701a-0026-5cdf-9426be000000", + "x-ms-snapshot": "2020-09-27T15:06:38.0000000Z", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "sharesnapshot": "2020-09-27T15:06:38.0000000Z", + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:38 GMT", + "etag": "\"0x8D862F6EEDB15F8\"", + "last-modified": "Sun, 27 Sep 2020 15:06:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c87e9430-8bde-45ff-9bff-4ec2520ab3c1", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68bb5-701a-0026-5fdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "sharesnapshot": "2020-09-27T15:06:38.0000000Z", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:39 GMT", + "etag": "\"0x8D862F6EEDB15F8\"", + "last-modified": "Sun, 27 Sep 2020 15:06:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:06:38 GMT", + "x-ms-client-request-id": "1fd5806c-25d7-433e-b5b7-7f62050c5d54", + "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": "0ce68bb7-701a-0026-61df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:40 GMT", + "etag": "\"0x8D862F6EEDB15F8\"", + "last-modified": "Sun, 27 Sep 2020 15:06:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:06:38 GMT", + "x-ms-client-request-id": "a9d29e0c-eeb3-4635-883c-1a6e93df3a02", + "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": "0ce68bbb-701a-0026-63df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121919772707416", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:40 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "842dfb16-9844-4777-a9c1-f452d8029413", + "x-ms-request-id": "0ce68bbe-701a-0026-65df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121919772707416" + }, + "newDate": {} + }, + "hash": "1aaef4f799559d32403e139e0fb00404" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.json new file mode 100644 index 000000000000..829032d865d7 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.json @@ -0,0 +1,121 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920213300290", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:41 GMT", + "etag": "\"0x8D862F6F17AF32C\"", + "last-modified": "Sun, 27 Sep 2020 15:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1409e473-5f20-40cc-bc0d-8f0e17cbe65c", + "x-ms-request-id": "0ce68bc0-701a-0026-67df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920213300290", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:42 GMT", + "etag": "\"0x8D862F6F17AF32C\"", + "last-modified": "Sun, 27 Sep 2020 15:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e11eb253-d103-4001-aea1-685b0f09f519", + "x-ms-lease-id": "7454272a-6a98-4f73-af5c-dad9a63c8afd", + "x-ms-request-id": "0ce68bc4-701a-0026-6adf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920213300290", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:43 GMT", + "etag": "\"0x8D862F6F17AF32C\"", + "last-modified": "Sun, 27 Sep 2020 15:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:06:42 GMT", + "x-ms-client-request-id": "16497859-d078-4f59-a745-d353046dd2e4", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-duration": "fixed", + "x-ms-lease-state": "leased", + "x-ms-lease-status": "locked", + "x-ms-request-id": "0ce68bc7-701a-0026-6cdf-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920213300290", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:43 GMT", + "etag": "\"0x8D862F6F17AF32C\"", + "last-modified": "Sun, 27 Sep 2020 15:06:42 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "171746f7-2fce-42cd-bba0-1b4ed42fa030", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68bcd-701a-0026-6fdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121920213300290", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:44 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9127337f-5912-4e35-a714-98166845667e", + "x-ms-request-id": "0ce68bd0-701a-0026-71df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121920213300290" + }, + "newDate": {} + }, + "hash": "421f94daa21c442d8e80b444c7cc0a41" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_a_broken_lease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_a_broken_lease.json new file mode 100644 index 000000000000..ac159d21444d --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_a_broken_lease.json @@ -0,0 +1,137 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:08 GMT", + "etag": "\"0x8D862F701B77FDD\"", + "last-modified": "Sun, 27 Sep 2020 15:07:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2166a5c5-9e43-4bea-a6ba-3d9f10688acc", + "x-ms-request-id": "0ce68c3a-701a-0026-3adf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:09 GMT", + "etag": "\"0x8D862F701B77FDD\"", + "last-modified": "Sun, 27 Sep 2020 15:07:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2bec6f90-1e09-4681-a4d9-7add4e6afbed", + "x-ms-lease-id": "59fc8e0d-39a3-4640-ac25-22d3cbcb754b", + "x-ms-request-id": "0ce68c3d-701a-0026-3cdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:10 GMT", + "etag": "\"0x8D862F701B77FDD\"", + "last-modified": "Sun, 27 Sep 2020 15:07:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "14267976-b466-468a-80a1-0eec36a5e3ec", + "x-ms-lease-time": "14", + "x-ms-request-id": "0ce68c3f-701a-0026-3ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:10 GMT", + "etag": "\"0x8D862F701B77FDD\"", + "last-modified": "Sun, 27 Sep 2020 15:07:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c189f0d3-1f76-476e-9723-652dd1235997", + "x-ms-lease-time": "14", + "x-ms-request-id": "0ce68c43-701a-0026-40df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:11 GMT", + "etag": "\"0x8D862F701B77FDD\"", + "last-modified": "Sun, 27 Sep 2020 15:07:09 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d7e37f46-f535-4351-b1dd-55cdeeef5b90", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c45-701a-0026-42df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922935309709", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:12 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0e42be6e-74d2-4529-a553-5b90cd452daf", + "x-ms-request-id": "0ce68c47-701a-0026-44df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121922935309709" + }, + "newDate": {} + }, + "hash": "c354ff97edc6ad0a0a40f332e4643495" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_lease_and_then_release_it.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_lease_and_then_release_it.json new file mode 100644 index 000000000000..d11b910f3811 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_break_lease_and_then_release_it.json @@ -0,0 +1,170 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:04 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "795d78bf-96f5-405e-a0bf-cfc57d1a4ba9", + "x-ms-request-id": "0ce68c25-701a-0026-2bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:05 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "fbaa7e3d-242b-42f2-840b-6d87d38b4a96", + "x-ms-lease-id": "17c9bae3-a7ca-4e94-84d7-2cf88cdd379d", + "x-ms-request-id": "0ce68c29-701a-0026-2ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:05 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:05 GMT", + "x-ms-client-request-id": "ce1927ab-2c32-4e42-a534-d058296d3294", + "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": "0ce68c2d-701a-0026-30df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:06 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cb8dc2c4-468e-4e3d-b092-14efe72ae550", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c2e-701a-0026-31df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:07 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:05 GMT", + "x-ms-client-request-id": "9866b443-e7ae-4450-96bd-78673de499e5", + "x-ms-has-immutability-policy": "false", + "x-ms-has-legal-hold": "false", + "x-ms-lease-state": "broken", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "0ce68c31-701a-0026-33df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:07 GMT", + "etag": "\"0x8D862F6FF083692\"", + "last-modified": "Sun, 27 Sep 2020 15:07:05 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4a9f0b82-6b3f-4d73-a74b-f93789618c48", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c35-701a-0026-35df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922480701270", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:08 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "120f6a89-136f-4170-9df7-cbbac8352198", + "x-ms-request-id": "0ce68c37-701a-0026-37df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121922480701270" + }, + "newDate": {} + }, + "hash": "25b29898d8ae054f8ed43fa992363915" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease.json new file mode 100644 index 000000000000..0f5034d4ab8c --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease.json @@ -0,0 +1,115 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921513409290", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:54 GMT", + "etag": "\"0x8D862F6F93B3D7A\"", + "last-modified": "Sun, 27 Sep 2020 15:06:55 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e99338e2-ff1c-48c5-9d44-0ccf5e2118fc", + "x-ms-request-id": "0ce68bfd-701a-0026-0fdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921513409290", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:55 GMT", + "etag": "\"0x8D862F6F93B3D7A\"", + "last-modified": "Sun, 27 Sep 2020 15:06:55 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0eeab36b-563d-4638-8a50-3f170d88ebbc", + "x-ms-lease-id": "2e8edae1-2c50-49d1-b968-4b8dcf5cc613", + "x-ms-request-id": "0ce68c02-701a-0026-11df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921513409290", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:56 GMT", + "etag": "\"0x8D862F6F93B3D7A\"", + "last-modified": "Sun, 27 Sep 2020 15:06:55 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "36feded1-c0ab-44a5-b477-d72b2d467395", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68c04-701a-0026-13df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921513409290", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:56 GMT", + "etag": "\"0x8D862F6F93B3D7A\"", + "last-modified": "Sun, 27 Sep 2020 15:06:55 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "536ed785-c86b-4112-bad3-d26528ab7d24", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c05-701a-0026-14df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921513409290", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:57 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ec123509-548f-41c1-ba91-18309d5f6c81", + "x-ms-request-id": "0ce68c08-701a-0026-17df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121921513409290" + }, + "newDate": {} + }, + "hash": "45257573d2724104a8397c325ec540bf" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.json new file mode 100644 index 000000000000..fad56b6cbaf1 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.json @@ -0,0 +1,70 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921841100051", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:58 GMT", + "etag": "\"0x8D862F6FB3F0CA1\"", + "last-modified": "Sun, 27 Sep 2020 15:06:58 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c194ef08-3e27-4c7b-83a7-b603db4a0948", + "x-ms-request-id": "0ce68c0b-701a-0026-19df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921841100051", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 409, + "response": "LeaseNotPresentWithLeaseOperationThere is currently no lease on the file share.\nRequestId:0ce68c0e-701a-0026-1bdf-9426be000000\nTime:2020-09-27T15:06:59.7841113Z", + "responseHeaders": { + "content-length": "248", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:06:58 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e9fa9b42-8b0f-4afc-b31e-0b20d605f6af", + "x-ms-error-code": "LeaseNotPresentWithLeaseOperation", + "x-ms-request-id": "0ce68c0e-701a-0026-1bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921841100051", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:59 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "dba9455b-e0d7-490f-8ac7-7366c3c9b16b", + "x-ms-request-id": "0ce68c11-701a-0026-1ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121921841100051" + }, + "newDate": {} + }, + "hash": "e186056390a4b2e47a3ff2e84cd1e298" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_invalid_duration_for_acquirelease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_invalid_duration_for_acquirelease.json new file mode 100644 index 000000000000..4e65c4e28e2c --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_invalid_duration_for_acquirelease.json @@ -0,0 +1,70 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921268005337", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:52 GMT", + "etag": "\"0x8D862F6F7D41925\"", + "last-modified": "Sun, 27 Sep 2020 15:06:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4c677dfe-6b3f-4fa7-8c9d-b7dac98a7a57", + "x-ms-request-id": "0ce68bf2-701a-0026-08df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921268005337", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 400, + "response": "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:0ce68bf7-701a-0026-0bdf-9426be000000\nTime:2020-09-27T15:06:54.0460284Zx-ms-lease-duration1", + "responseHeaders": { + "content-length": "326", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:06:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a6804507-25bc-4070-a378-423881b40e5b", + "x-ms-error-code": "InvalidHeaderValue", + "x-ms-request-id": "0ce68bf7-701a-0026-0bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121921268005337", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:06:53 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "490509f5-0b48-4ebf-b06b-3c4569ab558f", + "x-ms-request-id": "0ce68bfa-701a-0026-0ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121921268005337" + }, + "newDate": {} + }, + "hash": "3432549bb6395ae678887f738bffbf31" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_delete.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_delete.json new file mode 100644 index 000000000000..e2db0955bbaa --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_delete.json @@ -0,0 +1,109 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924685607584", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:26 GMT", + "etag": "\"0x8D862F70C231B26\"", + "last-modified": "Sun, 27 Sep 2020 15:07:27 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b3b93e97-de43-4cb8-9379-3f80870962a6", + "x-ms-request-id": "0ce68c87-701a-0026-6fdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924685607584", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:27 GMT", + "etag": "\"0x8D862F70C231B26\"", + "last-modified": "Sun, 27 Sep 2020 15:07:27 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3b02d3fa-d43c-4240-8c58-9c492a52c6ae", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68c8b-701a-0026-72df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924685607584", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 412, + "response": "LeaseIdMissingThere is currently a lease on the file share and no lease ID was specified in the request.\nRequestId:0ce68c8f-701a-0026-74df-9426be000000\nTime:2020-09-27T15:07:28.5575651Z", + "responseHeaders": { + "content-length": "273", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:07:27 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e2287af5-d986-4825-b3fd-8ceca39837bc", + "x-ms-error-code": "LeaseIdMissing", + "x-ms-request-id": "0ce68c8f-701a-0026-74df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924685607584", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:28 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "08bd63de-f978-48d0-b4b7-a74f9d6c46e5", + "x-ms-request-id": "0ce68c91-701a-0026-76df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924685607584", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:29 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cbc3a4a9-5411-4d43-919c-c4fcaff588d7", + "x-ms-request-id": "0ce68c95-701a-0026-79df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121924685607584" + }, + "newDate": {} + }, + "hash": "d8ed60c539fec47123c7a461e5b69736" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_get_operations.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_get_operations.json new file mode 100644 index 000000000000..bd6b9f0bef7e --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_get_operations.json @@ -0,0 +1,169 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:29 GMT", + "etag": "\"0x8D862F70E4A0910\"", + "last-modified": "Sun, 27 Sep 2020 15:07:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "0182b204-9e83-46de-b164-7ddf4f66dc62", + "x-ms-request-id": "0ce68c9f-701a-0026-7bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:30 GMT", + "etag": "\"0x8D862F70E4A0910\"", + "last-modified": "Sun, 27 Sep 2020 15:07:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "5541b635-9e5f-4131-9fa7-d1dca7f59ef6", + "x-ms-lease-id": "97672963-0e3f-414b-9b2d-8ed7dfce8c7f", + "x-ms-request-id": "0ce68ca4-701a-0026-7ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:31 GMT", + "etag": "\"0x8D862F70E4A0910\"", + "last-modified": "Sun, 27 Sep 2020 15:07:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:30 GMT", + "x-ms-client-request-id": "fe7dc7ff-2d38-4320-8d0e-a71e773b4c93", + "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": "0ce68ca6-701a-0026-7fdf-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 412, + "response": "LeaseIdMismatchWithContainerOperationThe lease ID specified did not match the lease ID for the file share.\nRequestId:0ce68ca8-701a-0026-01df-9426be000000\nTime:2020-09-27T15:07:32.9396773Z", + "responseHeaders": { + "content-length": "275", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:07:31 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "8b148a8e-cdd1-4386-a309-5857df9168c1", + "x-ms-error-code": "LeaseIdMismatchWithContainerOperation", + "x-ms-request-id": "0ce68ca8-701a-0026-01df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:32 GMT", + "etag": "\"0x8D862F70E4A0910\"", + "last-modified": "Sun, 27 Sep 2020 15:07:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:30 GMT", + "x-ms-client-request-id": "3abe6df4-9bc1-4b3a-a13d-7855a24ebe0e", + "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": "0ce68cad-701a-0026-05df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:33 GMT", + "etag": "\"0x8D862F70E4A0910\"", + "last-modified": "Sun, 27 Sep 2020 15:07:30 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "63ef8252-c3c7-492f-818e-22adfab08667", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68cb1-701a-0026-07df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925036906348", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:34 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "77fbd941-c0f7-4e7f-b53a-ee27595ffb7a", + "x-ms-request-id": "0ce68cb4-701a-0026-09df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121925036906348" + }, + "newDate": {} + }, + "hash": "31d5724934e35915065b43a9b336d2d4" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_write_operations.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_write_operations.json new file mode 100644 index 000000000000..0ce354612a97 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_condition_for_write_operations.json @@ -0,0 +1,156 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:35 GMT", + "etag": "\"0x8D862F7115761FA\"", + "last-modified": "Sun, 27 Sep 2020 15:07:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "48ad6b02-9809-4706-9244-d9353bdae9ec", + "x-ms-request-id": "0ce68cb8-701a-0026-0bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:35 GMT", + "etag": "\"0x8D862F7115761FA\"", + "last-modified": "Sun, 27 Sep 2020 15:07:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "281685fa-0fd5-4ed2-b71b-c2f621f7fab7", + "x-ms-lease-id": "f8704852-da74-48b2-b3af-7de0561e6e89", + "x-ms-request-id": "0ce68cbd-701a-0026-0edf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "restype": "share", + "comp": "metadata" + }, + "requestBody": null, + "status": 412, + "response": "LeaseIdMissingThere is currently a lease on the file share and no lease ID was specified in the request.\nRequestId:0ce68cc0-701a-0026-10df-9426be000000\nTime:2020-09-27T15:07:37.6820464Z", + "responseHeaders": { + "content-length": "273", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:07:36 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ca9f0b6f-d70f-4483-835c-e5d40f2c3115", + "x-ms-error-code": "LeaseIdMissing", + "x-ms-request-id": "0ce68cc0-701a-0026-10df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "restype": "share", + "comp": "metadata" + }, + "requestBody": null, + "status": 412, + "response": "LeaseIdMismatchWithContainerOperationThe lease ID specified did not match the lease ID for the file share.\nRequestId:0ce68cc2-701a-0026-12df-9426be000000\nTime:2020-09-27T15:07:38.3785407Z", + "responseHeaders": { + "content-length": "275", + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:07:37 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "3fa08946-09b5-48f8-a5f0-c05d1994d5e7", + "x-ms-error-code": "LeaseIdMismatchWithContainerOperation", + "x-ms-request-id": "0ce68cc2-701a-0026-12df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "restype": "share", + "comp": "metadata" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:37 GMT", + "etag": "\"0x8D862F712EE119F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d283dfdb-29a9-4f47-ae5f-42fabd1f3ceb", + "x-ms-request-id": "0ce68cc5-701a-0026-14df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:38 GMT", + "etag": "\"0x8D862F712EE119F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:38 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "cbc40b22-3f4f-4357-8ea6-79c1dcab60d9", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68cc7-701a-0026-16df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121925548103276", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:39 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "6682b831-5c79-42fb-9b5c-95561317b39b", + "x-ms-request-id": "0ce68cc9-701a-0026-18df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121925548103276" + }, + "newDate": {} + }, + "hash": "4549bc2bdde60a476205f5127ea2f637" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_properties_properly_returned.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_properties_properly_returned.json new file mode 100644 index 000000000000..d7d4a8836579 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_lease_properties_properly_returned.json @@ -0,0 +1,140 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924184606440", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:21 GMT", + "etag": "\"0x8D862F7092974DF\"", + "last-modified": "Sun, 27 Sep 2020 15:07:22 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "56c0fd5d-978f-456d-bff6-b76fb424e841", + "x-ms-request-id": "0ce68c74-701a-0026-62df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924184606440", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:22 GMT", + "etag": "\"0x8D862F7092974DF\"", + "last-modified": "Sun, 27 Sep 2020 15:07:22 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "4d870f36-d5bc-411e-ba82-64d37c605b82", + "x-ms-lease-id": "a193f0c2-30f2-4282-b2cf-1887bbcfcbc7", + "x-ms-request-id": "0ce68c77-701a-0026-64df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924184606440", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:22 GMT", + "etag": "\"0x8D862F7092974DF\"", + "last-modified": "Sun, 27 Sep 2020 15:07:22 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:22 GMT", + "x-ms-client-request-id": "b0541531-9df3-4596-8834-f1f4af4ee063", + "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": "0ce68c7a-701a-0026-66df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/", + "query": { + "comp": "list" + }, + "requestBody": null, + "status": 200, + "response": "share160093141210102328Thu, 24 Sep 2020 07:10:13 GMT\"0x8D86058E1C40CB2\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:10:13 GMT$account-encryption-keyfalseshare160093176153301093Thu, 24 Sep 2020 07:16:02 GMT\"0x8D86059B206C943\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:16:02 GMT$account-encryption-keyfalseshare160093195256704532Thu, 24 Sep 2020 07:19:13 GMT\"0x8D8605A23EB8F85\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:19:13 GMT$account-encryption-keyfalseshare160121233635009423Sun, 27 Sep 2020 13:12:16 GMT\"0x8D862E6F4FB4A9C\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:12:16 GMT$account-encryption-keyfalseshare160121235006600409Sun, 27 Sep 2020 13:12:30 GMT\"0x8D862E6FD28EA42\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:12:30 GMT$account-encryption-keyfalseshare160121310851508050Sun, 27 Sep 2020 13:25:09 GMT\"0x8D862E8C1F3100F\"unlockedexpired5120TransactionOptimizedSun, 27 Sep 2020 13:25:09 GMT$account-encryption-keyfalseshare160121326942502893Sun, 27 Sep 2020 13:27:50 GMT\"0x8D862E921DDD8EC\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 13:27:50 GMT$account-encryption-keyfalseshare160121389438808287Sun, 27 Sep 2020 13:38:15 GMT\"0x8D862EA966D8BBD\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:38:15 GMT$account-encryption-keyfalseshare160121491612400623Sun, 27 Sep 2020 13:55:16 GMT\"0x8D862ECF6A57F34\"unlockedexpired5120TransactionOptimizedSun, 27 Sep 2020 13:55:16 GMT$account-encryption-keyfalseshare160121509901107353Sun, 27 Sep 2020 13:58:19 GMT\"0x8D862ED63A7C0E3\"unlockedbroken5120TransactionOptimizedSun, 27 Sep 2020 13:58:19 GMT$account-encryption-keyfalseshare160121551221306317Sun, 27 Sep 2020 14:05:12 GMT\"0x8D862EE59F16DE2\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 14:05:12 GMT$account-encryption-keyfalseshare160121551974009496Sun, 27 Sep 2020 14:05:19 GMT\"0x8D862EE5E6E01B4\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 14:05:19 GMT$account-encryption-keyfalseshare160121870218806337Sun, 27 Sep 2020 14:58:23 GMT\"0x8D862F5C81E89A1\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 14:58:23 GMT$account-encryption-keyfalseshare160121924184606440Sun, 27 Sep 2020 15:07:22 GMT\"0x8D862F7092974DF\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 15:07:22 GMT$account-encryption-keyfalse", + "responseHeaders": { + "content-type": "application/xml", + "date": "Sun, 27 Sep 2020 15:07:23 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "3914bd4c-14dc-468a-8e7f-2e60f4952895", + "x-ms-request-id": "0ce68c7d-701a-0026-69df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924184606440", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:24 GMT", + "etag": "\"0x8D862F7092974DF\"", + "last-modified": "Sun, 27 Sep 2020 15:07:22 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "00dc6f23-150b-4e9b-9617-957ae3dac618", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c81-701a-0026-6bdf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121924184606440", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:25 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1a79040c-52a3-4c35-ac1d-8c416c5e6c96", + "x-ms-request-id": "0ce68c85-701a-0026-6ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121924184606440" + }, + "newDate": {} + }, + "hash": "215f84098c63269b1f047b6b869ee322" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_release_lease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_release_lease.json new file mode 100644 index 000000000000..316a60d45722 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_release_lease.json @@ -0,0 +1,120 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922087003562", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:00 GMT", + "etag": "\"0x8D862F6FCB5EB3F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:01 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c53a7081-55f1-4195-b5f9-2f11caa7b0da", + "x-ms-request-id": "0ce68c16-701a-0026-20df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922087003562", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:01 GMT", + "etag": "\"0x8D862F6FCB5EB3F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:01 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d7b22aac-ffdd-4740-a736-e1c63352cce6", + "x-ms-lease-id": "61a1a395-3747-40b3-a62b-6ca026759778", + "x-ms-request-id": "0ce68c19-701a-0026-22df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922087003562", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:01 GMT", + "etag": "\"0x8D862F6FCB5EB3F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:01 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "e516cc08-36fc-4258-baef-8e0e2c82401b", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c1c-701a-0026-25df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "GET", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922087003562", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:02 GMT", + "etag": "\"0x8D862F6FCB5EB3F\"", + "last-modified": "Sun, 27 Sep 2020 15:07:01 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "TransactionOptimized", + "x-ms-access-tier-change-time": "Sun, 27 Sep 2020 15:07:01 GMT", + "x-ms-client-request-id": "85ae4440-efc5-4642-a8d5-4691fdad3b3a", + "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": "0ce68c1f-701a-0026-27df-9426be000000", + "x-ms-share-quota": "5120", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121922087003562", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:03 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "32d2b28f-5382-4475-925d-198be742580b", + "x-ms-request-id": "0ce68c21-701a-0026-29df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121922087003562" + }, + "newDate": {} + }, + "hash": "a8a98bf1c54106c991df3607be9a6771" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_renew_a_lease.json b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_renew_a_lease.json new file mode 100644 index 000000000000..71fdb97c94e9 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/browsers/leaseclient_for_share/recording_renew_a_lease.json @@ -0,0 +1,115 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923882600337", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:18 GMT", + "etag": "\"0x8D862F707648F1E\"", + "last-modified": "Sun, 27 Sep 2020 15:07:19 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "2a01a917-daa8-409b-b195-0987713eabb6", + "x-ms-request-id": "0ce68c64-701a-0026-58df-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923882600337", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:19 GMT", + "etag": "\"0x8D862F707648F1E\"", + "last-modified": "Sun, 27 Sep 2020 15:07:19 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "f968fe04-4d80-4a13-8c58-1406a6ee35d7", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68c68-701a-0026-5adf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923882600337", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:19 GMT", + "etag": "\"0x8D862F707648F1E\"", + "last-modified": "Sun, 27 Sep 2020 15:07:19 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b61858ac-4418-4e91-928e-5fb00ccc9daa", + "x-ms-lease-id": "e9890485-bf47-4d9a-b3d0-aceb18506124", + "x-ms-request-id": "0ce68c6c-701a-0026-5ddf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923882600337", + "query": { + "comp": "lease", + "restype": "share" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:20 GMT", + "etag": "\"0x8D862F707648F1E\"", + "last-modified": "Sun, 27 Sep 2020 15:07:19 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "48e57c5e-04e8-4a4e-93a4-d4054b25b864", + "x-ms-lease-time": "0", + "x-ms-request-id": "0ce68c6e-701a-0026-5edf-9426be000000", + "x-ms-version": "2020-02-10" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.file.core.windows.net/share160121923882600337", + "query": { + "restype": "share" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Sun, 27 Sep 2020 15:07:20 GMT", + "server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "59008915-3e73-48d6-b7f8-5643161cea1c", + "x-ms-request-id": "0ce68c71-701a-0026-60df-9426be000000", + "x-ms-version": "2020-02-10" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "share": "share160121923882600337" + }, + "newDate": {} + }, + "hash": "b1a585cd2e7ca27eadf2de6c3aaa5eb2" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-share/recordings/node/fileserviceclient_premium/recording_smb_multichannel.js b/sdk/storage/storage-file-share/recordings/node/fileserviceclient_premium/recording_smb_multichannel.js index 21ae2d494a92..1b323ba15ffd 100644 --- a/sdk/storage/storage-file-share/recordings/node/fileserviceclient_premium/recording_smb_multichannel.js +++ b/sdk/storage/storage-file-share/recordings/node/fileserviceclient_premium/recording_smb_multichannel.js @@ -7,21 +7,41 @@ module.exports.testInfo = {"uniqueName":{},"newDate":{}} nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) .put('/', "true") .query(true) - .reply(400, "FeatureNotSupportedOnStorageAccountFeature cannot be enabled on this storage account.\nRequestId:5e6a9f92-601a-000e-355f-911ffc000000\nTime:2020-09-23T04:11:54.0486223Z", [ - 'Content-Length', - '254', + .reply(202, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '84dc4a50-501a-0067-6059-9526b0000000', + 'x-ms-client-request-id', + '268a12f3-4769-4b6d-b7a8-fe90438b0d2a', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Mon, 28 Sep 2020 05:36:40 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "1.0truetruetrue41.0truetruetrue3GET,PUThttp://www.example1.comx-ms-header1,x-ms-header2x-ms-header310DELETEhttp://www.example2.comx-ms-header1x-ms-header2,x-ms-header320DELETE,GET,HEAD,MERGE,POST,OPTIONS,PUT,PATCH***86400true", [ + 'Transfer-Encoding', + 'chunked', 'Content-Type', 'application/xml', 'Server', 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', 'x-ms-request-id', - '5e6a9f92-601a-000e-355f-911ffc000000', + '84dc4a59-501a-0067-6359-9526b0000000', 'x-ms-client-request-id', - '103ea686-cedd-49f9-8146-c0acc382f9dc', + '7e820c94-59fc-4772-8ee0-693f8acae009', 'x-ms-version', '2020-02-10', - 'x-ms-error-code', - 'FeatureNotSupportedOnStorageAccount', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', 'Date', - 'Wed, 23 Sep 2020 04:11:53 GMT' + 'Mon, 28 Sep 2020 05:36:40 GMT' ]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquire_a_broken_lease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquire_a_broken_lease.js new file mode 100644 index 000000000000..28e06d838557 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquire_a_broken_lease.js @@ -0,0 +1,223 @@ +let nock = require('nock'); + +module.exports.hash = "6d5f59db24f5eaf5cfa76f90ceae5b63"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121915870707782"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915870707782') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a02-701a-006b-34df-94e952000000', + 'x-ms-client-request-id', + 'ff0fc7e4-c258-4727-a4cc-05e520da9b77', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:57 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915870707782') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293435-d01a-0000-23df-946ea6000000', + 'x-ms-client-request-id', + '919e03e9-f503-4e20-85c9-2dd6b67de9ce', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '99c58d68-34fa-4a19-b6f6-ed6a85b7bf9a', + 'Date', + 'Sun, 27 Sep 2020 15:05:58 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915870707782') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a05-701a-006b-35df-94e952000000', + 'x-ms-client-request-id', + '262b8833-c5e5-4e24-a88e-daef62dfcc25', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:58 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121915870707782') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293439-d01a-0000-25df-946ea6000000', + 'x-ms-client-request-id', + '03a8877b-7bde-4bd8-9948-72f6578d59c6', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'broken', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:58 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', + 'Sun, 27 Sep 2020 15:05:59 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915870707782') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a06-701a-006b-36df-94e952000000', + 'x-ms-client-request-id', + '377bc8c4-ffdb-4e25-9495-159b0a4bc567', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '99c58d68-34fa-4a19-b6f6-ed6a85b7bf9a', + 'Date', + 'Sun, 27 Sep 2020 15:05:59 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121915870707782') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029343b-d01a-0000-26df-946ea6000000', + 'x-ms-client-request-id', + '2c773a78-2c4e-444c-9e40-cb2606595233', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:58 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', + 'Sun, 27 Sep 2020 15:06:00 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915870707782') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:58 GMT', + 'ETag', + '"0x8D862F6D76BBE40"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a0a-701a-006b-38df-94e952000000', + 'x-ms-client-request-id', + '188634eb-e2e7-4062-ac72-bc6dc0c786dc', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:06:00 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121915870707782') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029343f-d01a-0000-27df-946ea6000000', + 'x-ms-client-request-id', + '1477e25d-d679-4630-aa28-66ff023369f7', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:01 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease.js new file mode 100644 index 000000000000..c047d7c7916d --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease.js @@ -0,0 +1,135 @@ +let nock = require('nock'); + +module.exports.hash = "e7c6728c194646a0b741653675f3b017"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121913625009003"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913625009003') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:37 GMT', + 'ETag', + '"0x8D862F6CACD7503"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19a1-701a-006b-7ddf-94e952000000', + 'x-ms-client-request-id', + 'e03af896-ca88-4ea2-a6c1-9c26c9c3b70d', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:36 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913625009003') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:37 GMT', + 'ETag', + '"0x8D862F6CACD7503"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19a7-701a-006b-7fdf-94e952000000', + 'x-ms-client-request-id', + '24d20fc5-657b-4412-b319-304b70ef4622', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:05:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121913625009003') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:37 GMT', + 'ETag', + '"0x8D862F6CACD7503"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19a8-701a-006b-80df-94e952000000', + 'x-ms-client-request-id', + '1f46739f-e596-4bf7-bba9-cf4a2e5952f1', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:37 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', + 'Sun, 27 Sep 2020 15:05:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913625009003') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:37 GMT', + 'ETag', + '"0x8D862F6CACD7503"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ab-701a-006b-01df-94e952000000', + 'x-ms-client-request-id', + '83ca9df5-68d9-4a20-854b-2367addddfec', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:37 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121913625009003') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ac-701a-006b-02df-94e952000000', + 'x-ms-client-request-id', + '512f26c8-4153-4710-91d6-c6b880f23fe2', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:38 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.js new file mode 100644 index 000000000000..a3122db47543 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_another_lease_id.js @@ -0,0 +1,115 @@ +let nock = require('nock'); + +module.exports.hash = "6bc9e6dba00ba7917561b4297b120d2b"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121914334809671"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914334809671') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:43 GMT', + 'ETag', + '"0x8D862F6CE4450CF"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c3-701a-006b-10df-94e952000000', + 'x-ms-client-request-id', + '5a751af9-44de-4e5c-9881-33f31c77e379', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:42 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914334809671') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:43 GMT', + 'ETag', + '"0x8D862F6CE4450CF"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c6-701a-006b-12df-94e952000000', + 'x-ms-client-request-id', + 'dc7d3aef-9458-4c25-86d5-270e9257c87c', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e04ff2de-d75d-476a-9cb2-3ea66fcb912f', + 'Date', + 'Sun, 27 Sep 2020 15:05:42 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914334809671') + .query(true) + .reply(409, "LeaseAlreadyPresentThere is already a lease present.\nRequestId:09ab19c8-701a-006b-13df-94e952000000\nTime:2020-09-27T15:05:44.2120727Z", [ + 'Content-Length', + '221', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c8-701a-006b-13df-94e952000000', + 'x-ms-client-request-id', + '0ea6de8e-54d6-4eab-80ec-76e5dec25cb9', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseAlreadyPresent', + 'Date', + 'Sun, 27 Sep 2020 15:05:43 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914334809671') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:43 GMT', + 'ETag', + '"0x8D862F6CE4450CF"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c9-701a-006b-14df-94e952000000', + 'x-ms-client-request-id', + '3e903cb4-fc7a-4b30-83df-b5f66cbf2a37', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:43 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121914334809671') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ca-701a-006b-15df-94e952000000', + 'x-ms-client-request-id', + '66b30245-d215-4f56-a055-a75cea1dfd29', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:44 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.js new file mode 100644 index 000000000000..166c7417419e --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_again_with_same_lease_id.js @@ -0,0 +1,117 @@ +let nock = require('nock'); + +module.exports.hash = "9bb69300bde42a870db6ff1116d04dd1"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121914509202924"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914509202924') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:45 GMT', + 'ETag', + '"0x8D862F6CF4EC55A"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19cc-701a-006b-16df-94e952000000', + 'x-ms-client-request-id', + 'c98c28ed-9d83-4e19-a967-fed3be225172', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:44 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914509202924') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:45 GMT', + 'ETag', + '"0x8D862F6CF4EC55A"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ce-701a-006b-17df-94e952000000', + 'x-ms-client-request-id', + '26938b2b-582a-4369-af7a-8b17a6b58072', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:05:44 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914509202924') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:45 GMT', + 'ETag', + '"0x8D862F6CF4EC55A"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19d0-701a-006b-18df-94e952000000', + 'x-ms-client-request-id', + 'f9ca9d53-824f-4ae7-bc5b-7cc7f0c36fde', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:05:45 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914509202924') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:45 GMT', + 'ETag', + '"0x8D862F6CF4EC55A"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029340b-d01a-0000-0bdf-946ea6000000', + 'x-ms-client-request-id', + '8c5511e9-264e-4671-9209-78c5c2b3b5a4', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:46 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121914509202924') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19d9-701a-006b-1cdf-94e952000000', + 'x-ms-client-request-id', + 'c1f93a25-8697-4fe9-a0f8-b2225fe4facf', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:46 GMT' +]); 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 new file mode 100644 index 000000000000..49dce7515172 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_for_snapshot.js @@ -0,0 +1,175 @@ +let nock = require('nock'); + +module.exports.hash = "605aa7c32fc39d9cef1923e874e73573"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121913935406942"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913935406942') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:39 GMT', + 'ETag', + '"0x8D862F6CBE30EE1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ae-701a-006b-03df-94e952000000', + 'x-ms-client-request-id', + '989c429b-eff5-4ad5-b6fa-92bdb27c3fa1', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:38 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913935406942') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:39 GMT', + 'ETag', + '"0x8D862F6CBE30EE1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b0-701a-006b-04df-94e952000000', + 'x-ms-client-request-id', + '8ca972b5-5c7f-4c70-9883-f6ef73c41657', + 'x-ms-version', + '2020-02-10', + 'x-ms-snapshot', + '2020-09-27T15:05:39.0000000Z', + 'Date', + 'Sun, 27 Sep 2020 15:05:39 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121913935406942') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:39 GMT', + 'ETag', + '"0x8D862F6CBE30EE1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b1-701a-006b-05df-94e952000000', + 'x-ms-client-request-id', + 'bd6b7325-2e67-4d9e-a523-6c8fc329cae9', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:05:39 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121913935406942') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:39 GMT', + 'ETag', + '"0x8D862F6CBE30EE1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b3-701a-006b-06df-94e952000000', + 'x-ms-client-request-id', + 'a0782773-a8d9-40d8-9f81-5d1bc9b9a568', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:39 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', + 'Sun, 27 Sep 2020 15:05:39 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121913935406942') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:39 GMT', + 'ETag', + '"0x8D862F6CBE30EE1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b6-701a-006b-07df-94e952000000', + 'x-ms-client-request-id', + 'e34ff711-1b5b-4d8b-9876-0d6a0c5d6b4e', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:39 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', + 'Sun, 27 Sep 2020 15:05:40 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121913935406942') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b7-701a-006b-08df-94e952000000', + 'x-ms-client-request-id', + '526d4b18-9d40-4816-b1e2-d47879e50506', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:40 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.js new file mode 100644 index 000000000000..2cbb851882b6 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_acquirelease_without_proposed_lease_id_with_a_finite_duration.js @@ -0,0 +1,135 @@ +let nock = require('nock'); + +module.exports.hash = "dc5da3094ca5f35040a8e7541cfa5754"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121914170908383"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914170908383') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:41 GMT', + 'ETag', + '"0x8D862F6CD4A3321"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19b9-701a-006b-09df-94e952000000', + 'x-ms-client-request-id', + '7f0b60d7-9d8a-412c-9565-452c41b0efe7', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:41 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914170908383') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:41 GMT', + 'ETag', + '"0x8D862F6CD4A3321"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19bb-701a-006b-0adf-94e952000000', + 'x-ms-client-request-id', + '0dfa5371-08c1-4a36-ab85-ced76c0b7bba', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e58a14e2-562c-43af-a486-939fa5ce51a4', + 'Date', + 'Sun, 27 Sep 2020 15:05:41 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121914170908383') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:41 GMT', + 'ETag', + '"0x8D862F6CD4A3321"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19bf-701a-006b-0cdf-94e952000000', + 'x-ms-client-request-id', + '699db084-bcbb-4c61-9349-ac266e352b30', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'fixed', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:41 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', + 'Sun, 27 Sep 2020 15:05:41 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914170908383') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:41 GMT', + 'ETag', + '"0x8D862F6CD4A3321"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c1-701a-006b-0edf-94e952000000', + 'x-ms-client-request-id', + '990b4663-d4c0-4db1-bde8-b3785c2b4721', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:42 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121914170908383') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19c2-701a-006b-0fdf-94e952000000', + 'x-ms-client-request-id', + '31daab21-08f5-403d-ac01-bd6c8d40135d', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:42 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_a_broken_lease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_a_broken_lease.js new file mode 100644 index 000000000000..a6eae715bda0 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_a_broken_lease.js @@ -0,0 +1,141 @@ +let nock = require('nock'); + +module.exports.hash = "493a7c86cc031356282fbce76c3dcfab"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121915624906007"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915624906007') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:56 GMT', + 'ETag', + '"0x8D862F6D5F4DFB1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19f9-701a-006b-2fdf-94e952000000', + 'x-ms-client-request-id', + 'dba7c700-2c80-4264-baab-6b8ed85a6e25', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:55 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915624906007') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:56 GMT', + 'ETag', + '"0x8D862F6D5F4DFB1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029342e-d01a-0000-1fdf-946ea6000000', + 'x-ms-client-request-id', + 'ef03b1fe-bcc4-42c2-a79b-2a8d6aba56a0', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '03388176-4f73-4aa8-9fec-4b26cb744063', + 'Date', + 'Sun, 27 Sep 2020 15:05:56 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915624906007') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:56 GMT', + 'ETag', + '"0x8D862F6D5F4DFB1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19fc-701a-006b-30df-94e952000000', + 'x-ms-client-request-id', + 'a326809d-dcca-4c54-8a81-6af8dbe824e4', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '14', + 'Date', + 'Sun, 27 Sep 2020 15:05:56 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915624906007') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:56 GMT', + 'ETag', + '"0x8D862F6D5F4DFB1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293431-d01a-0000-20df-946ea6000000', + 'x-ms-client-request-id', + '8c31cf4f-f0a8-4fb6-98e4-28a06be1f6ed', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '14', + 'Date', + 'Sun, 27 Sep 2020 15:05:57 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915624906007') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:56 GMT', + 'ETag', + '"0x8D862F6D5F4DFB1"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ff-701a-006b-32df-94e952000000', + 'x-ms-client-request-id', + 'd8712741-8fd5-42f1-8f62-303ff6fb4951', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:57 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121915624906007') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293434-d01a-0000-22df-946ea6000000', + 'x-ms-client-request-id', + '1f96c557-c69f-49cc-b4e8-34ee8bf5700e', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:58 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_lease_and_then_release_it.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_lease_and_then_release_it.js new file mode 100644 index 000000000000..4507ccf45d4c --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_break_lease_and_then_release_it.js @@ -0,0 +1,199 @@ +let nock = require('nock'); + +module.exports.hash = "9a059dd3de5d823392423f909fdac826"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121915369200772"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915369200772') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293423-d01a-0000-18df-946ea6000000', + 'x-ms-client-request-id', + '0041fd5b-fc0b-467d-a60f-008c594ee5e3', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:53 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915369200772') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19f2-701a-006b-2bdf-94e952000000', + 'x-ms-client-request-id', + '222b1a4d-8e7b-4414-8f4f-37b5f6773801', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '79efc86e-c051-4696-9c60-eee1a9f93e2a', + 'Date', + 'Sun, 27 Sep 2020 15:05:53 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121915369200772') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293425-d01a-0000-19df-946ea6000000', + 'x-ms-client-request-id', + '8b02749a-66b9-45a5-8607-1dd50df0e26a', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:53 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', + 'Sun, 27 Sep 2020 15:05:54 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915369200772') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19f5-701a-006b-2cdf-94e952000000', + 'x-ms-client-request-id', + '3f43de1d-caef-4f80-a649-a17addb83668', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:54 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121915369200772') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293428-d01a-0000-1adf-946ea6000000', + 'x-ms-client-request-id', + 'bf08638b-5f88-4f36-8bc8-5d65812fea43', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'broken', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:53 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', + 'Sun, 27 Sep 2020 15:05:55 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915369200772') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:53 GMT', + 'ETag', + '"0x8D862F6D46E9B2F"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19f7-701a-006b-2edf-94e952000000', + 'x-ms-client-request-id', + '8abe0e10-10f4-4008-9051-40b2c0218664', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:54 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121915369200772') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029342b-d01a-0000-1ddf-946ea6000000', + 'x-ms-client-request-id', + '9c8799f3-c8b6-4428-a7e6-ea7324e481e1', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:55 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease.js new file mode 100644 index 000000000000..11e3605e6477 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease.js @@ -0,0 +1,117 @@ +let nock = require('nock'); + +module.exports.hash = "4038737563cbb5fb3335adf53fbfa413"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121914876904135"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914876904135') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:48 GMT', + 'ETag', + '"0x8D862F6D17F787B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19dc-701a-006b-1edf-94e952000000', + 'x-ms-client-request-id', + 'ae80488d-3b36-4e8b-9e6d-1c28a0f047ce', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:48 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914876904135') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:48 GMT', + 'ETag', + '"0x8D862F6D17F787B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293414-d01a-0000-0fdf-946ea6000000', + 'x-ms-client-request-id', + '1ff85c8e-bf37-4dd6-bddc-036fece28e97', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '738a5822-ff90-4d03-aab4-136fb410dacc', + 'Date', + 'Sun, 27 Sep 2020 15:05:48 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914876904135') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:48 GMT', + 'ETag', + '"0x8D862F6D17F787B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19e0-701a-006b-20df-94e952000000', + 'x-ms-client-request-id', + '68bf8427-ad12-472c-81ac-fddd984d9bd9', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:05:48 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914876904135') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:48 GMT', + 'ETag', + '"0x8D862F6D17F787B"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293418-d01a-0000-11df-946ea6000000', + 'x-ms-client-request-id', + '2903d1bc-f799-46b4-a7d2-535149d3f19d', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:49 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121914876904135') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19e3-701a-006b-22df-94e952000000', + 'x-ms-client-request-id', + '5362f1cd-c428-4409-951a-2620988fc3cd', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:49 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.js new file mode 100644 index 000000000000..ec6bc8af6e2f --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_changelease_before_acquiring_a_lease.js @@ -0,0 +1,67 @@ +let nock = require('nock'); + +module.exports.hash = "ebfbd5b28ebc766ef7fcc4b5f1e3c195"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121915061801772"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915061801772') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:50 GMT', + 'ETag', + '"0x8D862F6D29A2262"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293419-d01a-0000-12df-946ea6000000', + 'x-ms-client-request-id', + 'f8d1e1d9-9240-4f38-a7b1-9b20fb243fae', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:50 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915061801772') + .query(true) + .reply(409, "LeaseNotPresentWithLeaseOperationThere is currently no lease on the file share.\nRequestId:09ab19e5-701a-006b-23df-94e952000000\nTime:2020-09-27T15:05:51.1790130Z", [ + 'Content-Length', + '248', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19e5-701a-006b-23df-94e952000000', + 'x-ms-client-request-id', + 'a9af1e5f-8eb8-4b67-ad8e-8e83dd800ab9', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseNotPresentWithLeaseOperation', + 'Date', + 'Sun, 27 Sep 2020 15:05:50 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121915061801772') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029341b-d01a-0000-13df-946ea6000000', + 'x-ms-client-request-id', + '28e6eb70-76d2-4a0e-8bc3-6f0b59f8f3b9', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:51 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_invalid_duration_for_acquirelease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_invalid_duration_for_acquirelease.js new file mode 100644 index 000000000000..f583e92020cb --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_invalid_duration_for_acquirelease.js @@ -0,0 +1,67 @@ +let nock = require('nock'); + +module.exports.hash = "654caa107adf9e5140aa8bdb81725c8e"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121914775500736"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914775500736') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:47 GMT', + 'ETag', + '"0x8D862F6D0EC4B5E"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293411-d01a-0000-0ddf-946ea6000000', + 'x-ms-client-request-id', + '17271a22-cdd2-4854-9ffe-4c2b4b99c820', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:47 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121914775500736') + .query(true) + .reply(400, "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:09ab19da-701a-006b-1ddf-94e952000000\nTime:2020-09-27T15:05:48.3009699Zx-ms-lease-duration1", [ + 'Content-Length', + '326', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19da-701a-006b-1ddf-94e952000000', + 'x-ms-client-request-id', + '7eeaebe0-d727-4e32-a9f0-cc6673ecbfb5', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'InvalidHeaderValue', + 'Date', + 'Sun, 27 Sep 2020 15:05:47 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121914775500736') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293413-d01a-0000-0edf-946ea6000000', + 'x-ms-client-request-id', + '4d1defbc-20c2-4031-87da-9f19e734f42e', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:48 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_delete.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_delete.js new file mode 100644 index 000000000000..e73f7da589d8 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_delete.js @@ -0,0 +1,109 @@ +let nock = require('nock'); + +module.exports.hash = "0c0829efdb2bc6b3a538e1d74362f342"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121916619007218"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916619007218') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:06 GMT', + 'ETag', + '"0x8D862F6DBE1C8C2"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293451-d01a-0000-2fdf-946ea6000000', + 'x-ms-client-request-id', + '9d1e9520-7dc4-4f1c-871b-bb8009e53ac4', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:06 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916619007218') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:06 GMT', + 'ETag', + '"0x8D862F6DBE1C8C2"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a20-701a-006b-42df-94e952000000', + 'x-ms-client-request-id', + '8de6c038-0b3a-42b4-8fff-222e5583a978', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:06:05 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916619007218') + .query(true) + .reply(412, "LeaseIdMissingThere is currently a lease on the file share and no lease ID was specified in the request.\nRequestId:10293453-d01a-0000-30df-946ea6000000\nTime:2020-09-27T15:06:07.1545112Z", [ + 'Content-Length', + '273', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293453-d01a-0000-30df-946ea6000000', + 'x-ms-client-request-id', + 'db810f91-bf9e-4757-8888-1edecde92635', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseIdMissing', + 'Date', + 'Sun, 27 Sep 2020 15:06:06 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916619007218') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a26-701a-006b-44df-94e952000000', + 'x-ms-client-request-id', + '878d5d81-092c-4798-8731-d9e861b67210', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:06 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916619007218') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293458-d01a-0000-33df-946ea6000000', + 'x-ms-client-request-id', + '41a75a6b-e4cc-42d9-a22a-dd37a8076891', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:07 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_get_operations.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_get_operations.js new file mode 100644 index 000000000000..d800394d8ec8 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_get_operations.js @@ -0,0 +1,203 @@ +let nock = require('nock'); + +module.exports.hash = "783b0b97c7720d404070d72ec167933d"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121916823006806"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916823006806') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:08 GMT', + 'ETag', + '"0x8D862F6DD18CCA0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a2b-701a-006b-46df-94e952000000', + 'x-ms-client-request-id', + '259a1fed-abfe-4b80-99c8-5d55ab4c597c', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:07 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916823006806') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:08 GMT', + 'ETag', + '"0x8D862F6DD18CCA0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029345a-d01a-0000-34df-946ea6000000', + 'x-ms-client-request-id', + 'c53c9abb-9e04-4bee-a381-f330bb357082', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '4a962ce7-3efb-4627-a830-05c98b03e95e', + 'Date', + 'Sun, 27 Sep 2020 15:06:08 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121916823006806') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:08 GMT', + 'ETag', + '"0x8D862F6DD18CCA0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a2f-701a-006b-47df-94e952000000', + 'x-ms-client-request-id', + '7b111603-eabc-46c0-b2c1-808bb3938b8d', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:06:08 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', + 'Sun, 27 Sep 2020 15:06:08 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121916823006806') + .query(true) + .reply(412, "LeaseIdMismatchWithContainerOperationThe lease ID specified did not match the lease ID for the file share.\nRequestId:1029345c-d01a-0000-35df-946ea6000000\nTime:2020-09-27T15:06:09.6102535Z", [ + 'Content-Length', + '275', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029345c-d01a-0000-35df-946ea6000000', + 'x-ms-client-request-id', + '004a614b-7d18-4a47-93fe-a79c5cdd034e', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseIdMismatchWithContainerOperation', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,x-ms-error-code,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Sun, 27 Sep 2020 15:06:09 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121916823006806') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:08 GMT', + 'ETag', + '"0x8D862F6DD18CCA0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a32-701a-006b-49df-94e952000000', + 'x-ms-client-request-id', + '9154caa5-8dfe-49b6-a841-30b0b02f42bf', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:06:08 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', + 'Sun, 27 Sep 2020 15:06:09 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916823006806') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:08 GMT', + 'ETag', + '"0x8D862F6DD18CCA0"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029345e-d01a-0000-36df-946ea6000000', + 'x-ms-client-request-id', + 'a518811b-0b6f-4c0a-862c-fc18a5706b78', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:06:09 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916823006806') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a33-701a-006b-4adf-94e952000000', + 'x-ms-client-request-id', + '7dcfd868-ccb8-41ae-9ab4-efd70632df39', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:09 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_write_operations.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_write_operations.js new file mode 100644 index 000000000000..f69c68f539e8 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_condition_for_write_operations.js @@ -0,0 +1,159 @@ +let nock = require('nock'); + +module.exports.hash = "44ab307e6c4bc4b593883f54024ed146"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121917079001315"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:10 GMT', + 'ETag', + '"0x8D862F6DEA02FCD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293460-d01a-0000-38df-946ea6000000', + 'x-ms-client-request-id', + '8b85d952-4720-4e12-8f77-f67ac1ebb788', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:10 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:10 GMT', + 'ETag', + '"0x8D862F6DEA02FCD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a36-701a-006b-4cdf-94e952000000', + 'x-ms-client-request-id', + '70c512fb-3dc5-4c2c-99ea-bc254edc6162', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'dbb014b6-5de2-4d8f-8c48-ed7b503b7733', + 'Date', + 'Sun, 27 Sep 2020 15:06:10 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(412, "LeaseIdMissingThere is currently a lease on the file share and no lease ID was specified in the request.\nRequestId:10293463-d01a-0000-39df-946ea6000000\nTime:2020-09-27T15:06:11.7787922Z", [ + 'Content-Length', + '273', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293463-d01a-0000-39df-946ea6000000', + 'x-ms-client-request-id', + 'f2da11ba-e110-4fae-b33c-a4d9b84d5226', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseIdMissing', + 'Date', + 'Sun, 27 Sep 2020 15:06:11 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(412, "LeaseIdMismatchWithContainerOperationThe lease ID specified did not match the lease ID for the file share.\nRequestId:09ab1a39-701a-006b-4ddf-94e952000000\nTime:2020-09-27T15:06:12.1798962Z", [ + 'Content-Length', + '275', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a39-701a-006b-4ddf-94e952000000', + 'x-ms-client-request-id', + '4967bca6-47c9-4f66-976d-3ca66d820f49', + 'x-ms-version', + '2020-02-10', + 'x-ms-error-code', + 'LeaseIdMismatchWithContainerOperation', + 'Date', + 'Sun, 27 Sep 2020 15:06:11 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:12 GMT', + 'ETag', + '"0x8D862F6DF999657"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293465-d01a-0000-3adf-946ea6000000', + 'x-ms-client-request-id', + 'a3149040-0a5c-4076-8bf1-0288f6a2709f', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:12 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121917079001315') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:12 GMT', + 'ETag', + '"0x8D862F6DF999657"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a3c-701a-006b-4fdf-94e952000000', + 'x-ms-client-request-id', + '50d3ae0e-d30b-4cf5-9146-acc879fa7011', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:06:12 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121917079001315') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293467-d01a-0000-3bdf-946ea6000000', + 'x-ms-client-request-id', + '81186509-54c8-415d-94c3-ce811b8cf620', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:12 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_properties_properly_returned.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_properties_properly_returned.js new file mode 100644 index 000000000000..d126fec48f3d --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_lease_properties_properly_returned.js @@ -0,0 +1,159 @@ +let nock = require('nock'); + +module.exports.hash = "60d3362fd95e0f8e316ba3469840044f"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121916362104227"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916362104227') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:03 GMT', + 'ETag', + '"0x8D862F6DA59F6E8"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029344a-d01a-0000-2bdf-946ea6000000', + 'x-ms-client-request-id', + '53981182-3d57-4e8a-bf16-1459ecdf02bd', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:03 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916362104227') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:03 GMT', + 'ETag', + '"0x8D862F6DA59F6E8"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a17-701a-006b-3edf-94e952000000', + 'x-ms-client-request-id', + '8f1703cf-5535-404a-928d-83698c189757', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '409a5c92-4eda-4722-818d-8545d1a6228a', + 'Date', + 'Sun, 27 Sep 2020 15:06:03 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121916362104227') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:03 GMT', + 'ETag', + '"0x8D862F6DA59F6E8"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029344d-d01a-0000-2cdf-946ea6000000', + 'x-ms-client-request-id', + 'e5ad7d9c-3aa4-46d7-8da6-8005417d2e18', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'locked', + 'x-ms-lease-state', + 'leased', + 'x-ms-lease-duration', + 'infinite', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:06:03 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', + 'Sun, 27 Sep 2020 15:06:04 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/') + .query(true) + .reply(200, "share160093141210102328Thu, 24 Sep 2020 07:10:13 GMT\"0x8D86058E1C40CB2\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:10:13 GMT$account-encryption-keyfalseshare160093176153301093Thu, 24 Sep 2020 07:16:02 GMT\"0x8D86059B206C943\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:16:02 GMT$account-encryption-keyfalseshare160093195256704532Thu, 24 Sep 2020 07:19:13 GMT\"0x8D8605A23EB8F85\"unlockedavailable5120TransactionOptimizedThu, 24 Sep 2020 07:19:13 GMT$account-encryption-keyfalseshare160121233635009423Sun, 27 Sep 2020 13:12:16 GMT\"0x8D862E6F4FB4A9C\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:12:16 GMT$account-encryption-keyfalseshare160121235006600409Sun, 27 Sep 2020 13:12:30 GMT\"0x8D862E6FD28EA42\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:12:30 GMT$account-encryption-keyfalseshare160121310851508050Sun, 27 Sep 2020 13:25:09 GMT\"0x8D862E8C1F3100F\"unlockedexpired5120TransactionOptimizedSun, 27 Sep 2020 13:25:09 GMT$account-encryption-keyfalseshare160121326942502893Sun, 27 Sep 2020 13:27:50 GMT\"0x8D862E921DDD8EC\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 13:27:50 GMT$account-encryption-keyfalseshare160121389438808287Sun, 27 Sep 2020 13:38:15 GMT\"0x8D862EA966D8BBD\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 13:38:15 GMT$account-encryption-keyfalseshare160121491612400623Sun, 27 Sep 2020 13:55:16 GMT\"0x8D862ECF6A57F34\"unlockedexpired5120TransactionOptimizedSun, 27 Sep 2020 13:55:16 GMT$account-encryption-keyfalseshare160121509901107353Sun, 27 Sep 2020 13:58:19 GMT\"0x8D862ED63A7C0E3\"unlockedbroken5120TransactionOptimizedSun, 27 Sep 2020 13:58:19 GMT$account-encryption-keyfalseshare160121551221306317Sun, 27 Sep 2020 14:05:12 GMT\"0x8D862EE59F16DE2\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 14:05:12 GMT$account-encryption-keyfalseshare160121551974009496Sun, 27 Sep 2020 14:05:19 GMT\"0x8D862EE5E6E01B4\"unlockedavailable5120TransactionOptimizedSun, 27 Sep 2020 14:05:19 GMT$account-encryption-keyfalseshare160121870218806337Sun, 27 Sep 2020 14:58:23 GMT\"0x8D862F5C81E89A1\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 14:58:23 GMT$account-encryption-keyfalseshare160121916362104227Sun, 27 Sep 2020 15:06:03 GMT\"0x8D862F6DA59F6E8\"lockedleasedinfinite5120TransactionOptimizedSun, 27 Sep 2020 15:06:03 GMT$account-encryption-keyfalse", [ + 'Transfer-Encoding', + 'chunked', + 'Content-Type', + 'application/xml', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a1c-701a-006b-40df-94e952000000', + 'x-ms-client-request-id', + 'ed5589be-b7b2-48f5-ba82-13be26968a7e', + 'x-ms-version', + '2020-02-10', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Sun, 27 Sep 2020 15:06:04 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916362104227') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:03 GMT', + 'ETag', + '"0x8D862F6DA59F6E8"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293450-d01a-0000-2edf-946ea6000000', + 'x-ms-client-request-id', + 'a58cb950-88f9-4298-ae10-574084530956', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:06:05 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916362104227') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a1f-701a-006b-41df-94e952000000', + 'x-ms-client-request-id', + 'd5c1978a-4687-4656-bd22-71599aa7d748', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:05 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_release_lease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_release_lease.js new file mode 100644 index 000000000000..8fd623d13ef5 --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_release_lease.js @@ -0,0 +1,133 @@ +let nock = require('nock'); + +module.exports.hash = "a65d31233d61e48fa43a445144fb1bd3"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121915174409919"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915174409919') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:51 GMT', + 'ETag', + '"0x8D862F6D34596BD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19e9-701a-006b-25df-94e952000000', + 'x-ms-client-request-id', + '5df9990a-4985-4c0c-8e89-80eac0e902d6', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:51 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915174409919') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:51 GMT', + 'ETag', + '"0x8D862F6D34596BD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '1029341e-d01a-0000-15df-946ea6000000', + 'x-ms-client-request-id', + '9cae3085-e564-44d1-8551-9645498da9de', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + '0dbae786-d3e1-44dc-bf8d-b204f15f8798', + 'Date', + 'Sun, 27 Sep 2020 15:05:51 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121915174409919') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:51 GMT', + 'ETag', + '"0x8D862F6D34596BD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19ef-701a-006b-29df-94e952000000', + 'x-ms-client-request-id', + '0186484b-1d66-4a49-9d1e-ee7c9cd6ab57', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:05:51 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .get('/share160121915174409919') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:05:51 GMT', + 'ETag', + '"0x8D862F6D34596BD"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293422-d01a-0000-17df-946ea6000000', + 'x-ms-client-request-id', + '12b70c9f-ff6e-4371-bc0b-684279e9a84a', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-has-immutability-policy', + 'false', + 'x-ms-has-legal-hold', + 'false', + 'x-ms-share-quota', + '5120', + 'x-ms-access-tier', + 'TransactionOptimized', + 'x-ms-access-tier-change-time', + 'Sun, 27 Sep 2020 15:05:51 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', + 'Sun, 27 Sep 2020 15:05:52 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121915174409919') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab19f0-701a-006b-2adf-94e952000000', + 'x-ms-client-request-id', + '3bad43e7-1b4d-4963-aac5-20ca9aa74bc0', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:05:52 GMT' +]); diff --git a/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_renew_a_lease.js b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_renew_a_lease.js new file mode 100644 index 000000000000..eb9d32da0a5c --- /dev/null +++ b/sdk/storage/storage-file-share/recordings/node/leaseclient_for_share/recording_renew_a_lease.js @@ -0,0 +1,117 @@ +let nock = require('nock'); + +module.exports.hash = "c44ff11ca905a9bc01bf763e55c36b6b"; + +module.exports.testInfo = {"uniqueName":{"share":"share160121916168004389"},"newDate":{}} + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916168004389') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:01 GMT', + 'ETag', + '"0x8D862F6D9316731"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a0d-701a-006b-3adf-94e952000000', + 'x-ms-client-request-id', + 'ccb474c2-2540-4dac-a45b-5d97360013aa', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:00 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916168004389') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:01 GMT', + 'ETag', + '"0x8D862F6D9316731"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293444-d01a-0000-29df-946ea6000000', + 'x-ms-client-request-id', + '9d9081c1-1910-4df6-a11f-e47542dfb0d9', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:06:01 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916168004389') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:01 GMT', + 'ETag', + '"0x8D862F6D9316731"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a14-701a-006b-3cdf-94e952000000', + 'x-ms-client-request-id', + '2f91c9e9-d4fc-4ec3-94f4-83fc8e85cd61', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-id', + 'e9890485-bf47-4d9a-b3d0-aceb18506124', + 'Date', + 'Sun, 27 Sep 2020 15:06:01 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .put('/share160121916168004389') + .query(true) + .reply(200, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Sun, 27 Sep 2020 15:06:01 GMT', + 'ETag', + '"0x8D862F6D9316731"', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '10293448-d01a-0000-2adf-946ea6000000', + 'x-ms-client-request-id', + '7960eb34-b6f4-4248-9617-7c62580717f8', + 'x-ms-version', + '2020-02-10', + 'x-ms-lease-time', + '0', + 'Date', + 'Sun, 27 Sep 2020 15:06:02 GMT' +]); + +nock('https://fakestorageaccount.file.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/share160121916168004389') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '09ab1a16-701a-006b-3ddf-94e952000000', + 'x-ms-client-request-id', + '32b0d990-b5ed-4dbc-8f37-1ede76caf127', + 'x-ms-version', + '2020-02-10', + 'Date', + 'Sun, 27 Sep 2020 15:06:02 GMT' +]); 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 a530227db490..08200fa88502 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 @@ -1089,7 +1089,7 @@ export interface LeaseOperationResponseHeaders { etag?: string; lastModified?: Date; leaseId?: string; - leaseTime?: number; + leaseTimeInSeconds?: number; requestId?: string; version?: string; } diff --git a/sdk/storage/storage-file-share/src/Clients.ts b/sdk/storage/storage-file-share/src/Clients.ts index 176fd39e789a..104d2987fbb8 100644 --- a/sdk/storage/storage-file-share/src/Clients.ts +++ b/sdk/storage/storage-file-share/src/Clients.ts @@ -5682,7 +5682,7 @@ export interface LeaseOperationResponseHeaders { /** * Approximate time remaining in the lease period, in seconds. Only availabe for {@link ShareLeaseClient.breakLease} for share lease. */ - leaseTime?: number; + leaseTimeInSeconds?: number; /** * Uniquely identifies a file's lease, won't be set when returned by releaseLease. */ @@ -5938,12 +5938,12 @@ export class ShareLeaseClient { public async renewLease(options: LeaseOperationOptions = {}): Promise { const { span, spanOptions } = createSpan("ShareLeaseClient-renewLease", options.tracingOptions); - if (this.isShare) { + if (!this.isShare) { throw new RangeError("The renewLease operation is not available for lease on file."); } try { - return await this.fileOrShare.releaseLease(this._leaseId, { + return await (this.fileOrShare as Share).renewLease(this._leaseId, { abortSignal: options.abortSignal, spanOptions }); 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 064a9230c003..f38fc0e12f46 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 @@ -1861,7 +1861,7 @@ export interface ShareBreakLeaseHeaders { /** * Approximate time remaining in the lease period, in seconds. */ - leaseTime?: number; + leaseTimeInSeconds?: number; /** * Uniquely identifies a share's lease */ diff --git a/sdk/storage/storage-file-share/src/generated/src/models/mappers.ts b/sdk/storage/storage-file-share/src/generated/src/models/mappers.ts index 2c5d0a850a62..84f565862f88 100644 --- a/sdk/storage/storage-file-share/src/generated/src/models/mappers.ts +++ b/sdk/storage/storage-file-share/src/generated/src/models/mappers.ts @@ -1635,7 +1635,7 @@ export const ShareBreakLeaseHeaders: coreHttp.CompositeMapper = { name: "DateTimeRfc1123" } }, - leaseTime: { + leaseTimeInSeconds: { serializedName: "x-ms-lease-time", type: { name: "Number" diff --git a/sdk/storage/storage-file-share/swagger/README.md b/sdk/storage/storage-file-share/swagger/README.md index 1af9d439ec00..c64f40ad2f33 100644 --- a/sdk/storage/storage-file-share/swagger/README.md +++ b/sdk/storage/storage-file-share/swagger/README.md @@ -282,4 +282,14 @@ directive: $["x-ms-client-name"] = "body"; ``` +### Rename leaseTime -> leaseTimeInSeconds + +```yaml +directive: + - from: swagger-document + where: $["x-ms-paths"]["/{shareName}?restype=share&comp=lease&break"]..responses..headers["x-ms-lease-time"] + transform: > + $["x-ms-client-name"] = "LeaseTimeInSeconds"; +``` + ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fstorage%2Fstorage-file-share%2Fswagger%2FREADME.png) diff --git a/sdk/storage/storage-file-share/test/leaseclient.spec.ts b/sdk/storage/storage-file-share/test/leaseclient.spec.ts index 30aebdce95ab..05f2128276ce 100644 --- a/sdk/storage/storage-file-share/test/leaseclient.spec.ts +++ b/sdk/storage/storage-file-share/test/leaseclient.spec.ts @@ -1,12 +1,17 @@ import * as assert from "assert"; -import * as dotenv from "dotenv"; import { getBSU, recorderEnvSetup, bodyToString } from "./utils"; import { record, Recorder } from "@azure/test-utils-recorder"; -import { ShareClient, ShareDirectoryClient, ShareFileClient } from "../src"; -import { FileSystemAttributes } from "../src/FileSystemAttributes"; - +import { + ShareClient, + ShareDirectoryClient, + ShareFileClient, + ShareLeaseClient, + ShareServiceClient +} from "../src"; +import * as dotenv from "dotenv"; dotenv.config(); +// for file describe("LeaseClient", () => { let shareName: string; let shareClient: ShareClient; @@ -20,16 +25,6 @@ describe("LeaseClient", () => { let recorder: Recorder; - let fullFileAttributes = new FileSystemAttributes(); - fullFileAttributes.readonly = true; - fullFileAttributes.hidden = true; - fullFileAttributes.system = true; - fullFileAttributes.archive = true; - fullFileAttributes.temporary = true; - fullFileAttributes.offline = true; - fullFileAttributes.notContentIndexed = true; - fullFileAttributes.noScrubData = true; - beforeEach(async function() { recorder = record(this, recorderEnvSetup); const serviceClient = getBSU(); @@ -142,7 +137,9 @@ describe("LeaseClient", () => { let result = await fileClient.getProperties(); assert.equal(result.leaseState, "leased"); - await leaseClient.breakLease(); + const res = await leaseClient.breakLease(); + assert.equal(res.leaseTimeInSeconds, undefined); + result = await fileClient.getProperties(); assert.equal(result.leaseState, "broken"); @@ -336,3 +333,267 @@ describe("LeaseClient", () => { await fileClient.getProperties({ leaseAccessConditions: { leaseId: leaseClient.leaseId } }); }); }); + +describe("LeaseClient for share", () => { + let serviceClient: ShareServiceClient; + let shareName: string; + let shareClient: ShareClient; + const infiniteDuration = -1; + const finiteDuration = 15; + const guid = "e9890485-bf47-4d9a-b3d0-aceb18506124"; + + let recorder: Recorder; + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + serviceClient = getBSU(); + shareName = recorder.getUniqueName("share"); + shareClient = serviceClient.getShareClient(shareName); + await shareClient.create(); + }); + + afterEach(async function() { + await shareClient.deleteIfExists({ deleteSnapshots: "include" }); + await recorder.stop(); + }); + + // lease management: + it("acquireLease", async () => { + const leaseClient = shareClient.getShareLeaseClient(guid); + + const acquireResp = await leaseClient.acquireLease(infiniteDuration); + assert.equal(acquireResp.leaseId, guid); + + const result = await shareClient.getProperties(); + assert.equal(result.leaseDuration, "infinite"); + assert.equal(result.leaseState, "leased"); + assert.equal(result.leaseStatus, "locked"); + + await leaseClient.releaseLease(); + }); + + it("acquireLease for snapshot", async () => { + const snapshotRes = await shareClient.createSnapshot(); + assert.ok(snapshotRes.snapshot); + const snapshotShareClient = shareClient.withSnapshot(snapshotRes.snapshot!); + + const leaseClient = snapshotShareClient.getShareLeaseClient(guid); + const acquireResp = await leaseClient.acquireLease(infiniteDuration); + assert.equal(acquireResp.leaseId, guid); + + const snapshotResult = await snapshotShareClient.getProperties(); + assert.equal(snapshotResult.leaseDuration, "infinite"); + assert.equal(snapshotResult.leaseState, "leased"); + assert.equal(snapshotResult.leaseStatus, "locked"); + + const result = await shareClient.getProperties(); + assert.equal(result.leaseDuration, undefined); + assert.equal(result.leaseState, "available"); + assert.equal(result.leaseStatus, "unlocked"); + }); + + it("acquireLease without proposed lease id, with a finite duration", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(finiteDuration); + + const result = await shareClient.getProperties(); + assert.equal(result.leaseDuration, "fixed"); + assert.equal(result.leaseState, "leased"); + assert.equal(result.leaseStatus, "locked"); + + await leaseClient.releaseLease(); + }); + + it("acquireLease again with another lease id", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(infiniteDuration); + + const anotherLeaseClient = shareClient.getShareLeaseClient(guid); + try { + await anotherLeaseClient.acquireLease(infiniteDuration); + assert.fail("acquireLease a leased lease should fail with a different lease id"); + } catch (err) { + assert.equal(err.statusCode, 409); + } + + await leaseClient.releaseLease(); + }); + + it("acquireLease again with same lease id", async () => { + const leaseClient = shareClient.getShareLeaseClient(guid); + await leaseClient.acquireLease(); + leaseClient.acquireLease(infiniteDuration); + + await leaseClient.releaseLease(); + }); + + it("invalid duration for acquireLease", async () => { + // only -1 for infinite is allowed. + const invalidDuration = 1; + const leaseClient = shareClient.getShareLeaseClient(); + try { + await leaseClient.acquireLease(invalidDuration); + assert.fail(`acquireLease should fail for an invalid duration: ${invalidDuration}`); + } catch (err) { + assert.equal(err.statusCode, 400); + } + }); + + it("changeLease", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(infiniteDuration); + const changeResp = await leaseClient.changeLease(guid); + assert.equal(changeResp.leaseId, guid); + + await leaseClient.releaseLease(); + }); + + it("changeLease before acquiring a lease", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + try { + const changeResp = await leaseClient.changeLease(guid); + assert.equal(changeResp.leaseId, guid); + await leaseClient.releaseLease(); + } catch (err) { + assert.equal(err.statusCode, 409); + } + }); + + it("release lease", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(); + await leaseClient.releaseLease(); + + const result = await shareClient.getProperties(); + assert.equal(result.leaseDuration, undefined); + assert.equal(result.leaseState, "available"); + assert.equal(result.leaseStatus, "unlocked"); + }); + + it("break lease and then release it", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(); + let result = await shareClient.getProperties(); + assert.equal(result.leaseState, "leased"); + + const breakRes = await leaseClient.breakLease(); + // infinite lease broken immediately + assert.equal(breakRes.leaseTimeInSeconds, 0); + + result = await shareClient.getProperties(); + assert.equal(result.leaseState, "broken"); + + await leaseClient.releaseLease(); + }); + + it("break a broken lease", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(finiteDuration); + const breakRes = await leaseClient.breakLease(); + assert.ok(breakRes.leaseTimeInSeconds); + await leaseClient.breakLease(); + + await leaseClient.releaseLease(); + }); + + it("acquire a broken lease", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(); + await leaseClient.breakLease(); + let result = await shareClient.getProperties(); + assert.equal(result.leaseState, "broken"); + + await leaseClient.acquireLease(); + result = await shareClient.getProperties(); + assert.equal(result.leaseState, "leased"); + + await leaseClient.releaseLease(); + }); + + it("renew a lease", async () => { + const leaseClient = shareClient.getShareLeaseClient(guid); + await leaseClient.acquireLease(); + await leaseClient.renewLease(); + + await leaseClient.releaseLease(); + }); + + it("lease properties properly returned", async () => { + const leaseClient = shareClient.getShareLeaseClient(); + await leaseClient.acquireLease(); + + const getPropertiesRes = await shareClient.getProperties(); + assert.equal(getPropertiesRes.leaseDuration, "infinite"); + assert.equal(getPropertiesRes.leaseState, "leased"); + assert.equal(getPropertiesRes.leaseStatus, "locked"); + + for await (const shareItem of serviceClient.listShares()) { + if (shareItem.name === shareName) { + assert.equal(shareItem.properties.leaseDuration, "infinite"); + assert.equal(shareItem.properties.leaseState, "leased"); + assert.equal(shareItem.properties.leaseStatus, "locked"); + } + } + + await leaseClient.releaseLease(); + }); + + // lease conditions + it("lease condition for delete", async () => { + const leaseClient = new ShareLeaseClient(shareClient, guid); + await leaseClient.acquireLease(); + + try { + await shareClient.delete(); + assert.fail("Delete without lease condition should have failed."); + } catch (err) { + assert.equal(err.details.errorCode, "LeaseIdMissing"); + } + + await shareClient.delete({ leaseAccessConditions: { leaseId: guid } }); + }); + + it("lease condition for get operations", async () => { + const leaseClient = new ShareLeaseClient(shareClient); + await leaseClient.acquireLease(); + + await shareClient.getProperties(); + + try { + await shareClient.getProperties({ leaseAccessConditions: { leaseId: guid } }); + assert.fail("get with miss-match lease ID should have failed."); + } catch (err) { + assert.equal(err.details.errorCode, "LeaseIdMismatchWithContainerOperation"); + } + + await shareClient.getProperties({ leaseAccessConditions: { leaseId: leaseClient.leaseId } }); + + await leaseClient.releaseLease(); + }); + + it("lease condition for write operations", async () => { + const leaseClient = new ShareLeaseClient(shareClient); + await leaseClient.acquireLease(); + + const meta = { key: "val" }; + + try { + await shareClient.setMetadata(meta); + assert.fail("write without lease ID should have failed."); + } catch (err) { + assert.equal(err.details.errorCode, "LeaseIdMissing"); + } + + try { + await shareClient.setMetadata(meta, { leaseAccessConditions: { leaseId: guid } }); + assert.fail("write with miss-match lease ID should have failed."); + } catch (err) { + assert.equal(err.details.errorCode, "LeaseIdMismatchWithContainerOperation"); + } + + await shareClient.setMetadata(meta, { + leaseAccessConditions: { leaseId: leaseClient.leaseId } + }); + + await leaseClient.releaseLease(); + }); +}); diff --git a/sdk/storage/storage-file-share/test/utils/testutils.common.ts b/sdk/storage/storage-file-share/test/utils/testutils.common.ts index 756bca1ff301..84209f2c11bb 100644 --- a/sdk/storage/storage-file-share/test/utils/testutils.common.ts +++ b/sdk/storage/storage-file-share/test/utils/testutils.common.ts @@ -8,7 +8,6 @@ export function isBrowser(): boolean { const mockAccountName = "fakestorageaccount"; const mockAccountKey = "aaaaa"; const mockSDAccountName = "sd-fakestorageaccount"; -const mockPFAccountName = "pf-fakestorageaccount"; export const recorderEnvSetup: RecorderEnvironmentSetup = { replaceableVariables: { // Used in record and playback modes @@ -25,7 +24,7 @@ export const recorderEnvSetup: RecorderEnvironmentSetup = { SOFT_DELETE_ACCOUNT_KEY: `${mockAccountKey}`, SOFT_DELETE_ACCOUNT_SAS: `${mockAccountKey}`, SOFT_DELETE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockSDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net`, - PREMIUM_FILE_ACCOUNT_NAME: `${mockPFAccountName}`, + PREMIUM_FILE_ACCOUNT_NAME: `${mockAccountName}`, PREMIUM_FILE_ACCOUNT_KEY: `${mockAccountKey}`, PREMIUM_FILE_ACCOUNT_SAS: `${mockAccountKey}`, PREMIUM_FILE_STORAGE_CONNECTION_STRING: `DefaultEndpointsProtocol=https;AccountName=${mockSDAccountName};AccountKey=${mockAccountKey};EndpointSuffix=core.windows.net` diff --git a/sdk/storage/storage-queue/src/QueueClient.ts b/sdk/storage/storage-queue/src/QueueClient.ts index 9f19867a8613..57f831a98496 100644 --- a/sdk/storage/storage-queue/src/QueueClient.ts +++ b/sdk/storage/storage-queue/src/QueueClient.ts @@ -1258,7 +1258,7 @@ export class QueueClient extends StorageClient { * * @param {string} messageId Id of the message * @param {string} popReceipt A valid pop receipt value returned from an earlier call to the receive messages or update message operation. - * @param {string} message Message to update. + * @param {string} message Message to update. If this parameter is undefined, then the content of the message won't be updated. * @param {number} visibilityTimeout Specifies the new visibility timeout value, in seconds, * relative to server time. The new value must be larger than or equal to 0, * and cannot be larger than 7 days. The visibility timeout of a message cannot @@ -1277,7 +1277,7 @@ export class QueueClient extends StorageClient { ): Promise { const { span, spanOptions } = createSpan("QueueClient-updateMessage", options.tracingOptions); let queueMessage = undefined; - if (message) { + if (message !== undefined) { queueMessage = { messageText: message }; }