diff --git a/common/config/rush/common-versions.json b/common/config/rush/common-versions.json index bc7873115603..f81e3123223d 100644 --- a/common/config/rush/common-versions.json +++ b/common/config/rush/common-versions.json @@ -52,6 +52,8 @@ // Following is required to allow for backward compatibility with Event Processor Host Track 1 "@azure/event-hubs": ["^2.1.4"], // Allow packages to continue to use old eslint-plugin-azure-sdk until they can adapt to 3.0.0 - "@azure/eslint-plugin-azure-sdk": ["^2.0.1"] + "@azure/eslint-plugin-azure-sdk": ["^2.0.1"], + // Allow storage-blob-changefeed and storage-file-datalake to use the preview version of storage-blob. + "@azure/storage-blob": ["^12.2.0-preview.1"] } } diff --git a/sdk/storage/storage-blob-changefeed/package.json b/sdk/storage/storage-blob-changefeed/package.json index 71ddab5f6711..fd4b8d288c7f 100644 --- a/sdk/storage/storage-blob-changefeed/package.json +++ b/sdk/storage/storage-blob-changefeed/package.json @@ -96,7 +96,7 @@ ] }, "dependencies": { - "@azure/storage-blob": "^12.1.2", + "@azure/storage-blob": "^12.2.0-preview.1", "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^1.1.1", "@azure/core-lro": "^1.0.2", @@ -162,4 +162,4 @@ "util": "^0.12.1", "sinon": "^9.0.2" } -} \ No newline at end of file +} diff --git a/sdk/storage/storage-blob/src/Clients.ts b/sdk/storage/storage-blob/src/Clients.ts index 4fcc9565e5b6..63130bbf6ae0 100644 --- a/sdk/storage/storage-blob/src/Clients.ts +++ b/sdk/storage/storage-blob/src/Clients.ts @@ -6072,7 +6072,7 @@ export interface ContainerDeleteBlobOptions extends BlobDeleteOptions { /** * An opaque DateTime value that, when present, specifies the version * of the blob to delete. It's for service version 2019-10-10 and newer. - * + * * @type {string} * @memberof ContainerDeleteBlobOptions */ diff --git a/sdk/storage/storage-file-datalake/package.json b/sdk/storage/storage-file-datalake/package.json index 10834962e6ae..1f23d5168d3e 100644 --- a/sdk/storage/storage-file-datalake/package.json +++ b/sdk/storage/storage-file-datalake/package.json @@ -99,7 +99,7 @@ "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.8", "@azure/logger": "^1.0.0", - "@azure/storage-blob": "^12.1.2", + "@azure/storage-blob": "^12.2.0-preview.1", "events": "^3.0.0", "tslib": "^2.0.0" }, @@ -162,4 +162,4 @@ "typescript": "~3.9.3", "util": "^0.12.1" } -} \ No newline at end of file +} diff --git a/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__absolute.json b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__absolute.json new file mode 100644 index 000000000000..65d4f909e2da --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__absolute.json @@ -0,0 +1,179 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239957549208271", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:55 GMT", + "etag": "\"0x8D812C02659726A\"", + "last-modified": "Wed, 17 Jun 2020 13:12:55 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d113ba6d-389a-4183-93a9-b524be8c9ddd", + "x-ms-request-id": "6ba7aa3f-e01e-0029-46a9-441bdd000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": { + "resource": "file" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:55 GMT", + "etag": "\"0x8D812C026B2FFFF\"", + "last-modified": "Wed, 17 Jun 2020 13:12:56 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b08de4a7-8bd2-448f-99e7-208ce3fd9781", + "x-ms-request-id": "f3d5a328-101f-0002-31a9-449b11000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": { + "position": "0", + "action": "append" + }, + "requestBody": "Hello World", + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:56 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "be015a43-db81-4565-9efb-ae805883c497", + "x-ms-request-id": "f3d5a32a-101f-0002-33a9-449b11000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": { + "position": "11", + "action": "flush" + }, + "requestBody": "", + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:56 GMT", + "etag": "\"0x8D812C02766EFF0\"", + "last-modified": "Wed, 17 Jun 2020 13:12:57 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c3fc78ff-d8c7-42d7-9cd4-c3165d322c87", + "x-ms-request-id": "f3d5a32e-101f-0002-37a9-449b11000000", + "x-ms-request-server-encrypted": "false", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:57 GMT", + "etag": "\"0x8D812C02766EFF0\"", + "last-modified": "Wed, 17 Jun 2020 13:12:57 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ba0c89c7-29b3-4560-9b09-ccecd898f9bd", + "x-ms-request-id": "6ba7ab58-e01e-0029-40a9-441bdd000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": {}, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-type": "text/plain;charset=UTF-8", + "date": "Wed, 17 Jun 2020 13:12:58 GMT", + "etag": "\"0x8D812C02766EFF0\"", + "last-modified": "Wed, 17 Jun 2020 13:12:57 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "7fd74207-670a-4f31-b6b4-fae4f90f128b", + "x-ms-creation-time": "Wed, 17 Jun 2020 13:12:56 GMT", + "x-ms-expiry-time": "Wed, 17 Jun 2020 13:13:02 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6ba7ab83-e01e-0029-67a9-441bdd000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239957549208271/file159239957607304880", + "query": {}, + "requestBody": null, + "status": 404, + "response": "", + "responseHeaders": { + "date": "Wed, 17 Jun 2020 13:13:04 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "9938eeef-13d7-4aae-84c0-6b6363bfc623", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "fc7e7cd6-201e-0044-41a9-44af96000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239957549208271", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:13:05 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9674e2eb-72e8-4731-ba82-cd1317169c85", + "x-ms-request-id": "fc7e7cf1-201e-0044-54a9-44af96000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "filesystem": "filesystem159239957549208271", + "file": "file159239957607304880" + }, + "newDate": { + "now": "2020-06-17T13:12:57.832Z" + } + }, + "hash": "b0e53f88c4a0a0813ccba008a92d426d" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__neverexpire.json b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__neverexpire.json new file mode 100644 index 000000000000..1568edbf97b8 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__neverexpire.json @@ -0,0 +1,159 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239956833708016", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:49 GMT", + "etag": "\"0x8D812C022C2586D\"", + "last-modified": "Wed, 17 Jun 2020 13:12:49 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "838e0ace-c89c-4548-891b-af02661fd427", + "x-ms-request-id": "21918a50-c01e-0063-1ba9-44b852000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239956833708016/file159239957007507452", + "query": { + "resource": "file" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:50 GMT", + "etag": "\"0x8D812C023B4A8A3\"", + "last-modified": "Wed, 17 Jun 2020 13:12:51 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "bc8508df-4d74-4161-bafc-08b70fc4b15c", + "x-ms-request-id": "f3d5a31e-101f-0002-2ba9-449b11000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239956833708016/file159239957007507452", + "query": { + "position": "0", + "action": "append" + }, + "requestBody": "Hello World", + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:51 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a652f82a-6d78-4328-a6fe-94e7da120872", + "x-ms-request-id": "f3d5a320-101f-0002-2da9-449b11000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159239956833708016/file159239957007507452", + "query": { + "position": "11", + "action": "flush" + }, + "requestBody": "", + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:51 GMT", + "etag": "\"0x8D812C02465CAE5\"", + "last-modified": "Wed, 17 Jun 2020 13:12:52 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "07a6fc49-5fad-464f-bcf6-b0f279bb0a88", + "x-ms-request-id": "f3d5a322-101f-0002-2fa9-449b11000000", + "x-ms-request-server-encrypted": "false", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239956833708016/file159239957007507452", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:53 GMT", + "etag": "\"0x8D812C02465CAE5\"", + "last-modified": "Wed, 17 Jun 2020 13:12:52 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "c2bf3445-ae98-470c-a10c-beb27c18bafb", + "x-ms-request-id": "6ba7a955-e01e-0029-01a9-441bdd000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239956833708016/file159239957007507452", + "query": {}, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-type": "text/plain;charset=UTF-8", + "date": "Wed, 17 Jun 2020 13:12:54 GMT", + "etag": "\"0x8D812C02465CAE5\"", + "last-modified": "Wed, 17 Jun 2020 13:12:52 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "eac4a0aa-32e8-4edb-bce8-9ab7027e82a8", + "x-ms-creation-time": "Wed, 17 Jun 2020 13:12:51 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "6ba7a99d-e01e-0029-3ba9-441bdd000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159239956833708016", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 17 Jun 2020 13:12:54 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1114e467-b86f-4ab6-bde1-9eb2acb1dd4d", + "x-ms-request-id": "6ba7aa08-e01e-0029-18a9-441bdd000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "filesystem": "filesystem159239956833708016", + "file": "file159239957007507452" + }, + "newDate": {} + }, + "hash": "c6d159241838e22eddeb2accb80cf720" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__override.json b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__override.json new file mode 100644 index 000000000000..3a31a8908534 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__override.json @@ -0,0 +1,207 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:26 GMT", + "etag": "\"0x8D818256BA3F6B3\"", + "last-modified": "Wed, 24 Jun 2020 10:00:27 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "284e6770-2358-4c68-8b14-10791c5794a9", + "x-ms-request-id": "7b699a1f-501e-0013-5a0e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": { + "resource": "file" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:26 GMT", + "etag": "\"0x8D818256BFD652E\"", + "last-modified": "Wed, 24 Jun 2020 10:00:27 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "80c2d50c-3c97-47d7-ac7d-0948e02d9392", + "x-ms-request-id": "2a2870f9-b01f-0034-210e-4a1661000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": { + "position": "0", + "action": "append" + }, + "requestBody": "Hello World", + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:27 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "51a4f743-9bdc-47e8-ac64-15459a2bcffb", + "x-ms-request-id": "2a2870fe-b01f-0034-250e-4a1661000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": { + "position": "11", + "action": "flush" + }, + "requestBody": "", + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:28 GMT", + "etag": "\"0x8D818256CAC30A7\"", + "last-modified": "Wed, 24 Jun 2020 10:00:28 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "79b7e151-9ac2-423c-b1de-1752aafc999c", + "x-ms-request-id": "2a287101-b01f-0034-280e-4a1661000000", + "x-ms-request-server-encrypted": "false", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:28 GMT", + "etag": "\"0x8D818256CAC30A7\"", + "last-modified": "Wed, 24 Jun 2020 10:00:28 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "b479d931-6e13-430d-9be6-60ff9f42b9ea", + "x-ms-request-id": "7b699a4d-501e-0013-7f0e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": {}, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-type": "text/plain;charset=UTF-8", + "date": "Wed, 24 Jun 2020 10:00:29 GMT", + "etag": "\"0x8D818256CAC30A7\"", + "last-modified": "Wed, 24 Jun 2020 10:00:28 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "e477113f-0b4c-4b86-8e5d-96ce34c3cf2b", + "x-ms-creation-time": "Wed, 24 Jun 2020 10:00:27 GMT", + "x-ms-expiry-time": "Wed, 24 Jun 2020 11:00:27 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "7b699a5d-501e-0013-070e-4a01a5000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:29 GMT", + "etag": "\"0x8D818256CAC30A7\"", + "last-modified": "Wed, 24 Jun 2020 10:00:28 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "79f76f62-d229-4e84-87d3-7ea8fe925080", + "x-ms-request-id": "7b699a6d-501e-0013-120e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611/file159299282745900163", + "query": {}, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-type": "text/plain;charset=UTF-8", + "date": "Wed, 24 Jun 2020 10:00:29 GMT", + "etag": "\"0x8D818256CAC30A7\"", + "last-modified": "Wed, 24 Jun 2020 10:00:28 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "cabc72df-422f-4bdb-b375-9ef1f1d9ae09", + "x-ms-creation-time": "Wed, 24 Jun 2020 10:00:27 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "7b699a91-501e-0013-320e-4a01a5000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282687904611", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:30 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "18720132-86c0-4183-921f-f21725174dd5", + "x-ms-request-id": "7b699aa6-501e-0013-430e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "filesystem": "filesystem159299282687904611", + "file": "file159299282745900163" + }, + "newDate": {} + }, + "hash": "481cec3f9359747a3e79454241767795" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetocreation.json b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetocreation.json new file mode 100644 index 000000000000..84519eaf02cb --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetocreation.json @@ -0,0 +1,160 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282283600351", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:22 GMT", + "etag": "\"0x8D81825693B674E\"", + "last-modified": "Wed, 24 Jun 2020 10:00:23 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1738b4fc-5a96-4118-b22e-599bddc02274", + "x-ms-request-id": "7b69993c-501e-0013-140e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282283600351/file159299282341904059", + "query": { + "resource": "file" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:22 GMT", + "etag": "\"0x8D818256994D24E\"", + "last-modified": "Wed, 24 Jun 2020 10:00:23 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "267684a6-91ca-4e19-9971-483d58ae73f8", + "x-ms-request-id": "2a2870c3-b01f-0034-6d0e-4a1661000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282283600351/file159299282341904059", + "query": { + "position": "0", + "action": "append" + }, + "requestBody": "Hello World", + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:23 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9379f59d-1d90-4138-9068-13e12aab467c", + "x-ms-request-id": "2a2870c5-b01f-0034-6f0e-4a1661000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299282283600351/file159299282341904059", + "query": { + "position": "11", + "action": "flush" + }, + "requestBody": "", + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:23 GMT", + "etag": "\"0x8D818256A41F7EB\"", + "last-modified": "Wed, 24 Jun 2020 10:00:24 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "d4ec5275-19ce-40d0-9fa1-9f4b1e041184", + "x-ms-request-id": "2a2870e3-b01f-0034-0d0e-4a1661000000", + "x-ms-request-server-encrypted": "false", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282283600351/file159299282341904059", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:24 GMT", + "etag": "\"0x8D818256A41F7EB\"", + "last-modified": "Wed, 24 Jun 2020 10:00:24 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "1e8b9979-d442-4abc-8e68-457d76762fcc", + "x-ms-request-id": "7b6999bb-501e-0013-7e0e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282283600351/file159299282341904059", + "query": {}, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "accept-ranges": "bytes", + "content-length": "11", + "content-type": "text/plain;charset=UTF-8", + "date": "Wed, 24 Jun 2020 10:00:25 GMT", + "etag": "\"0x8D818256A41F7EB\"", + "last-modified": "Wed, 24 Jun 2020 10:00:24 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-access-tier": "Hot", + "x-ms-access-tier-inferred": "true", + "x-ms-blob-type": "BlockBlob", + "x-ms-client-request-id": "5cec842e-89ae-4692-9479-aa07735aab1f", + "x-ms-creation-time": "Wed, 24 Jun 2020 10:00:23 GMT", + "x-ms-expiry-time": "Wed, 24 Jun 2020 11:00:23 GMT", + "x-ms-lease-state": "available", + "x-ms-lease-status": "unlocked", + "x-ms-request-id": "7b6999de-501e-0013-1e0e-4a01a5000000", + "x-ms-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299282283600351", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:25 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "534826a1-815c-4e23-9c06-63eb04787cb3", + "x-ms-request-id": "7b699a01-501e-0013-3e0e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "filesystem": "filesystem159299282283600351", + "file": "file159299282341904059" + }, + "newDate": {} + }, + "hash": "201798d7335e3eb29b47567fb4b9c17c" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetonow.json b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetonow.json new file mode 100644 index 000000000000..792bb767fb1b --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/browsers/datalakepathclient/recording_set_expiry__relativetonow.json @@ -0,0 +1,149 @@ +{ + "recordings": [ + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299281555203886", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:16 GMT", + "etag": "\"0x8D81825658CF317\"", + "last-modified": "Wed, 24 Jun 2020 10:00:16 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "aef775b7-7512-4c5d-b230-181d79ac815b", + "x-ms-request-id": "7b699848-501e-0013-420e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299281555203886/file159299281729603669", + "query": { + "resource": "file" + }, + "requestBody": null, + "status": 201, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:17 GMT", + "etag": "\"0x8D8182566872C7E\"", + "last-modified": "Wed, 24 Jun 2020 10:00:18 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "89d244c1-145b-4006-b1f0-45fdaa0751c5", + "x-ms-request-id": "2a28708a-b01f-0034-350e-4a1661000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299281555203886/file159299281729603669", + "query": { + "position": "0", + "action": "append" + }, + "requestBody": "Hello World", + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:18 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "ee4d1524-bd5a-46e7-8152-57b887eab692", + "x-ms-request-id": "2a28708e-b01f-0034-390e-4a1661000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PATCH", + "url": "https://fakestorageaccount.dfs.core.windows.net/filesystem159299281555203886/file159299281729603669", + "query": { + "position": "11", + "action": "flush" + }, + "requestBody": "", + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:18 GMT", + "etag": "\"0x8D818256736A9F3\"", + "last-modified": "Wed, 24 Jun 2020 10:00:19 GMT", + "server": "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "9b2f0792-defb-4ba0-8087-af4c1fcdf6aa", + "x-ms-request-id": "2a287091-b01f-0034-3c0e-4a1661000000", + "x-ms-request-server-encrypted": "false", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "PUT", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299281555203886/file159299281729603669", + "query": { + "comp": "expiry" + }, + "requestBody": null, + "status": 200, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:19 GMT", + "etag": "\"0x8D818256736A9F3\"", + "last-modified": "Wed, 24 Jun 2020 10:00:19 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "a590a4c7-7459-4da1-bebb-67c7b4e7508a", + "x-ms-request-id": "7b6998b7-501e-0013-1c0e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "HEAD", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299281555203886/file159299281729603669", + "query": {}, + "requestBody": null, + "status": 404, + "response": "", + "responseHeaders": { + "date": "Wed, 24 Jun 2020 10:00:21 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "transfer-encoding": "chunked", + "x-ms-client-request-id": "af0a4934-6669-49d6-ac52-a77af454a844", + "x-ms-error-code": "BlobNotFound", + "x-ms-request-id": "7b6998f5-501e-0013-570e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + }, + { + "method": "DELETE", + "url": "https://fakestorageaccount.blob.core.windows.net/filesystem159299281555203886", + "query": { + "restype": "container" + }, + "requestBody": null, + "status": 202, + "response": "", + "responseHeaders": { + "content-length": "0", + "date": "Wed, 24 Jun 2020 10:00:21 GMT", + "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-client-request-id": "58a23de7-6823-457c-8aa6-1538b80b3749", + "x-ms-request-id": "7b699919-501e-0013-750e-4a01a5000000", + "x-ms-version": "2019-12-12" + } + } + ], + "uniqueTestInfo": { + "uniqueName": { + "filesystem": "filesystem159299281555203886", + "file": "file159299281729603669" + }, + "newDate": {} + }, + "hash": "c0da3264e322f03bf5b03f643ca889cf" +} \ No newline at end of file diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__absolute.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__absolute.js new file mode 100644 index 000000000000..369b3c507158 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__absolute.js @@ -0,0 +1,217 @@ +let nock = require('nock'); + +module.exports.hash = "8a1b0b455a3a37375eb859d0bb25954e"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem159239944055201355","file":"file159239944181407133"},"newDate":{"now":"2020-06-17T13:10:45.623Z"}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239944055201355') + .query(true) + .reply(201, "", [ + 'content-length', + '0', + 'last-modified', + 'Wed, 17 Jun 2020 13:10:41 GMT', + 'etag', + '"0x8D812BFD6512130"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'd9dce062-401e-0020-77a8-445e0e000000', + 'x-ms-client-request-id', + '27a0dbd3-f1cb-4426-92d3-0de7f27ea9a4', + 'x-ms-version', + '2019-12-12', + 'date', + 'Wed, 17 Jun 2020 13:10:41 GMT', + 'connection', + 'close' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239944055201355/file159239944181407133') + .query(true) + .reply(201, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:42 GMT', + 'etag', + '"0x8D812BFD71556C0"', + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '453afe2f-901f-0041-4ca8-447d4d000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '06d3f1ca-8245-4728-9597-ea2b89f84dbf', + 'date', + 'Wed, 17 Jun 2020 13:10:42 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159239944055201355/file159239944181407133', "Hello World") + .query(true) + .reply(202, "", [ + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + 'f1adc691-a01f-0007-45a8-4449ca000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '53534a54-ece4-4ae8-a466-7e91a46acedb', + 'date', + 'Wed, 17 Jun 2020 13:10:43 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159239944055201355/file159239944181407133') + .query(true) + .reply(200, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:45 GMT', + 'etag', + '"0x8D812BFD89A13E4"', + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + 'b452f2ea-801f-003f-25a8-44ed0a000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '57abdffc-9254-4c5e-81b3-4f7b627599fb', + 'date', + 'Wed, 17 Jun 2020 13:10:45 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239944055201355/file159239944181407133') + .query(true) + .reply(200, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:45 GMT', + 'etag', + '"0x8D812BFD89A13E4"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'c75f9e58-f01e-0068-3aa8-444339000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '8570dc7e-9b60-4f6c-82e4-377ab1f8890a', + 'date', + 'Wed, 17 Jun 2020 13:10:46 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159239944055201355/file159239944181407133') + .reply(200, "", [ + 'content-length', + '11', + 'content-type', + 'application/octet-stream', + 'last-modified', + 'Wed, 17 Jun 2020 13:10:45 GMT', + 'accept-ranges', + 'bytes', + 'etag', + '"0x8D812BFD89A13E4"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '8938495e-c01e-0011-14a8-44bf1d000000', + 'x-ms-client-request-id', + '0f678ca8-58d9-4c29-a33b-f334b9fae6d0', + 'x-ms-version', + '2019-12-12', + 'x-ms-creation-time', + 'Wed, 17 Jun 2020 13:10:42 GMT', + 'x-ms-expiry-time', + 'Wed, 17 Jun 2020 13:10:50 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'access-control-expose-headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-expiry-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'access-control-allow-origin', + '*', + 'date', + 'Wed, 17 Jun 2020 13:10:47 GMT', + 'connection', + 'close' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159239944055201355/file159239944181407133') + .reply(404, "", [ + 'transfer-encoding', + 'chunked', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'caa13950-b01e-0046-7ea8-44112e000000', + 'x-ms-client-request-id', + '9b445a9e-b65c-43fd-982f-84f71e349ee8', + 'x-ms-version', + '2019-12-12', + 'x-ms-error-code', + 'BlobNotFound', + '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', + 'Wed, 17 Jun 2020 13:10:53 GMT', + 'connection', + 'close' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem159239944055201355') + .query(true) + .reply(202, "", [ + 'content-length', + '0', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'c9c782f0-f01e-0025-3ba8-448cd5000000', + 'x-ms-client-request-id', + '26dd64d7-58b7-4487-b6b8-28ea539710cb', + 'x-ms-version', + '2019-12-12', + 'date', + 'Wed, 17 Jun 2020 13:10:55 GMT', + 'connection', + 'close' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__neverexpire.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__neverexpire.js new file mode 100644 index 000000000000..d07bfc57eb8d --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__neverexpire.js @@ -0,0 +1,190 @@ +let nock = require('nock'); + +module.exports.hash = "4a4fed79044d292913f1861b636c5f4a"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem159239943150501028","file":"file159239943296504342"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239943150501028') + .query(true) + .reply(201, "", [ + 'content-length', + '0', + 'last-modified', + 'Wed, 17 Jun 2020 13:10:32 GMT', + 'etag', + '"0x8D812BFD107142D"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '4a588ac5-c01e-005c-4ea8-4470f1000000', + 'x-ms-client-request-id', + '944452a5-b237-40bf-8b1c-7d2cbc4608e8', + 'x-ms-version', + '2019-12-12', + 'date', + 'Wed, 17 Jun 2020 13:10:31 GMT', + 'connection', + 'close' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239943150501028/file159239943296504342') + .query(true) + .reply(201, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:34 GMT', + 'etag', + '"0x8D812BFD1D625F7"', + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '727808fc-701f-0004-11a8-44a8ae000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '057a4301-1bb1-464c-b546-923313169e84', + 'date', + 'Wed, 17 Jun 2020 13:10:33 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159239943150501028/file159239943296504342', "Hello World") + .query(true) + .reply(202, "", [ + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + '23bb3cc3-801f-0010-42a8-44e0c1000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '702a8037-ec33-46b3-a726-b7d7609cf734', + 'date', + 'Wed, 17 Jun 2020 13:10:35 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159239943150501028/file159239943296504342') + .query(true) + .reply(200, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:36 GMT', + 'etag', + '"0x8D812BFD351E306"', + 'server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + '326cc5a0-601f-0045-34a8-44f04a000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '92cb20a5-bf65-4dfb-b06d-6c5eb91bf2ba', + 'date', + 'Wed, 17 Jun 2020 13:10:35 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159239943150501028/file159239943296504342') + .query(true) + .reply(200, "", [ + 'last-modified', + 'Wed, 17 Jun 2020 13:10:36 GMT', + 'etag', + '"0x8D812BFD351E306"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'b997c7b7-501e-003c-54a8-440c6e000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '3565e493-9d75-488b-a896-2b0b7dd28a4e', + 'date', + 'Wed, 17 Jun 2020 13:10:37 GMT', + 'connection', + 'close', + 'content-length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159239943150501028/file159239943296504342') + .reply(200, "", [ + 'content-length', + '11', + 'content-type', + 'application/octet-stream', + 'last-modified', + 'Wed, 17 Jun 2020 13:10:36 GMT', + 'accept-ranges', + 'bytes', + 'etag', + '"0x8D812BFD351E306"', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'a4226320-801e-003f-7aa8-44ed0a000000', + 'x-ms-client-request-id', + '3b1fdbb9-6c0a-47dc-ab91-8c247c686aca', + 'x-ms-version', + '2019-12-12', + 'x-ms-creation-time', + 'Wed, 17 Jun 2020 13:10:34 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'access-control-expose-headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'access-control-allow-origin', + '*', + 'date', + 'Wed, 17 Jun 2020 13:10:38 GMT', + 'connection', + 'close' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem159239943150501028') + .query(true) + .reply(202, "", [ + 'content-length', + '0', + 'server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + 'a0ab7cbe-201e-0036-08a8-44a8d9000000', + 'x-ms-client-request-id', + '9663c928-6d37-42f5-aeb4-8188214cb0da', + 'x-ms-version', + '2019-12-12', + 'date', + 'Wed, 17 Jun 2020 13:10:39 GMT', + 'connection', + 'close' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__override.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__override.js new file mode 100644 index 000000000000..e380cd71bac1 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__override.js @@ -0,0 +1,243 @@ +let nock = require('nock'); + +module.exports.hash = "49ae201267dbd16bc5c2949dfdee3daa"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem159299255423504608","file":"file159299255462704152"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255423504608') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'ETag', + '"0x8D81824C8FC84C9"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03b8d-a01e-0007-7a0d-4a49ca000000', + 'x-ms-client-request-id', + '8399bc23-b69d-46ad-b4ff-5b656ec741d2', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:53 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255423504608/file159299255462704152') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'ETag', + '"0x8D81824C93ABDDE"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '6f8e5650-501f-0003-790d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'adcc7919-125e-40d9-9909-47bdc889e0f7', + 'Date', + 'Wed, 24 Jun 2020 09:55:53 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299255423504608/file159299255462704152', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + '6f8e565e-501f-0003-070d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'e01417a4-e8a8-404c-9d3a-89b44b517fc8', + 'Date', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299255423504608/file159299255462704152') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'ETag', + '"0x8D81824C9C67EF8"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + '6f8e566c-501f-0003-130d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'dd4bb946-c11c-4652-b9ca-1dc2a54f644f', + 'Date', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255423504608/file159299255462704152') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'ETag', + '"0x8D81824C9C67EF8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03c15-a01e-0007-6a0d-4a49ca000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'fd6a7cd3-2b10-43ff-9f3d-d1240d306701', + 'Date', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159299255423504608/file159299255462704152') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8D81824C9C67EF8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03c41-a01e-0007-110d-4a49ca000000', + 'x-ms-client-request-id', + '5ea0a817-c9e0-4207-89d5-a3c6cda5de44', + 'x-ms-version', + '2019-12-12', + 'x-ms-creation-time', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'x-ms-expiry-time', + 'Wed, 24 Jun 2020 10:55:54 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-expiry-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Wed, 24 Jun 2020 09:55:56 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255423504608/file159299255462704152') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'ETag', + '"0x8D81824C9C67EF8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03c79-a01e-0007-450d-4a49ca000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '9e2e5751-679d-438b-8385-ca4642b86e2c', + 'Date', + 'Wed, 24 Jun 2020 09:55:56 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159299255423504608/file159299255462704152') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:55 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8D81824C9C67EF8"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03c96-a01e-0007-590d-4a49ca000000', + 'x-ms-client-request-id', + 'a07246d0-d412-4b73-b304-c966648ecb76', + 'x-ms-version', + '2019-12-12', + 'x-ms-creation-time', + 'Wed, 24 Jun 2020 09:55:54 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Wed, 24 Jun 2020 09:55:57 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem159299255423504608') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03cc6-a01e-0007-040d-4a49ca000000', + 'x-ms-client-request-id', + '2a8fb699-f327-427d-9825-d807836519b8', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:57 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetocreation.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetocreation.js new file mode 100644 index 000000000000..e865460d650f --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetocreation.js @@ -0,0 +1,178 @@ +let nock = require('nock'); + +module.exports.hash = "1b61a967d608c729ba89903bf69e5ff8"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem159299255097900923","file":"file159299255140603883"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255097900923') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:50 GMT', + 'ETag', + '"0x8D81824C70679AD"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03a72-a01e-0007-1c0d-4a49ca000000', + 'x-ms-client-request-id', + '87942801-834d-4d1f-8168-6b7e993594f0', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:50 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255097900923/file159299255140603883') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:51 GMT', + 'ETag', + '"0x8D81824C75D6C43"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '6f8e5601-501f-0003-2b0d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'caee113c-8d02-4cc7-833c-c4cbbf67e0ec', + 'Date', + 'Wed, 24 Jun 2020 09:55:50 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299255097900923/file159299255140603883', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + '6f8e5602-501f-0003-2c0d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '0a5cbc12-2ae2-4560-94b9-4719100e4629', + 'Date', + 'Wed, 24 Jun 2020 09:55:51 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299255097900923/file159299255140603883') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:52 GMT', + 'ETag', + '"0x8D81824C7DF53B3"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + '6f8e5603-501f-0003-2d0d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'ce07f92e-cc8f-438e-a833-a236bf4e6884', + 'Date', + 'Wed, 24 Jun 2020 09:55:51 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299255097900923/file159299255140603883') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:52 GMT', + 'ETag', + '"0x8D81824C7DF53B3"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03b36-a01e-0007-2e0d-4a49ca000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '51df929b-5e32-437d-9527-01dc9348ed23', + 'Date', + 'Wed, 24 Jun 2020 09:55:52 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159299255097900923/file159299255140603883') + .reply(200, "", [ + 'Content-Length', + '11', + 'Content-Type', + 'application/octet-stream', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:52 GMT', + 'Accept-Ranges', + 'bytes', + 'ETag', + '"0x8D81824C7DF53B3"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03b52-a01e-0007-460d-4a49ca000000', + 'x-ms-client-request-id', + '9b880212-c59d-4477-81f8-0d942e429cc9', + 'x-ms-version', + '2019-12-12', + 'x-ms-creation-time', + 'Wed, 24 Jun 2020 09:55:51 GMT', + 'x-ms-expiry-time', + 'Wed, 24 Jun 2020 10:55:51 GMT', + 'x-ms-lease-status', + 'unlocked', + 'x-ms-lease-state', + 'available', + 'x-ms-blob-type', + 'BlockBlob', + 'x-ms-server-encrypted', + 'true', + 'x-ms-access-tier', + 'Hot', + 'x-ms-access-tier-inferred', + 'true', + 'Access-Control-Expose-Headers', + 'x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-creation-time,x-ms-expiry-time,x-ms-lease-status,x-ms-lease-state,x-ms-blob-type,x-ms-server-encrypted,x-ms-access-tier,x-ms-access-tier-inferred,Accept-Ranges,Content-Length,Date,Transfer-Encoding', + 'Access-Control-Allow-Origin', + '*', + 'Date', + 'Wed, 24 Jun 2020 09:55:52 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem159299255097900923') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03b74-a01e-0007-640d-4a49ca000000', + 'x-ms-client-request-id', + 'c5ae678f-e7d5-4063-9dcb-ac65af589cdc', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:53 GMT' +]); diff --git a/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetonow.js b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetonow.js new file mode 100644 index 000000000000..cb1edc154d60 --- /dev/null +++ b/sdk/storage/storage-file-datalake/recordings/node/datalakepathclient/recording_set_expiry__relativetonow.js @@ -0,0 +1,156 @@ +let nock = require('nock'); + +module.exports.hash = "de1ed5242bebc0c085f969ddc1486386"; + +module.exports.testInfo = {"uniqueName":{"filesystem":"filesystem159299254439403398","file":"file159299254594100472"},"newDate":{}} + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299254439403398') + .query(true) + .reply(201, "", [ + 'Content-Length', + '0', + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:45 GMT', + 'ETag', + '"0x8D81824C3C7C8D7"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e038c9-a01e-0007-490d-4a49ca000000', + 'x-ms-client-request-id', + 'd5ee2979-c506-412f-93ae-75c0e7cf0024', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:45 GMT' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299254439403398/file159299254594100472') + .query(true) + .reply(201, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:47 GMT', + 'ETag', + '"0x8D81824C4B7A0DF"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '6f8e55b5-501f-0003-690d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '8ede6eeb-edc0-416e-a9c9-c7460d70a766', + 'Date', + 'Wed, 24 Jun 2020 09:55:46 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299254439403398/file159299254594100472', "Hello World") + .query(true) + .reply(202, "", [ + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'true', + 'x-ms-request-id', + '6f8e55bb-501f-0003-6f0d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '9c370921-6e24-4587-93bb-9fe701baa41e', + 'Date', + 'Wed, 24 Jun 2020 09:55:46 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.dfs.core.windows.net:443', {"encodedQueryParams":true}) + .patch('/filesystem159299254439403398/file159299254594100472') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:48 GMT', + 'ETag', + '"0x8D81824C5576AFC"', + 'Server', + 'Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-server-encrypted', + 'false', + 'x-ms-request-id', + '6f8e55c3-501f-0003-700d-4ac4cd000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + '7d6cab88-2231-487b-b040-b512fa3c0e7c', + 'Date', + 'Wed, 24 Jun 2020 09:55:47 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .put('/filesystem159299254439403398/file159299254594100472') + .query(true) + .reply(200, "", [ + 'Last-Modified', + 'Wed, 24 Jun 2020 09:55:48 GMT', + 'ETag', + '"0x8D81824C5576AFC"', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e039d8-a01e-0007-1f0d-4a49ca000000', + 'x-ms-version', + '2019-12-12', + 'x-ms-client-request-id', + 'a9331e1b-818a-41c7-b8cb-1f2e6355e02e', + 'Date', + 'Wed, 24 Jun 2020 09:55:48 GMT', + 'Content-Length', + '0' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .head('/filesystem159299254439403398/file159299254594100472') + .reply(404, "", [ + 'Transfer-Encoding', + 'chunked', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03a3a-a01e-0007-6f0d-4a49ca000000', + 'x-ms-client-request-id', + 'bd867b0d-504a-4d8f-bac4-6acf493f478a', + 'x-ms-version', + '2019-12-12', + 'x-ms-error-code', + 'BlobNotFound', + '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', + 'Wed, 24 Jun 2020 09:55:49 GMT' +]); + +nock('https://fakestorageaccount.blob.core.windows.net:443', {"encodedQueryParams":true}) + .delete('/filesystem159299254439403398') + .query(true) + .reply(202, "", [ + 'Content-Length', + '0', + 'Server', + 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0', + 'x-ms-request-id', + '00e03a5e-a01e-0007-0b0d-4a49ca000000', + 'x-ms-client-request-id', + 'f953a6a0-8863-4f31-823c-4cd1328dfa90', + 'x-ms-version', + '2019-12-12', + 'Date', + 'Wed, 24 Jun 2020 09:55:50 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 fa3d6f8f6054..9083828ef2e5 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 @@ -131,7 +131,7 @@ export type CredentialPolicyCreator = (nextPolicy: RequestPolicy, options: Reque // @public export class DataLakeDirectoryClient extends DataLakePathClient { - create(resourceType: PathResourceType, options?: PathCreateOptions): Promise; + create(resourceType: PathResourceTypeModel, options?: PathCreateOptions): Promise; create(options?: DirectoryCreateOptions): Promise; getFileClient(fileName: string): DataLakeFileClient; getSubdirectoryClient(subdirectoryName: string): DataLakeDirectoryClient; @@ -142,13 +142,14 @@ export class DataLakeFileClient extends DataLakePathClient { constructor(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions); constructor(url: string, pipeline: Pipeline); append(body: HttpRequestBody, offset: number, length: number, options?: FileAppendOptions): Promise; - create(resourceType: PathResourceType, options?: PathCreateOptions): Promise; + create(resourceType: PathResourceTypeModel, options?: PathCreateOptions): Promise; create(options?: FileCreateOptions): Promise; flush(position: number, options?: FileFlushOptions): Promise; read(offset?: number, count?: number, options?: FileReadOptions): Promise; readToBuffer(buffer: Buffer, offset?: number, count?: number, options?: FileReadToBufferOptions): Promise; readToBuffer(offset?: number, count?: number, options?: FileReadToBufferOptions): Promise; readToFile(filePath: string, offset?: number, count?: number, options?: FileReadOptions): Promise; + setExpiry(mode: FileExpiryMode, options?: FileSetExpiryOptions): Promise; upload(data: Buffer | Blob | ArrayBuffer | ArrayBufferView, options?: FileParallelUploadOptions): Promise; uploadFile(filePath: string, options?: FileParallelUploadOptions): Promise; uploadStream(stream: Readable, options?: FileParallelUploadOptions): Promise; @@ -197,7 +198,7 @@ export class DataLakeLeaseClient { export class DataLakePathClient extends StorageClient { constructor(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions); constructor(url: string, pipeline: Pipeline); - create(resourceType: PathResourceType, options?: PathCreateOptions): Promise; + create(resourceType: PathResourceTypeModel, options?: PathCreateOptions): Promise; delete(recursive?: boolean, options?: PathDeleteOptions): Promise; exists(options?: PathExistsOptions): Promise; get fileSystemName(): string; @@ -295,6 +296,9 @@ export interface FileCreateOptions extends PathCreateOptions { export interface FileCreateResponse extends PathCreateResponse { } +// @public +export type FileExpiryMode = 'NeverExpire' | 'RelativeToCreation' | 'RelativeToNow' | 'Absolute'; + // @public (undocumented) export interface FileFlushOptions extends CommonOptions { // (undocumented) @@ -421,6 +425,32 @@ export interface FileReadToBufferOptions extends CommonOptions { onProgress?: (progress: TransferProgressEvent) => void; } +// @public +export interface FileSetExpiryHeaders { + clientRequestId?: string; + date?: Date; + // (undocumented) + errorCode?: string; + etag?: string; + lastModified?: Date; + requestId?: string; + version?: string; +} + +// @public +export interface FileSetExpiryOptions extends CommonOptions { + abortSignal?: AbortSignalLike; + expiresOn?: Date; + timeToExpireInMs?: number; +} + +// @public +export type FileSetExpiryResponse = FileSetExpiryHeaders & { + _response: coreHttp.HttpResponse & { + parsedHeaders: FileSetExpiryHeaders; + }; +}; + // @public (undocumented) export interface FileSystemCreateHeaders { // (undocumented) @@ -979,6 +1009,9 @@ export enum PathGetPropertiesAction { GetStatus = "getStatus" } +// @public +export type PathGetPropertiesActionModel = 'getAccessControl' | 'getStatus'; + // @public (undocumented) export interface PathGetPropertiesHeaders { // (undocumented) @@ -1029,6 +1062,7 @@ export interface PathGetPropertiesHeaders { encryptionKeySha256?: string; // (undocumented) etag?: string; + expiresOn?: Date; // (undocumented) isIncrementalCopy?: boolean; // (undocumented) @@ -1195,6 +1229,9 @@ export enum PathRenameMode { Posix = "posix" } +// @public +export type PathRenameModeModel = 'legacy' | 'posix'; + // @public export enum PathResourceType { // (undocumented) @@ -1203,6 +1240,9 @@ export enum PathResourceType { File = "file" } +// @public +export type PathResourceTypeModel = 'directory' | 'file'; + // @public export interface PathSetAccessControlHeaders { clientRequestId?: string; diff --git a/sdk/storage/storage-file-datalake/src/StorageClient.ts b/sdk/storage/storage-file-datalake/src/StorageClient.ts index a1d557ebb0e7..0f7478a7acc8 100644 --- a/sdk/storage/storage-file-datalake/src/StorageClient.ts +++ b/sdk/storage/storage-file-datalake/src/StorageClient.ts @@ -63,6 +63,7 @@ export abstract class StorageClient { * @memberof StorageClient */ protected readonly pipeline: Pipeline; + /** * Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used. * @@ -70,6 +71,7 @@ export abstract class StorageClient { * @memberof StorageClient */ public readonly credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential; + /** * StorageClient is a reference to protocol layer operations entry, which is * generated by AutoRest generator. @@ -79,6 +81,17 @@ export abstract class StorageClient { * @memberof StorageClient */ protected readonly storageClientContext: StorageClientContext; + + /** + * storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is + * generated by AutoRest generator, with its url pointing to the Blob endpoint. + * + * @protected + * @type {StorageClientContext} + * @memberof StorageClient + */ + protected readonly storageClientContextToBlobEndpoint: StorageClientContext; + /** * @protected * @type {boolean} @@ -103,6 +116,10 @@ export abstract class StorageClient { this.dfsEndpointUrl, pipeline.toServiceClientOptions() ); + this.storageClientContextToBlobEndpoint = new StorageClientContext( + this.blobEndpointUrl, + pipeline.toServiceClientOptions() + ); this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); @@ -120,5 +137,7 @@ export abstract class StorageClient { // Override protocol layer's default content-type const storageClientContext = this.storageClientContext as any; storageClientContext.requestContentType = undefined; + const storageClientContextWithBlobEndpoint = this.storageClientContextToBlobEndpoint as any; + storageClientContextWithBlobEndpoint.requestContentType = undefined; } } diff --git a/sdk/storage/storage-file-datalake/src/clients.ts b/sdk/storage/storage-file-datalake/src/clients.ts index 5adbaaa0b7e4..47e4fc7d159f 100644 --- a/sdk/storage/storage-file-datalake/src/clients.ts +++ b/sdk/storage/storage-file-datalake/src/clients.ts @@ -31,15 +31,13 @@ import { PathExistsOptions, PathGetAccessControlOptions, PathGetAccessControlResponse, - PathGetPropertiesAction, PathGetPropertiesOptions, PathGetPropertiesResponse, PathHttpHeaders, PathMoveOptions, PathMoveResponse, PathPermissions, - PathRenameMode, - PathResourceType, + PathResourceTypeModel, PathSetAccessControlOptions, PathSetAccessControlResponse, PathSetHttpHeadersOptions, @@ -47,7 +45,10 @@ import { PathSetMetadataOptions, PathSetMetadataResponse, PathSetPermissionsOptions, - PathSetPermissionsResponse + PathSetPermissionsResponse, + FileExpiryMode, + FileSetExpiryOptions, + FileSetExpiryResponse } from "./models"; import { newPipeline, Pipeline, StoragePipelineOptions } from "./Pipeline"; import { StorageClient } from "./StorageClient"; @@ -212,13 +213,13 @@ export class DataLakePathClient extends StorageClient { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create * - * @param {PathResourceType} resourceType Resource type, "directory" or "file". + * @param {PathResourceTypeModel} resourceType Resource type, "directory" or "file". * @param {PathCreateOptions} [options={}] Optional. Options when creating path. * @returns {Promise} * @memberof DataLakePathClient */ public async create( - resourceType: PathResourceType, + resourceType: PathResourceTypeModel, options: PathCreateOptions = {} ): Promise { options.conditions = options.conditions || {}; @@ -335,7 +336,7 @@ export class DataLakePathClient extends StorageClient { ); try { const response = await this.pathContext.getProperties({ - action: PathGetPropertiesAction.GetAccessControl, + action: "getAccessControl", upn: options.userPrincipalName, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -611,7 +612,7 @@ export class DataLakePathClient extends StorageClient { try { return await destPathClient.pathContext.create({ - mode: PathRenameMode.Legacy, // By default + mode: "legacy", // By default renameSource, sourceLeaseId: options.conditions.leaseId, leaseAccessConditions: options.destinationConditions, @@ -650,13 +651,13 @@ export class DataLakeDirectoryClient extends DataLakePathClient { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create * - * @param {PathResourceType} resourceType Resource type, must be "directory" for DataLakeDirectoryClient. + * @param {PathResourceTypeModel} resourceType Resource type, must be "directory" for DataLakeDirectoryClient. * @param {PathCreateOptions} [options] Optional. Options when creating directory. * @returns {Promise} * @memberof DataLakeDirectoryClient */ public async create( - resourceType: PathResourceType, + resourceType: PathResourceTypeModel, options?: PathCreateOptions ): Promise; @@ -672,16 +673,16 @@ export class DataLakeDirectoryClient extends DataLakePathClient { public async create(options?: DirectoryCreateOptions): Promise; public async create( - resourceTypeOrOptions?: PathResourceType | PathCreateOptions, + resourceTypeOrOptions?: PathResourceTypeModel | PathCreateOptions, options: PathCreateOptions = {} ): Promise { - if (resourceTypeOrOptions === PathResourceType.Directory) { - return super.create(resourceTypeOrOptions as PathResourceType, options); + if (resourceTypeOrOptions === "directory") { + return super.create(resourceTypeOrOptions as PathResourceTypeModel, options); } - if (resourceTypeOrOptions === PathResourceType.File) { + if (resourceTypeOrOptions === "file") { throw TypeError( - `DataLakeDirectoryClient:create() resourceType cannot be ${PathResourceType.File}. Refer to DataLakeFileClient for file creation.` + `DataLakeDirectoryClient:create() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeFileClient for file creation.` ); } @@ -692,7 +693,7 @@ export class DataLakeDirectoryClient extends DataLakePathClient { options.tracingOptions ); try { - return await super.create(PathResourceType.Directory, { + return await super.create("directory", { ...options, tracingOptions: { ...options.tracingOptions, @@ -756,6 +757,15 @@ export class DataLakeFileClient extends DataLakePathClient { */ private pathContextInternal: PathOperations; + /** + * pathContextInternal provided by protocol layer, with its url pointing to the Blob endpoint. + * + * @private + * @type {PathOperations} + * @memberof DataLakeFileClient + */ + private pathContextInternalToBlobEndpoint: PathOperations; + /** * blobClientInternal provided by @azure/storage-blob package. * @@ -817,6 +827,9 @@ export class DataLakeFileClient extends DataLakePathClient { } this.pathContextInternal = new PathOperations(this.storageClientContext); + this.pathContextInternalToBlobEndpoint = new PathOperations( + this.storageClientContextToBlobEndpoint + ); this.blobClientInternal = new BlobClient(this.blobEndpointUrl, this.pipeline); } @@ -825,13 +838,13 @@ export class DataLakeFileClient extends DataLakePathClient { * * @see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create * - * @param {PathResourceType} resourceType Resource type, must be "file" for DataLakeFileClient. + * @param {PathResourceTypeModel} resourceType Resource type, must be "file" for DataLakeFileClient. * @param {PathCreateOptions} [options] Optional. Options when creating file. * @returns {Promise} * @memberof DataLakeFileClient */ public async create( - resourceType: PathResourceType, + resourceType: PathResourceTypeModel, options?: PathCreateOptions ): Promise; @@ -847,16 +860,16 @@ export class DataLakeFileClient extends DataLakePathClient { public async create(options?: FileCreateOptions): Promise; public async create( - resourceTypeOrOptions?: PathResourceType | PathCreateOptions, + resourceTypeOrOptions?: PathResourceTypeModel | PathCreateOptions, options: PathCreateOptions = {} ): Promise { - if (resourceTypeOrOptions === PathResourceType.File) { - return super.create(resourceTypeOrOptions as PathResourceType, options); + if (resourceTypeOrOptions === "file") { + return super.create(resourceTypeOrOptions as PathResourceTypeModel, options); } - if (resourceTypeOrOptions === PathResourceType.Directory) { + if (resourceTypeOrOptions === "directory") { throw TypeError( - `DataLakeFileClient:create() resourceType cannot be ${PathResourceType.Directory}. Refer to DataLakeDirectoryClient for directory creation.` + `DataLakeFileClient:create() resourceType cannot be ${resourceTypeOrOptions}. Refer to DataLakeDirectoryClient for directory creation.` ); } @@ -864,7 +877,7 @@ export class DataLakeFileClient extends DataLakePathClient { options.conditions = options.conditions || {}; const { span, spanOptions } = createSpan("DataLakeFileClient-create", options.tracingOptions); try { - return await super.create(PathResourceType.File, { + return await super.create("file", { ...options, tracingOptions: { ...options.tracingOptions, @@ -1228,7 +1241,7 @@ export class DataLakeFileClient extends DataLakePathClient { if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) { throw new RangeError( `The data's size is too big or the chunkSize is too small;` + - `the number of chunks must be <= ${BLOCK_BLOB_MAX_BLOCKS}` + `the number of chunks must be <= ${BLOCK_BLOB_MAX_BLOCKS}` ); } @@ -1509,4 +1522,59 @@ export class DataLakeFileClient extends DataLakePathClient { span.end(); } } + + /** + * Sets an expiry time on a file, once that time is met the file is deleted. + * + * @param {FileExpiryMode} mode + * @param {FileSetExpiryOptions} [options={}] + * @returns {Promise} + * @memberof DataLakeFileClient + */ + public async setExpiry( + mode: FileExpiryMode, + options: FileSetExpiryOptions = {} + ): Promise { + const { span, spanOptions } = createSpan( + "DataLakeFileClient-setExpiry", + options.tracingOptions + ); + try { + let expiresOn: string | undefined = undefined; + if (mode === "RelativeToNow" || mode === "RelativeToCreation") { + if (!options.timeToExpireInMs) { + throw new Error(`Should specify options.timeToExpireInMs when using mode ${mode}.`); + } + // MINOR: need check against <= 2**64, but JS number has the precision problem. + expiresOn = Math.round(options.timeToExpireInMs).toString(); + } + + if (mode === "Absolute") { + if (!options.expiresOn) { + throw new Error(`Should specify options.expiresOn when using mode ${mode}.`); + } + const now = new Date(); + if (!(options.expiresOn!.getTime() > now.getTime())) { + throw new Error( + `options.expiresOn should be later than now: ${now.toUTCString()} when using mode ${mode}, but is ${options.expiresOn?.toUTCString()}` + ); + } + expiresOn = options.expiresOn!.toUTCString(); + } + + const adaptedOptions = { ...options, expiresOn }; + return await this.pathContextInternalToBlobEndpoint.setExpiry(mode, { + ...adaptedOptions, + tracingOptions: { ...options.tracingOptions, spanOptions } + }); + } catch (e) { + span.setStatus({ + code: CanonicalCode.UNKNOWN, + message: e.message + }); + throw e; + } finally { + span.end(); + } + } } diff --git a/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts b/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts index 5befeea12216..c61a8ed49e58 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/models/index.ts @@ -1714,11 +1714,7 @@ export interface PathSetExpiryHeaders { * @readonly * @enum {string} */ -export enum PathSetAccessControlRecursiveMode { - Set = 'set', - Modify = 'modify', - Remove = 'remove', -} +export type PathSetAccessControlRecursiveMode = 'set' | 'modify' | 'remove'; /** * Defines values for PathExpiryOptions. @@ -1726,12 +1722,7 @@ export enum PathSetAccessControlRecursiveMode { * @readonly * @enum {string} */ -export enum PathExpiryOptions { - NeverExpire = 'NeverExpire', - RelativeToCreation = 'RelativeToCreation', - RelativeToNow = 'RelativeToNow', - Absolute = 'Absolute', -} +export type PathExpiryOptions = 'NeverExpire' | 'RelativeToCreation' | 'RelativeToNow' | 'Absolute'; /** * Defines values for PathResourceType. @@ -1739,10 +1730,7 @@ export enum PathExpiryOptions { * @readonly * @enum {string} */ -export enum PathResourceType { - Directory = 'directory', - File = 'file', -} +export type PathResourceType = 'directory' | 'file'; /** * Defines values for PathRenameMode. @@ -1750,10 +1738,7 @@ export enum PathResourceType { * @readonly * @enum {string} */ -export enum PathRenameMode { - Legacy = 'legacy', - Posix = 'posix', -} +export type PathRenameMode = 'legacy' | 'posix'; /** * Defines values for PathUpdateAction. @@ -1762,13 +1747,7 @@ export enum PathRenameMode { * @readonly * @enum {string} */ -export enum PathUpdateAction { - Append = 'append', - Flush = 'flush', - SetProperties = 'setProperties', - SetAccessControl = 'setAccessControl', - SetAccessControlRecursive = 'setAccessControlRecursive', -} +export type PathUpdateAction = 'append' | 'flush' | 'setProperties' | 'setAccessControl' | 'setAccessControlRecursive'; /** * Defines values for PathLeaseAction. @@ -1776,13 +1755,7 @@ export enum PathUpdateAction { * @readonly * @enum {string} */ -export enum PathLeaseAction { - Acquire = 'acquire', - Break = 'break', - Change = 'change', - Renew = 'renew', - Release = 'release', -} +export type PathLeaseAction = 'acquire' | 'break' | 'change' | 'renew' | 'release'; /** * Defines values for PathGetPropertiesAction. @@ -1790,10 +1763,7 @@ export enum PathLeaseAction { * @readonly * @enum {string} */ -export enum PathGetPropertiesAction { - GetAccessControl = 'getAccessControl', - GetStatus = 'getStatus', -} +export type PathGetPropertiesAction = 'getAccessControl' | 'getStatus'; /** * Contains response data for the listFileSystems operation. diff --git a/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts b/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts index 98968b17ea7d..e8457dddec57 100644 --- a/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts +++ b/sdk/storage/storage-file-datalake/src/generated/src/operations/pathOperations.ts @@ -72,11 +72,15 @@ export class PathOperations { * the owner, owning group, and others, so the x-ms-permissions and x-ms-acl request headers are * mutually exclusive. Possible values include: 'append', 'flush', 'setProperties', * 'setAccessControl', 'setAccessControlRecursive' + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param body Initial data * @param [options] The optional parameters * @returns Promise */ - update(action: Models.PathUpdateAction, body: coreHttp.HttpRequestBody, options?: Models.PathUpdateOptionalParams): Promise; + update(action: Models.PathUpdateAction, mode: Models.PathSetAccessControlRecursiveMode, body: coreHttp.HttpRequestBody, options?: Models.PathUpdateOptionalParams): Promise; /** * @param action The action must be "append" to upload data to be appended to a file, "flush" to * flush previously uploaded data to a file, "setProperties" to set the properties of a file or @@ -87,10 +91,14 @@ export class PathOperations { * the owner, owning group, and others, so the x-ms-permissions and x-ms-acl request headers are * mutually exclusive. Possible values include: 'append', 'flush', 'setProperties', * 'setAccessControl', 'setAccessControlRecursive' + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param body Initial data * @param callback The callback */ - update(action: Models.PathUpdateAction, body: coreHttp.HttpRequestBody, callback: coreHttp.ServiceCallback): void; + update(action: Models.PathUpdateAction, mode: Models.PathSetAccessControlRecursiveMode, body: coreHttp.HttpRequestBody, callback: coreHttp.ServiceCallback): void; /** * @param action The action must be "append" to upload data to be appended to a file, "flush" to * flush previously uploaded data to a file, "setProperties" to set the properties of a file or @@ -101,15 +109,20 @@ export class PathOperations { * the owner, owning group, and others, so the x-ms-permissions and x-ms-acl request headers are * mutually exclusive. Possible values include: 'append', 'flush', 'setProperties', * 'setAccessControl', 'setAccessControlRecursive' + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param body Initial data * @param options The optional parameters * @param callback The callback */ - update(action: Models.PathUpdateAction, body: coreHttp.HttpRequestBody, options: Models.PathUpdateOptionalParams, callback: coreHttp.ServiceCallback): void; - update(action: Models.PathUpdateAction, body: coreHttp.HttpRequestBody, options?: Models.PathUpdateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + update(action: Models.PathUpdateAction, mode: Models.PathSetAccessControlRecursiveMode, body: coreHttp.HttpRequestBody, options: Models.PathUpdateOptionalParams, callback: coreHttp.ServiceCallback): void; + update(action: Models.PathUpdateAction, mode: Models.PathSetAccessControlRecursiveMode, body: coreHttp.HttpRequestBody, options?: Models.PathUpdateOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { action, + mode, body, options }, @@ -286,22 +299,35 @@ export class PathOperations { /** * Set the access control list for a path and subpaths. + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param [options] The optional parameters * @returns Promise */ - setAccessControlRecursive(options?: Models.PathSetAccessControlRecursiveOptionalParams): Promise; + setAccessControlRecursive(mode: Models.PathSetAccessControlRecursiveMode, options?: Models.PathSetAccessControlRecursiveOptionalParams): Promise; /** + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param callback The callback */ - setAccessControlRecursive(callback: coreHttp.ServiceCallback): void; + setAccessControlRecursive(mode: Models.PathSetAccessControlRecursiveMode, callback: coreHttp.ServiceCallback): void; /** + * @param mode Mode "set" sets POSIX access control rights on files and directories, "modify" + * modifies one or more POSIX access control rights that pre-exist on files and directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files and + * directories. Possible values include: 'set', 'modify', 'remove' * @param options The optional parameters * @param callback The callback */ - setAccessControlRecursive(options: Models.PathSetAccessControlRecursiveOptionalParams, callback: coreHttp.ServiceCallback): void; - setAccessControlRecursive(options?: Models.PathSetAccessControlRecursiveOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { + setAccessControlRecursive(mode: Models.PathSetAccessControlRecursiveMode, options: Models.PathSetAccessControlRecursiveOptionalParams, callback: coreHttp.ServiceCallback): void; + setAccessControlRecursive(mode: Models.PathSetAccessControlRecursiveMode, options?: Models.PathSetAccessControlRecursiveOptionalParams | coreHttp.ServiceCallback, callback?: coreHttp.ServiceCallback): Promise { return this.client.sendOperationRequest( { + mode, options }, setAccessControlRecursiveOperationSpec, diff --git a/sdk/storage/storage-file-datalake/src/models.ts b/sdk/storage/storage-file-datalake/src/models.ts index 92183357423c..49c1a179c003 100644 --- a/sdk/storage/storage-file-datalake/src/models.ts +++ b/sdk/storage/storage-file-datalake/src/models.ts @@ -37,15 +37,18 @@ export { PathSetAccessControlHeaders, PathSetAccessControlResponse, PathSetAccessControlResponse as PathSetPermissionsResponse, - PathResourceType, + PathResourceType as PathResourceTypeModel, PathUpdateHeaders, PathAppendDataHeaders, PathFlushDataHeaders, PathAppendDataResponse as FileAppendResponse, PathFlushDataResponse as FileFlushResponse, PathFlushDataResponse as FileUploadResponse, - PathGetPropertiesAction, - PathRenameMode + PathGetPropertiesAction as PathGetPropertiesActionModel, + PathRenameMode as PathRenameModeModel, + PathExpiryOptions as FileExpiryMode, + PathSetExpiryResponse as FileSetExpiryResponse, + PathSetExpiryHeaders as FileSetExpiryHeaders } from "./generated/src/models"; export { PathCreateResponse }; @@ -262,12 +265,12 @@ export interface SignedIdentifier { export type FileSystemGetAccessPolicyResponse = { signedIdentifiers: SignedIdentifier[]; } & FileSystemGetAccessPolicyHeaders & { - _response: HttpResponse & { - parsedHeaders: FileSystemGetAccessPolicyHeaders; - bodyAsText: string; - parsedBody: SignedIdentifier[]; + _response: HttpResponse & { + parsedHeaders: FileSystemGetAccessPolicyHeaders; + bodyAsText: string; + parsedBody: SignedIdentifier[]; + }; }; -}; export interface FileSystemSetAccessPolicyOptions extends CommonOptions { abortSignal?: AbortSignalLike; @@ -354,7 +357,7 @@ export interface Metadata { export interface DataLakeRequestConditions extends ModifiedAccessConditions, - LeaseAccessConditions { } + LeaseAccessConditions {} export interface RolePermissions { read: boolean; @@ -488,6 +491,11 @@ export interface PathGetPropertiesHeaders { accessTierInferred?: boolean; archiveStatus?: string; accessTierChangedOn?: Date; + + /** + * The time the file will expire. + */ + expiresOn?: Date; } export type PathGetPropertiesResponse = PathGetPropertiesHeaders & { @@ -589,13 +597,45 @@ export interface PathExistsOptions extends CommonOptions { // customerProvidedKey?: CpkInfo; not supported yet } +// Keeping these for backward compatibility when we changed to use string unions. +/** + * Defines values for PathGetPropertiesAction. + * Possible values include: 'getAccessControl', 'getStatus' + * @readonly + * @enum {string} + */ +export enum PathGetPropertiesAction { + GetAccessControl = "getAccessControl", + GetStatus = "getStatus" +} +/** + * Defines values for PathRenameMode. + * Possible values include: 'legacy', 'posix' + * @readonly + * @enum {string} + */ +export enum PathRenameMode { + Legacy = "legacy", + Posix = "posix" +} +/** + * Defines values for PathResourceType. + * Possible values include: 'directory', 'file' + * @readonly + * @enum {string} + */ +export enum PathResourceType { + Directory = "directory", + File = "file" +} + /****************************************************************/ /** DataLakeDirectoryClient option and response related models **/ /****************************************************************/ -export interface DirectoryCreateOptions extends PathCreateOptions { } +export interface DirectoryCreateOptions extends PathCreateOptions {} -export interface DirectoryCreateResponse extends PathCreateResponse { } +export interface DirectoryCreateResponse extends PathCreateResponse {} /***********************************************************/ /** DataLakeFileClient option and response related models **/ @@ -667,9 +707,9 @@ export interface FileFlushOptions extends CommonOptions { pathHttpHeaders?: PathHttpHeaders; } -export interface FileCreateOptions extends PathCreateOptions { } +export interface FileCreateOptions extends PathCreateOptions {} -export interface FileCreateResponse extends PathCreateResponse { } +export interface FileCreateResponse extends PathCreateResponse {} /** * Option interface for Data Lake file - Upload operations @@ -858,6 +898,40 @@ export interface FileReadToBufferOptions extends CommonOptions { concurrency?: number; } +/** + * Option interface for the {@link DataLakeFileClient.setExpiry} operation. + * + * @export + * @interface FileSetExpiryOptions + */ +export interface FileSetExpiryOptions 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 FileSetExpiryOptions + */ + abortSignal?: AbortSignalLike; + + /** + * The time to set the file to expire on, used in combination with the "Absolute" {@link FileExpiryMode}. + * A time in the past is not allowed and milliseconds will be dropped. + * + * @type {Date} + * @memberof FileSetExpiryOptions + */ + expiresOn?: Date; + + /** + * The number of milliseconds to elapse before the file expires, used in combination with the "RelativeToCreation" or "RelativeToNow" {@link FileExpiryMode}. + * + * @type {number} + * @memberof FileSetExpiryOptions + */ + timeToExpireInMs?: number; +} + /***********************************************************/ /** DataLakeLeaseClient option and response related models */ /***********************************************************/ diff --git a/sdk/storage/storage-file-datalake/swagger/README.md b/sdk/storage/storage-file-datalake/swagger/README.md index b991f690b2b5..d185aa6bf4f9 100644 --- a/sdk/storage/storage-file-datalake/swagger/README.md +++ b/sdk/storage/storage-file-datalake/swagger/README.md @@ -15,7 +15,6 @@ output-folder: ../src/generated input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/storage-dataplane-preview/specification/storage/data-plane/Microsoft.StorageDataLake/stable/2019-12-12/DataLakeStorage.json model-date-time-as-string: true optional-response-headers: true -enum-types: true ``` ## Customizations for Track 2 Generator @@ -93,6 +92,7 @@ directive: ``` ### Rename eTag -> etag + ``` yaml directive: - from: swagger-document @@ -104,3 +104,13 @@ directive: transform: > $["x-ms-client-name"] = "etag"; ``` + +### workaround: adding parameter location for `PathSetAccessControlRecursiveMode` + +``` yaml +directive: +- from: swagger-document + where: $["parameters"].PathSetAccessControlRecursiveMode + transform: > + $["x-ms-parameter-location"] = "method"; +``` diff --git a/sdk/storage/storage-file-datalake/test/pathclient.spec.ts b/sdk/storage/storage-file-datalake/test/pathclient.spec.ts index 0fbc917c0b8f..68d5ecc0c046 100644 --- a/sdk/storage/storage-file-datalake/test/pathclient.spec.ts +++ b/sdk/storage/storage-file-datalake/test/pathclient.spec.ts @@ -1,5 +1,5 @@ import { AbortController } from "@azure/abort-controller"; -import { isNode, URLBuilder } from "@azure/core-http"; +import { isNode, URLBuilder, delay } from "@azure/core-http"; import { setTracer, SpanGraph, TestTracer } from "@azure/core-tracing"; import { record } from "@azure/test-utils-recorder"; import * as assert from "assert"; @@ -332,4 +332,52 @@ describe("DataLakePathClient", () => { const dirResult = await newDirectoryClient.exists(); assert.ok(dirResult === false, "exists() should return false for a non-existing directory"); }); + + it("set expiry - NeverExpire", async () => { + await fileClient.setExpiry("NeverExpire"); + const getRes = await fileClient.getProperties(); + assert.equal(getRes.expiresOn, undefined); + }); + + it("set expiry - Absolute", async () => { + const now = recorder.newDate("now"); + const delta = 5 * 1000; + const expiresOn = new Date(now.getTime() + delta); + await fileClient.setExpiry("Absolute", { expiresOn }); + + const getRes = await fileClient.getProperties(); + expiresOn.setMilliseconds(0); // milliseconds dropped + assert.equal(getRes.expiresOn?.getTime(), expiresOn.getTime()); + + await delay(delta); + assert.ok(!(await fileClient.exists())); + }); + + it("set expiry - RelativeToNow", async () => { + const delta = 1000; + await fileClient.setExpiry("RelativeToNow", { timeToExpireInMs: delta }); + + await delay(delta); + assert.ok(!(await fileClient.exists())); + }); + + it("set expiry - RelativeToCreation", async () => { + const delta = 1000 * 3600 + 0.12; + await fileClient.setExpiry("RelativeToCreation", { timeToExpireInMs: delta }); + + const getRes = await fileClient.getProperties(); + assert.equal(getRes.expiresOn?.getTime(), getRes.createdOn!.getTime() + Math.round(delta)); + }); + + it("set expiry - override", async () => { + const delta = 1000 * 3600; + await fileClient.setExpiry("RelativeToCreation", { timeToExpireInMs: delta }); + + const getRes = await fileClient.getProperties(); + assert.equal(getRes.expiresOn?.getTime(), getRes.createdOn!.getTime() + delta); + + await fileClient.setExpiry("NeverExpire"); + const getRes2 = await fileClient.getProperties(); + assert.equal(getRes2.expiresOn, undefined); + }); });