diff --git a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md index 2ddf9004dd4c..72f58aff8167 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md +++ b/sdk/storage/Azure.Storage.Files.Shares/CHANGELOG.md @@ -1,7 +1,7 @@ # Release History ## 12.5.0-preview.2 (Unreleased) -- Fixed bug where ShareDirectoryClient.Exists() and ShareFileClient.Exists() would thrown an exception when the directory or file's parent directory didn't exist. +- Fixed bug where ShareDirectoryClient.Exists(), .DeleteIfExists() and ShareFileClient.Exists(), .DeleteIfExists() would thrown an exception when the directory or file's parent directory didn't exist. - Renamed ShareClient.SetTier() -> ShareClient.SetProperties(). SetProperties() can be used to set both Share Tier and Share Quota. - Changed ShareDeleteOptions.IncludeSnapshots -> .ShareSnapshotsDeleteOption, and added option to also delete Share Snapshots that have been leased. - Added additional info to exception messages. diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs index d493a4dd9d82..88ef8ea7d503 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareDirectoryClient.cs @@ -912,7 +912,8 @@ internal async Task> DeleteIfExistsInternal( } catch (RequestFailedException storageRequestFailedException) when (storageRequestFailedException.ErrorCode == ShareErrorCode.ResourceNotFound - || storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound) + || storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound + || storageRequestFailedException.ErrorCode == ShareErrorCode.ParentNotFound) { return Response.FromValue(false, default); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs index f130038fc886..8273a440a13a 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/src/ShareFileClient.cs @@ -928,7 +928,8 @@ private async Task> DeleteIfExistsInternal( } catch (RequestFailedException storageRequestFailedException) when (storageRequestFailedException.ErrorCode == ShareErrorCode.ResourceNotFound - || storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound) + || storageRequestFailedException.ErrorCode == ShareErrorCode.ShareNotFound + || storageRequestFailedException.ErrorCode == ShareErrorCode.ParentNotFound) { return Response.FromValue(false, default); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs index 634992a27399..d41efba04d0f 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/DirectoryClientTests.cs @@ -434,6 +434,21 @@ public async Task DeleteIfExists_ShareNotExists() Assert.IsFalse(response.Value); } + [Test] + public async Task DeleteIfExists_ParentDirectoryNotExists() + { + // Arrange + await using DisposingShare test = await GetTestShareAsync(); + ShareDirectoryClient parentDirectory = InstrumentClient(test.Share.GetDirectoryClient(GetNewDirectoryName())); + ShareDirectoryClient directory = InstrumentClient(parentDirectory.GetSubdirectoryClient(GetNewDirectoryName())); + + // Act + Response response = await directory.DeleteIfExistsAsync(); + + // Assert + Assert.IsFalse(response.Value); + } + [Test] public async Task DeleteIfExists_Error() { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index e5a97de6ffb3..08a7cd60c982 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -502,6 +502,21 @@ public async Task DeleteIfExistsAsync_ShareNotExists() Assert.IsFalse(response.Value); } + [Test] + public async Task DeleteIfExistsAsync_ParentDirectoryNotExists() + { + // Arrange + await using DisposingShare test = await GetTestShareAsync(); + ShareDirectoryClient parentDirectory = InstrumentClient(test.Share.GetDirectoryClient(GetNewDirectoryName())); + ShareFileClient file = InstrumentClient(parentDirectory.GetFileClient(GetNewFileName())); + + // Act + Response response = await file.DeleteIfExistsAsync(); + + // Assert + Assert.IsFalse(response.Value); + } + [Test] public async Task DeleteIfExistsAsync_Error() { diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExists.json b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExists.json new file mode 100644 index 000000000000..ef51d14d8f17 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExists.json @@ -0,0 +1,107 @@ +{ + "Entries": [ + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-ebe46350-9190-c19d-9c0c-56585ad275f9?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-20c379e32b4c4c43851ff22551df3e53-555c240f94a61b42-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "eacb19a5-8dfd-0096-b41a-aefd4b170eab", + "x-ms-date": "Wed, 28 Oct 2020 15:35:04 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:04 GMT", + "ETag": "\u00220x8D87B570B0EACDE\u0022", + "Last-Modified": "Wed, 28 Oct 2020 15:35:05 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "eacb19a5-8dfd-0096-b41a-aefd4b170eab", + "x-ms-request-id": "1a0788b8-401a-0035-283f-adb6d6000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-ebe46350-9190-c19d-9c0c-56585ad275f9/test-directory-c0a6d24b-e7c1-c42e-02ca-16b268f47597/test-directory-40b2a4d6-8a06-5afc-f747-8c42dd63cdbc?restype=directory", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-a8fb319c359d5640a6f566e712137144-e10315ad7e595241-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "a72717a5-ce64-c0a4-d64b-c8795bece79e", + "x-ms-date": "Wed, 28 Oct 2020 15:35:04 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Length": "224", + "Content-Type": "application/xml", + "Date": "Wed, 28 Oct 2020 15:35:04 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "a72717a5-ce64-c0a4-d64b-c8795bece79e", + "x-ms-error-code": "ParentNotFound", + "x-ms-request-id": "1a0788bf-401a-0035-2a3f-adb6d6000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EParentNotFound\u003C/Code\u003E\u003CMessage\u003EThe specified parent path does not exist.\n", + "RequestId:1a0788bf-401a-0035-2a3f-adb6d6000000\n", + "Time:2020-10-28T15:35:05.1808234Z\u003C/Message\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-ebe46350-9190-c19d-9c0c-56585ad275f9?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-36f4152eb91a1a4d854f8e95b33d2011-f57744c4b7b27b42-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c69dccaf-253c-0058-d99c-a312ac7662fe", + "x-ms-date": "Wed, 28 Oct 2020 15:35:04 GMT", + "x-ms-delete-snapshots": "include", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:04 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "c69dccaf-253c-0058-d99c-a312ac7662fe", + "x-ms-request-id": "1a0788c2-401a-0035-2b3f-adb6d6000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1786645322", + "Storage_TestConfigDefault": "ProductionTenant\nseanmcccanary3\nU2FuaXRpemVk\nhttps://seanmcccanary3.blob.core.windows.net\nhttps://seanmcccanary3.file.core.windows.net\nhttps://seanmcccanary3.queue.core.windows.net\nhttps://seanmcccanary3.table.core.windows.net\n\n\n\n\nhttps://seanmcccanary3-secondary.blob.core.windows.net\nhttps://seanmcccanary3-secondary.file.core.windows.net\nhttps://seanmcccanary3-secondary.queue.core.windows.net\nhttps://seanmcccanary3-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://seanmcccanary3.blob.core.windows.net/;QueueEndpoint=https://seanmcccanary3.queue.core.windows.net/;FileEndpoint=https://seanmcccanary3.file.core.windows.net/;BlobSecondaryEndpoint=https://seanmcccanary3-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=https://seanmcccanary3-secondary.queue.core.windows.net/;FileSecondaryEndpoint=https://seanmcccanary3-secondary.file.core.windows.net/;AccountName=seanmcccanary3;AccountKey=Kg==;\nseanscope1" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExistsAsync.json b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExistsAsync.json new file mode 100644 index 000000000000..0d16286d87fa --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/DirectoryClientTests/DeleteIfExists_ParentDirectoryNotExistsAsync.json @@ -0,0 +1,107 @@ +{ + "Entries": [ + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6c321630-1e60-4c33-e717-4023a5e31018?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-032ec43e8395e146ad69dda427732c7a-b1e312f9d071cc4d-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "603c63a3-61fb-fe0d-1de6-436a91a345d0", + "x-ms-date": "Wed, 28 Oct 2020 15:35:04 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:05 GMT", + "ETag": "\u00220x8D87B570B577C7F\u0022", + "Last-Modified": "Wed, 28 Oct 2020 15:35:05 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "603c63a3-61fb-fe0d-1de6-436a91a345d0", + "x-ms-request-id": "524646b9-901a-007b-113f-ad985e000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6c321630-1e60-4c33-e717-4023a5e31018/test-directory-cc67a6f4-9e53-d1a4-39cd-30c43c989a6f/test-directory-427fcca3-b0a7-1d1c-7ffc-a38e1b73d398?restype=directory", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-2312af43f8f26e428dfcedd5cf3e754d-a6242ba8c99bbd47-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "c4c6d44b-0324-4329-8a49-4d56fb15b6c6", + "x-ms-date": "Wed, 28 Oct 2020 15:35:05 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Length": "224", + "Content-Type": "application/xml", + "Date": "Wed, 28 Oct 2020 15:35:05 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "c4c6d44b-0324-4329-8a49-4d56fb15b6c6", + "x-ms-error-code": "ParentNotFound", + "x-ms-request-id": "524646bd-901a-007b-133f-ad985e000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EParentNotFound\u003C/Code\u003E\u003CMessage\u003EThe specified parent path does not exist.\n", + "RequestId:524646bd-901a-007b-133f-ad985e000000\n", + "Time:2020-10-28T15:35:05.7380542Z\u003C/Message\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6c321630-1e60-4c33-e717-4023a5e31018?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-6fb66ccc9ceb1d48bf211c45956abfbf-dbd08c2295c17745-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "47421d3a-0fac-5373-e763-80c75aca0aa9", + "x-ms-date": "Wed, 28 Oct 2020 15:35:05 GMT", + "x-ms-delete-snapshots": "include", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:05 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "47421d3a-0fac-5373-e763-80c75aca0aa9", + "x-ms-request-id": "524646be-901a-007b-143f-ad985e000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1260112129", + "Storage_TestConfigDefault": "ProductionTenant\nseanmcccanary3\nU2FuaXRpemVk\nhttps://seanmcccanary3.blob.core.windows.net\nhttps://seanmcccanary3.file.core.windows.net\nhttps://seanmcccanary3.queue.core.windows.net\nhttps://seanmcccanary3.table.core.windows.net\n\n\n\n\nhttps://seanmcccanary3-secondary.blob.core.windows.net\nhttps://seanmcccanary3-secondary.file.core.windows.net\nhttps://seanmcccanary3-secondary.queue.core.windows.net\nhttps://seanmcccanary3-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://seanmcccanary3.blob.core.windows.net/;QueueEndpoint=https://seanmcccanary3.queue.core.windows.net/;FileEndpoint=https://seanmcccanary3.file.core.windows.net/;BlobSecondaryEndpoint=https://seanmcccanary3-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=https://seanmcccanary3-secondary.queue.core.windows.net/;FileSecondaryEndpoint=https://seanmcccanary3-secondary.file.core.windows.net/;AccountName=seanmcccanary3;AccountKey=Kg==;\nseanscope1" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExists.json b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExists.json new file mode 100644 index 000000000000..5568ebd35f4c --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExists.json @@ -0,0 +1,107 @@ +{ + "Entries": [ + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6f7ab139-d80e-4fe4-c413-d0b44667be7a?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-b2c1b95008e47a4bb71d297017d9b308-a39e7124f8b8ec4b-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "55302f5f-43b5-efea-1576-349d7071a4a0", + "x-ms-date": "Wed, 28 Oct 2020 15:35:19 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "ETag": "\u00220x8D87B571451B159\u0022", + "Last-Modified": "Wed, 28 Oct 2020 15:35:20 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "55302f5f-43b5-efea-1576-349d7071a4a0", + "x-ms-request-id": "6fbca95c-b01a-0031-103f-ad3bd1000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6f7ab139-d80e-4fe4-c413-d0b44667be7a/test-directory-7b31f658-97b2-44f8-0bf6-b38db785cf63/test-file-16554ec2-6937-f5c5-dbc9-fceac008144a", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-6fdb907a113b394abcc22ecba32fb9d8-7119eaba29ca5a4a-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "21dbd1a6-8d1c-ef69-303b-9fe89b0e8403", + "x-ms-date": "Wed, 28 Oct 2020 15:35:20 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Length": "224", + "Content-Type": "application/xml", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "21dbd1a6-8d1c-ef69-303b-9fe89b0e8403", + "x-ms-error-code": "ParentNotFound", + "x-ms-request-id": "6fbca95f-b01a-0031-113f-ad3bd1000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EParentNotFound\u003C/Code\u003E\u003CMessage\u003EThe specified parent path does not exist.\n", + "RequestId:6fbca95f-b01a-0031-113f-ad3bd1000000\n", + "Time:2020-10-28T15:35:20.7655550Z\u003C/Message\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-6f7ab139-d80e-4fe4-c413-d0b44667be7a?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-b6284b710525a64ca1c20d84a428ef69-ebd87669c0cbf34f-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "ee436d92-f32c-4d2d-1717-58f336e62c27", + "x-ms-date": "Wed, 28 Oct 2020 15:35:20 GMT", + "x-ms-delete-snapshots": "include", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "ee436d92-f32c-4d2d-1717-58f336e62c27", + "x-ms-request-id": "6fbca961-b01a-0031-133f-ad3bd1000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1586809711", + "Storage_TestConfigDefault": "ProductionTenant\nseanmcccanary3\nU2FuaXRpemVk\nhttps://seanmcccanary3.blob.core.windows.net\nhttps://seanmcccanary3.file.core.windows.net\nhttps://seanmcccanary3.queue.core.windows.net\nhttps://seanmcccanary3.table.core.windows.net\n\n\n\n\nhttps://seanmcccanary3-secondary.blob.core.windows.net\nhttps://seanmcccanary3-secondary.file.core.windows.net\nhttps://seanmcccanary3-secondary.queue.core.windows.net\nhttps://seanmcccanary3-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://seanmcccanary3.blob.core.windows.net/;QueueEndpoint=https://seanmcccanary3.queue.core.windows.net/;FileEndpoint=https://seanmcccanary3.file.core.windows.net/;BlobSecondaryEndpoint=https://seanmcccanary3-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=https://seanmcccanary3-secondary.queue.core.windows.net/;FileSecondaryEndpoint=https://seanmcccanary3-secondary.file.core.windows.net/;AccountName=seanmcccanary3;AccountKey=Kg==;\nseanscope1" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExistsAsync.json b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExistsAsync.json new file mode 100644 index 000000000000..5caabc369345 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/SessionRecords/FileClientTests/DeleteIfExistsAsync_ParentDirectoryNotExistsAsync.json @@ -0,0 +1,107 @@ +{ + "Entries": [ + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-d072a6cb-6c44-a464-f77a-0e2f27a6fae7?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-955f17eb034bb647a4f09deab62d61d6-a0ab51ba91d2324b-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "9de4cd51-bc86-a144-ed77-1e5908960421", + "x-ms-date": "Wed, 28 Oct 2020 15:35:20 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "ETag": "\u00220x8D87B5714A03195\u0022", + "Last-Modified": "Wed, 28 Oct 2020 15:35:21 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "9de4cd51-bc86-a144-ed77-1e5908960421", + "x-ms-request-id": "6550ff04-801a-003a-4d3f-adc0ba000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-d072a6cb-6c44-a464-f77a-0e2f27a6fae7/test-directory-219173ad-b0fc-0c79-d425-f3cd7a3fbce5/test-file-5ade8f89-5cc1-6f61-2335-c4fda1794446", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-f24ba0a9acc5c847a021052144cddf8b-f39e4b8564eedc42-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "79cf38bb-aab7-505f-1222-fec7ec7b6a5a", + "x-ms-date": "Wed, 28 Oct 2020 15:35:20 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Content-Length": "224", + "Content-Type": "application/xml", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "79cf38bb-aab7-505f-1222-fec7ec7b6a5a", + "x-ms-error-code": "ParentNotFound", + "x-ms-request-id": "6550ff07-801a-003a-4e3f-adc0ba000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EParentNotFound\u003C/Code\u003E\u003CMessage\u003EThe specified parent path does not exist.\n", + "RequestId:6550ff07-801a-003a-4e3f-adc0ba000000\n", + "Time:2020-10-28T15:35:21.3280535Z\u003C/Message\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "https://seanmcccanary3.file.core.windows.net/test-share-d072a6cb-6c44-a464-f77a-0e2f27a6fae7?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-0705e5e003c52945ab96d746ff4bce70-079ecda91c7b0c40-00", + "User-Agent": [ + "azsdk-net-Storage.Files.Shares/12.5.0-alpha.20201028.1", + "(.NET Core 4.6.29220.03; Microsoft Windows 10.0.19042 )" + ], + "x-ms-client-request-id": "6942150e-cbaa-c98f-7127-615dd0bbb4d9", + "x-ms-date": "Wed, 28 Oct 2020 15:35:20 GMT", + "x-ms-delete-snapshots": "include", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2020-02-10" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 28 Oct 2020 15:35:20 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "6942150e-cbaa-c98f-7127-615dd0bbb4d9", + "x-ms-request-id": "6550ff09-801a-003a-4f3f-adc0ba000000", + "x-ms-version": "2020-02-10" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1832232949", + "Storage_TestConfigDefault": "ProductionTenant\nseanmcccanary3\nU2FuaXRpemVk\nhttps://seanmcccanary3.blob.core.windows.net\nhttps://seanmcccanary3.file.core.windows.net\nhttps://seanmcccanary3.queue.core.windows.net\nhttps://seanmcccanary3.table.core.windows.net\n\n\n\n\nhttps://seanmcccanary3-secondary.blob.core.windows.net\nhttps://seanmcccanary3-secondary.file.core.windows.net\nhttps://seanmcccanary3-secondary.queue.core.windows.net\nhttps://seanmcccanary3-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://seanmcccanary3.blob.core.windows.net/;QueueEndpoint=https://seanmcccanary3.queue.core.windows.net/;FileEndpoint=https://seanmcccanary3.file.core.windows.net/;BlobSecondaryEndpoint=https://seanmcccanary3-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=https://seanmcccanary3-secondary.queue.core.windows.net/;FileSecondaryEndpoint=https://seanmcccanary3-secondary.file.core.windows.net/;AccountName=seanmcccanary3;AccountKey=Kg==;\nseanscope1" + } +} \ No newline at end of file