diff --git a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md index 8175f8b8e4cb..a0bbdb0ac76d 100644 --- a/sdk/storage/azure-storage-file-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-datalake/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log azure-storage-file-datalake -## Version XXXX-X-X-beta.X (XXXX-XX-XX) +## Version XX.X.X-beta.X (XXXX-XX-XX) +- Added SAS generation methods on clients to improve discoverability and convenience of sas. +- Mapped StorageErrorException and BlobStorageException to DataLakeStorageException. - Added support for exists method on FileClients and DirectoryClients ## Version 12.0.0-beta.7 (2019-12-04) diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java index b79e14b636ca..bf6b985a94e7 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java @@ -15,6 +15,7 @@ import com.azure.storage.file.datalake.implementation.models.LeaseAccessConditions; import com.azure.storage.file.datalake.implementation.models.ModifiedAccessConditions; import com.azure.storage.file.datalake.implementation.models.PathResourceType; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.DownloadRetryOptions; import com.azure.storage.file.datalake.models.FileRange; @@ -328,7 +329,8 @@ public Mono readWithResponse(FileRange range, DownloadRet try { return blockBlobAsyncClient.downloadWithResponse(Transforms.toBlobRange(range), Transforms.toBlobDownloadRetryOptions(options), Transforms.toBlobRequestConditions(requestConditions), - getRangeContentMd5).map(Transforms::toFileReadAsyncResponse); + getRangeContentMd5).map(Transforms::toFileReadAsyncResponse) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } catch (RuntimeException ex) { return monoError(logger, ex); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java index e8520efbba9f..4452f5c9e439 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java @@ -12,6 +12,7 @@ import com.azure.storage.blob.specialized.BlockBlobClient; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.StorageImplUtils; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.DownloadRetryOptions; import com.azure.storage.file.datalake.models.FileRange; @@ -276,10 +277,12 @@ public void read(OutputStream stream) { */ public FileReadResponse readWithResponse(OutputStream stream, FileRange range, DownloadRetryOptions options, DataLakeRequestConditions requestConditions, boolean getRangeContentMd5, Duration timeout, Context context) { - BlobDownloadResponse response = blockBlobClient.downloadWithResponse(stream, Transforms.toBlobRange(range), - Transforms.toBlobDownloadRetryOptions(options), Transforms.toBlobRequestConditions(requestConditions), - getRangeContentMd5, timeout, context); - return Transforms.toFileReadResponse(response); + return DataLakeImplUtils.returnOrConvertException(() -> { + BlobDownloadResponse response = blockBlobClient.downloadWithResponse(stream, Transforms.toBlobRange(range), + Transforms.toBlobDownloadRetryOptions(options), Transforms.toBlobRequestConditions(requestConditions), + getRangeContentMd5, timeout, context); + return Transforms.toFileReadResponse(response); + }, logger); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java index 03085cd85008..770d699f8cb3 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemAsyncClient.java @@ -22,6 +22,7 @@ import com.azure.storage.file.datalake.implementation.DataLakeStorageClientImpl; import com.azure.storage.file.datalake.implementation.models.FileSystemsListPathsResponse; import com.azure.storage.file.datalake.implementation.models.Path; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.DataLakeSignedIdentifier; import com.azure.storage.file.datalake.models.FileSystemAccessPolicies; @@ -241,7 +242,8 @@ public Mono create() { */ public Mono> createWithResponse(Map metadata, PublicAccessType accessType) { try { - return blobContainerAsyncClient.createWithResponse(metadata, Transforms.toBlobPublicAccessType(accessType)); + return blobContainerAsyncClient.createWithResponse(metadata, Transforms.toBlobPublicAccessType(accessType)) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -283,7 +285,8 @@ public Mono delete() { public Mono> deleteWithResponse(DataLakeRequestConditions requestConditions) { try { return blobContainerAsyncClient.deleteWithResponse( - Transforms.toBlobRequestConditions(requestConditions)); + Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -322,6 +325,7 @@ public Mono getProperties() { public Mono> getPropertiesWithResponse(String leaseId) { try { return blobContainerAsyncClient.getPropertiesWithResponse(leaseId) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException) .map(response -> new SimpleResponse<>(response, Transforms.toFileSystemProperties(response.getValue()))); } catch (RuntimeException ex) { @@ -368,7 +372,8 @@ public Mono> setMetadataWithResponse(Map metadata DataLakeRequestConditions requestConditions) { try { return blobContainerAsyncClient.setMetadataWithResponse(metadata, - Transforms.toBlobRequestConditions(requestConditions)); + Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -664,7 +669,8 @@ public Mono> setAccessPolicyWithResponse(PublicAccessType accessT List identifiers, DataLakeRequestConditions requestConditions) { try { return blobContainerAsyncClient.setAccessPolicyWithResponse(Transforms.toBlobPublicAccessType(accessType), - Transforms.toBlobIdentifierList(identifiers), Transforms.toBlobRequestConditions(requestConditions)); + Transforms.toBlobIdentifierList(identifiers), Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -704,6 +710,7 @@ public Mono getAccessPolicy() { public Mono> getAccessPolicyWithResponse(String leaseId) { try { return blobContainerAsyncClient.getAccessPolicyWithResponse(leaseId) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException) .map(response -> new SimpleResponse<>(response, Transforms.toFileSystemAccessPolicies(response.getValue()))); } catch (RuntimeException ex) { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java index 42a4c478c66f..5ccc74d9870d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileSystemClient.java @@ -14,6 +14,7 @@ import com.azure.storage.blob.models.BlobContainerAccessPolicies; import com.azure.storage.blob.models.BlobContainerProperties; import com.azure.storage.common.StorageSharedKeyCredential; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.DataLakeSignedIdentifier; import com.azure.storage.file.datalake.models.FileSystemAccessPolicies; @@ -195,8 +196,9 @@ public void create() { */ public Response createWithResponse(Map metadata, PublicAccessType accessType, Duration timeout, Context context) { - return blobContainerClient.createWithResponse(metadata, Transforms.toBlobPublicAccessType(accessType), timeout, - context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobContainerClient.createWithResponse(metadata, Transforms.toBlobPublicAccessType(accessType), timeout, + context), logger); } /** @@ -228,8 +230,9 @@ public void delete() { */ public Response deleteWithResponse(DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - return blobContainerClient.deleteWithResponse(Transforms.toBlobRequestConditions(requestConditions), - timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobContainerClient.deleteWithResponse(Transforms.toBlobRequestConditions(requestConditions), timeout, + context), logger); } /** @@ -260,9 +263,11 @@ public FileSystemProperties getProperties() { * @return A response containing the file system properties. */ public Response getPropertiesWithResponse(String leaseId, Duration timeout, Context context) { - Response response = blobContainerClient.getPropertiesWithResponse(leaseId, timeout, - context); - return new SimpleResponse<>(response, Transforms.toFileSystemProperties(response.getValue())); + return DataLakeImplUtils.returnOrConvertException(() -> { + Response response = blobContainerClient.getPropertiesWithResponse(leaseId, timeout, + context); + return new SimpleResponse<>(response, Transforms.toFileSystemProperties(response.getValue())); + }, logger); } /** @@ -294,8 +299,9 @@ public void setMetadata(Map metadata) { */ public Response setMetadataWithResponse(Map metadata, DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - return blobContainerClient.setMetadataWithResponse(metadata, - Transforms.toBlobRequestConditions(requestConditions), timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobContainerClient.setMetadataWithResponse(metadata, Transforms.toBlobRequestConditions(requestConditions), + timeout, context), logger); } /** @@ -523,9 +529,11 @@ public FileSystemAccessPolicies getAccessPolicy() { */ public Response getAccessPolicyWithResponse(String leaseId, Duration timeout, Context context) { - Response response = blobContainerClient.getAccessPolicyWithResponse(leaseId, - timeout, context); - return new SimpleResponse<>(response, Transforms.toFileSystemAccessPolicies(response.getValue())); + return DataLakeImplUtils.returnOrConvertException(() -> { + Response response = blobContainerClient.getAccessPolicyWithResponse(leaseId, + timeout, context); + return new SimpleResponse<>(response, Transforms.toFileSystemAccessPolicies(response.getValue())); + }, logger); } /** @@ -575,10 +583,11 @@ public void setAccessPolicy(PublicAccessType accessType, List setAccessPolicyWithResponse(PublicAccessType accessType, List identifiers, DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - return blobContainerClient + return DataLakeImplUtils.returnOrConvertException(() -> + blobContainerClient .setAccessPolicyWithResponse(Transforms.toBlobPublicAccessType(accessType), Transforms.toBlobIdentifierList(identifiers), Transforms.toBlobRequestConditions(requestConditions), - timeout, context); + timeout, context), logger); } BlobContainerClient getBlobContainerClient() { diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java index 170a668daac5..424477b18b62 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java @@ -13,6 +13,7 @@ import com.azure.storage.blob.BlobContainerAsyncClient; import com.azure.storage.blob.BlobServiceVersion; import com.azure.storage.blob.BlobUrlParts; +import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.specialized.BlockBlobAsyncClient; import com.azure.storage.blob.specialized.SpecializedBlobClientBuilder; import com.azure.storage.common.StorageSharedKeyCredential; @@ -324,7 +325,8 @@ public Mono> setMetadataWithResponse(Map metadata DataLakeRequestConditions requestConditions) { try { return this.blockBlobAsyncClient.setMetadataWithResponse(metadata, - Transforms.toBlobRequestConditions(requestConditions)); + Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(ex -> DataLakeImplUtils.transformBlobStorageException((BlobStorageException) ex)); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -371,7 +373,8 @@ public Mono> setHttpHeadersWithResponse(PathHttpHeaders headers, DataLakeRequestConditions requestConditions) { try { return this.blockBlobAsyncClient.setHttpHeadersWithResponse(Transforms.toBlobHttpHeaders(headers), - Transforms.toBlobRequestConditions(requestConditions)); + Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(ex -> DataLakeImplUtils.transformBlobStorageException((BlobStorageException) ex)); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -413,6 +416,7 @@ public Mono getProperties() { public Mono> getPropertiesWithResponse(DataLakeRequestConditions requestConditions) { try { return blockBlobAsyncClient.getPropertiesWithResponse(Transforms.toBlobRequestConditions(requestConditions)) + .onErrorMap(ex -> DataLakeImplUtils.transformBlobStorageException((BlobStorageException) ex)) .map(response -> new SimpleResponse<>(response, Transforms.toPathProperties(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java index 1558b5df55dc..6fa13a5db864 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathClient.java @@ -16,6 +16,7 @@ import com.azure.storage.file.datalake.implementation.models.ModifiedAccessConditions; import com.azure.storage.file.datalake.implementation.models.PathRenameMode; import com.azure.storage.file.datalake.implementation.models.SourceModifiedAccessConditions; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.PathAccessControl; import com.azure.storage.file.datalake.models.PathAccessControlEntry; @@ -192,8 +193,9 @@ public void setMetadata(Map metadata) { */ public Response setMetadataWithResponse(Map metadata, DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - return blockBlobClient.setMetadataWithResponse(metadata, Transforms.toBlobRequestConditions(requestConditions), - timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blockBlobClient.setMetadataWithResponse(metadata, Transforms.toBlobRequestConditions(requestConditions), + timeout, context), logger); } /** @@ -232,8 +234,9 @@ public void setHttpHeaders(PathHttpHeaders headers) { */ public Response setHttpHeadersWithResponse(PathHttpHeaders headers, DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - return blockBlobClient.setHttpHeadersWithResponse(Transforms.toBlobHttpHeaders(headers), - Transforms.toBlobRequestConditions(requestConditions), timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blockBlobClient.setHttpHeadersWithResponse(Transforms.toBlobHttpHeaders(headers), + Transforms.toBlobRequestConditions(requestConditions), timeout, context), logger); } /** @@ -400,9 +403,11 @@ public PathProperties getProperties() { */ public Response getPropertiesWithResponse(DataLakeRequestConditions requestConditions, Duration timeout, Context context) { - Response response = blockBlobClient.getPropertiesWithResponse( - Transforms.toBlobRequestConditions(requestConditions), timeout, context); - return new SimpleResponse<>(response, Transforms.toPathProperties(response.getValue())); + return DataLakeImplUtils.returnOrConvertException(() -> { + Response response = blockBlobClient.getPropertiesWithResponse( + Transforms.toBlobRequestConditions(requestConditions), timeout, context); + return new SimpleResponse<>(response, Transforms.toPathProperties(response.getValue())); + }, logger); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceAsyncClient.java index 0ec038cdeacf..368128ba73a5 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceAsyncClient.java @@ -19,6 +19,7 @@ import com.azure.storage.common.sas.AccountSasSignatureValues; import com.azure.storage.file.datalake.implementation.DataLakeStorageClientBuilder; import com.azure.storage.file.datalake.implementation.DataLakeStorageClientImpl; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.FileSystemItem; import com.azure.storage.file.datalake.models.ListFileSystemsOptions; @@ -256,6 +257,7 @@ public PagedFlux listFileSystems() { public PagedFlux listFileSystems(ListFileSystemsOptions options) { try { return blobServiceAsyncClient.listBlobContainers(Transforms.toListBlobContainersOptions(options)) +// .onErrorMap(ex -> DataLakeImplUtils.transformBlobStorageException((BlobStorageException) ex)) .mapPage(Transforms::toFileSystemItem); } catch (RuntimeException ex) { return pagedFluxError(logger, ex); @@ -278,8 +280,7 @@ public PagedFlux listFileSystems(ListFileSystemsOptions options) */ public Mono getUserDelegationKey(OffsetDateTime start, OffsetDateTime expiry) { try { - return blobServiceAsyncClient.getUserDelegationKey(start, expiry) - .map(Transforms::toDataLakeUserDelegationKey); + return this.getUserDelegationKeyWithResponse(start, expiry).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } @@ -303,7 +304,9 @@ public Mono getUserDelegationKey(OffsetDateTime start, Offset public Mono> getUserDelegationKeyWithResponse(OffsetDateTime start, OffsetDateTime expiry) { try { - return blobServiceAsyncClient.getUserDelegationKeyWithResponse(start, expiry).map(response -> + return blobServiceAsyncClient.getUserDelegationKeyWithResponse(start, expiry) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException) + .map(response -> new SimpleResponse<>(response, Transforms.toDataLakeUserDelegationKey(response.getValue()))); } catch (RuntimeException ex) { return monoError(logger, ex); diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClient.java index e07192712210..d47cd330051d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceClient.java @@ -10,9 +10,11 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.BlobServiceClient; import com.azure.storage.common.StorageSharedKeyCredential; import com.azure.storage.common.sas.AccountSasSignatureValues; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import com.azure.storage.file.datalake.models.DataLakeRequestConditions; import com.azure.storage.file.datalake.models.FileSystemItem; import com.azure.storage.file.datalake.models.ListFileSystemsOptions; @@ -23,6 +25,7 @@ import java.time.OffsetDateTime; import java.util.Map; + /** * Client to a storage account. It may only be instantiated through a {@link DataLakeServiceClientBuilder}. This class * does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate @@ -37,6 +40,7 @@ @ServiceClient(builder = DataLakeServiceClientBuilder.class) public class DataLakeServiceClient { + private final ClientLogger logger = new ClientLogger(DataLakeServiceClient.class); private final DataLakeServiceAsyncClient dataLakeServiceAsyncClient; private final BlobServiceClient blobServiceClient; @@ -169,7 +173,6 @@ public String getAccountUrl() { return dataLakeServiceAsyncClient.getAccountUrl(); } - // TODO (gapra) : Change return type /** * Returns a lazy loaded list of file systems in this account. The returned {@link PagedIterable} can be consumed * while new items are automatically retrieved as needed. For more information, see the listFileSystems() { * @return The list of file systems. */ public PagedIterable listFileSystems(ListFileSystemsOptions options, Duration timeout) { - return blobServiceClient.listBlobContainers(Transforms.toListBlobContainersOptions(options), timeout) - .mapPage(Transforms::toFileSystemItem); + return DataLakeImplUtils.returnOrConvertException(() -> + blobServiceClient.listBlobContainers(Transforms.toListBlobContainersOptions(options), timeout) + .mapPage(Transforms::toFileSystemItem), logger); } /** @@ -235,9 +239,11 @@ public UserDelegationKey getUserDelegationKey(OffsetDateTime start, OffsetDateTi */ public Response getUserDelegationKeyWithResponse(OffsetDateTime start, OffsetDateTime expiry, Duration timeout, Context context) { - Response response = blobServiceClient - .getUserDelegationKeyWithResponse(start, expiry, timeout, context); - return new SimpleResponse<>(response, Transforms.toDataLakeUserDelegationKey(response.getValue())); + return DataLakeImplUtils.returnOrConvertException(() -> { + Response response = blobServiceClient + .getUserDelegationKeyWithResponse(start, expiry, timeout, context); + return new SimpleResponse<>(response, Transforms.toDataLakeUserDelegationKey(response.getValue())); + }, logger); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java index 8a66210bf0e5..d1c9e3872e88 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/FileSystemsImpl.java @@ -28,7 +28,7 @@ import com.azure.storage.file.datalake.implementation.models.FileSystemsListPathsResponse; import com.azure.storage.file.datalake.implementation.models.FileSystemsSetPropertiesResponse; import com.azure.storage.file.datalake.implementation.models.ModifiedAccessConditions; -import com.azure.storage.file.datalake.implementation.models.StorageErrorException; +import com.azure.storage.file.datalake.models.DataLakeStorageException; import java.time.OffsetDateTime; import reactor.core.publisher.Mono; @@ -67,27 +67,27 @@ public FileSystemsImpl(DataLakeStorageClientImpl client) { private interface FileSystemsService { @Put("{filesystem}") @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono create(@HostParam("url") String url, @HeaderParam("x-ms-properties") String properties, @QueryParam("resource") String resource, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, Context context); @Patch("{filesystem}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono setProperties(@HostParam("url") String url, @HeaderParam("x-ms-properties") String properties, @QueryParam("resource") String resource, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Head("{filesystem}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono getProperties(@HostParam("url") String url, @QueryParam("resource") String resource, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, Context context); @Delete("{filesystem}") @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono delete(@HostParam("url") String url, @QueryParam("resource") String resource, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Get("{filesystem}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono listPaths(@PathParam("filesystem") String fileSystem, @HostParam("url") String url, @QueryParam("continuation") String continuation, @QueryParam("directory") String path, @QueryParam("recursive") boolean recursive, @QueryParam("maxResults") Integer maxResults, @QueryParam("upn") Boolean upn, @QueryParam("resource") String resource, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, Context context); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java index 3001733b72c4..4b53a710a16d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/PathsImpl.java @@ -42,7 +42,7 @@ import com.azure.storage.file.datalake.implementation.models.PathsUpdateResponse; import com.azure.storage.file.datalake.implementation.models.PathUpdateAction; import com.azure.storage.file.datalake.implementation.models.SourceModifiedAccessConditions; -import com.azure.storage.file.datalake.implementation.models.StorageErrorException; +import com.azure.storage.file.datalake.models.DataLakeStorageException; import com.azure.storage.file.datalake.models.PathHttpHeaders; import java.nio.ByteBuffer; import java.time.OffsetDateTime; @@ -83,47 +83,47 @@ public PathsImpl(DataLakeStorageClientImpl client) { private interface PathsService { @Put("{filesystem}/{path}") @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono create(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("resource") PathResourceType resource, @QueryParam("continuation") String continuation, @QueryParam("mode") PathRenameMode mode, @HeaderParam("x-ms-rename-source") String renameSource, @HeaderParam("x-ms-source-lease-id") String sourceLeaseId, @HeaderParam("x-ms-properties") String properties, @HeaderParam("x-ms-permissions") String permissions, @HeaderParam("x-ms-umask") String umask, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, @HeaderParam("x-ms-source-if-match") String sourceIfMatch, @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch, @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince, @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince, Context context); @Patch("{filesystem}/{path}") @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono update(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("action") PathUpdateAction action, @QueryParam("position") Long position, @QueryParam("retainUncommittedData") Boolean retainUncommittedData, @QueryParam("close") Boolean close, @HeaderParam("Content-Length") Long contentLength, @HeaderParam("x-ms-properties") String properties, @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, @HeaderParam("x-ms-permissions") String permissions, @HeaderParam("x-ms-acl") String acl, @BodyParam("application/octet-stream") Flux body, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-content-md5") String contentMd5, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Post("{filesystem}/{path}") @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono lease(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @HeaderParam("x-ms-lease-action") PathLeaseAction xMsLeaseAction, @HeaderParam("x-ms-lease-duration") Integer xMsLeaseDuration, @HeaderParam("x-ms-lease-break-period") Integer xMsLeaseBreakPeriod, @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Get("{filesystem}/{path}") @ExpectedResponses({200, 206}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono read(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @HeaderParam("Range") String range, @HeaderParam("x-ms-range-get-content-md5") Boolean xMsRangeGetContentMd5, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Head("{filesystem}/{path}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono getProperties(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("action") PathGetPropertiesAction action, @QueryParam("upn") Boolean upn, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Delete("{filesystem}/{path}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono delete(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("recursive") Boolean recursive, @QueryParam("continuation") String continuation, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Patch("{filesystem}/{path}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono setAccessControl(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-owner") String owner, @HeaderParam("x-ms-group") String group, @HeaderParam("x-ms-permissions") String permissions, @HeaderParam("x-ms-acl") String acl, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-version") String version, @QueryParam("action") String action, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Patch("{filesystem}/{path}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono flushData(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @QueryParam("position") Long position, @QueryParam("retainUncommittedData") Boolean retainUncommittedData, @QueryParam("close") Boolean close, @HeaderParam("Content-Length") Long contentLength, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-version") String version, @QueryParam("action") String action, @HeaderParam("x-ms-content-md5") String contentMd5, @HeaderParam("x-ms-cache-control") String cacheControl, @HeaderParam("x-ms-content-type") String contentType, @HeaderParam("x-ms-content-disposition") String contentDisposition, @HeaderParam("x-ms-content-encoding") String contentEncoding, @HeaderParam("x-ms-content-language") String contentLanguage, @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, Context context); @Patch("{filesystem}/{path}") @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono appendData(@PathParam("filesystem") String fileSystem, @PathParam("path") String path1, @HostParam("url") String url, @QueryParam("position") Long position, @QueryParam("timeout") Integer timeout, @HeaderParam("Content-Length") Long contentLength, @BodyParam("application/octet-stream") Flux body, @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-version") String version, @QueryParam("action") String action, @HeaderParam("Content-MD5") String transactionalContentHash, @HeaderParam("x-ms-lease-id") String leaseId, Context context); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java index 52076dba2570..895f4b05bc55 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/ServicesImpl.java @@ -17,7 +17,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Context; import com.azure.storage.file.datalake.implementation.models.ServicesListFileSystemsResponse; -import com.azure.storage.file.datalake.implementation.models.StorageErrorException; +import com.azure.storage.file.datalake.models.DataLakeStorageException; import reactor.core.publisher.Mono; /** @@ -55,7 +55,7 @@ public ServicesImpl(DataLakeStorageClientImpl client) { private interface ServicesService { @Get("") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(StorageErrorException.class) + @UnexpectedResponseExceptionType(DataLakeStorageException.class) Mono listFileSystems(@HostParam("url") String url, @QueryParam("resource") String resource, @QueryParam("prefix") String prefix, @QueryParam("continuation") String continuation, @QueryParam("maxResults") Integer maxResults, @HeaderParam("x-ms-client-request-id") String requestId, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-version") String version, Context context); } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java index de20b93e20b8..78a2deb5776a 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/DataLakeImplUtils.java @@ -3,6 +3,12 @@ package com.azure.storage.file.datalake.implementation.util; +import com.azure.core.util.logging.ClientLogger; +import com.azure.storage.blob.models.BlobStorageException; +import com.azure.storage.file.datalake.models.DataLakeStorageException; + +import java.util.function.Supplier; + public class DataLakeImplUtils { public static String endpointToDesiredEndpoint(String endpoint, String desiredEndpoint, String currentEndpoint) { // Add the . on either side to prevent overwriting an endpoint if a user provides a @@ -14,4 +20,22 @@ public static String endpointToDesiredEndpoint(String endpoint, String desiredEn return endpoint.replaceFirst(currentStringToMatch, desiredStringToMatch); } } + + public static Throwable transformBlobStorageException(Throwable ex) { + if (!(ex instanceof BlobStorageException)) { + return ex; + } else { + BlobStorageException exception = (BlobStorageException) ex; + return new DataLakeStorageException(exception.getServiceMessage(), exception.getResponse(), + exception.getValue()); + } + } + + public static T returnOrConvertException(Supplier supplier, ClientLogger logger) { + try { + return supplier.get(); + } catch (BlobStorageException ex) { + throw logger.logExceptionAsError((RuntimeException) transformBlobStorageException(ex)); + } + } } diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java new file mode 100644 index 000000000000..7e25617397e7 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/models/DataLakeStorageException.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.file.datalake.models; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpResponse; + +import static com.azure.storage.common.implementation.Constants.HeaderConstants.ERROR_CODE; + +/** + * A {@code DataLakeStorageException} is thrown whenever Azure Storage successfully returns an error code that is not + * 200-level. Users can inspect the status code and error code to determine the cause of the error response. The + * exception message may also contain more detailed information depending on the type of error. The user may also + * inspect the raw HTTP response or call toString to get the full payload of the error response if present. Note that + * even some expected "errors" will be thrown as a {@code DataLakeStorageException}. For example, some users may perform + * a getProperties request on an entity to determine whether it exists or not. If it does not exists, an exception will + * be thrown even though this may be considered an expected indication of absence in this case. + * + *

Sample Code

+ *

For more samples, please see the sample + * file

+ */ +public final class DataLakeStorageException extends HttpResponseException { + /** + * Constructs a {@code DataLakeStorageException}. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the error code of the exception. + */ + public DataLakeStorageException(String message, HttpResponse response, Object value) { + super(message, response, value); + } + + /** + * @return The error code returned by the service. + */ + public String getErrorCode() { + return super.getResponse().getHeaders().getValue(ERROR_CODE); + } + + /** + * @return The message returned by the service. + */ + public String getServiceMessage() { + return super.getMessage(); + } + + /** + * @return The status code on the response. + */ + public int getStatusCode() { + return super.getResponse().getStatusCode(); + } +} diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseAsyncClient.java index f60f69701eac..ea60fd28199d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseAsyncClient.java @@ -13,6 +13,7 @@ import com.azure.storage.file.datalake.DataLakeDirectoryAsyncClient; import com.azure.storage.file.datalake.DataLakeFileAsyncClient; import com.azure.storage.file.datalake.DataLakeFileSystemAsyncClient; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import reactor.core.publisher.Mono; import java.net.URL; @@ -101,7 +102,8 @@ public Mono acquireLease(int duration) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions) { - return this.blobLeaseAsyncClient.acquireLeaseWithResponse(duration, modifiedRequestConditions); + return this.blobLeaseAsyncClient.acquireLeaseWithResponse(duration, modifiedRequestConditions) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } /** @@ -132,7 +134,8 @@ public Mono renewLease() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> renewLeaseWithResponse(RequestConditions modifiedRequestConditions) { - return blobLeaseAsyncClient.renewLeaseWithResponse(modifiedRequestConditions); + return blobLeaseAsyncClient.renewLeaseWithResponse(modifiedRequestConditions) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } /** @@ -163,7 +166,8 @@ public Mono releaseLease() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> releaseLeaseWithResponse(RequestConditions modifiedRequestConditions) { - return blobLeaseAsyncClient.releaseLeaseWithResponse(modifiedRequestConditions); + return blobLeaseAsyncClient.releaseLeaseWithResponse(modifiedRequestConditions) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } /** @@ -202,7 +206,8 @@ public Mono breakLease() { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> breakLeaseWithResponse(Integer breakPeriodInSeconds, RequestConditions modifiedRequestConditions) { - return blobLeaseAsyncClient.breakLeaseWithResponse(breakPeriodInSeconds, modifiedRequestConditions); + return blobLeaseAsyncClient.breakLeaseWithResponse(breakPeriodInSeconds, modifiedRequestConditions) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } /** @@ -236,7 +241,8 @@ public Mono changeLease(String proposedId) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> changeLeaseWithResponse(String proposedId, RequestConditions modifiedRequestConditions) { - return blobLeaseAsyncClient.changeLeaseWithResponse(proposedId, modifiedRequestConditions); + return blobLeaseAsyncClient.changeLeaseWithResponse(proposedId, modifiedRequestConditions) + .onErrorMap(DataLakeImplUtils::transformBlobStorageException); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseClient.java index 37f9d3a41cc8..8260a13c91bc 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/specialized/DataLakeLeaseClient.java @@ -9,9 +9,11 @@ import com.azure.core.http.RequestConditions; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; import com.azure.storage.blob.specialized.BlobLeaseClient; import com.azure.storage.file.datalake.DataLakeFileSystemClient; import com.azure.storage.file.datalake.DataLakePathClient; +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils; import java.net.URL; import java.time.Duration; @@ -39,6 +41,8 @@ */ @ServiceClient(builder = DataLakeLeaseClientBuilder.class) public final class DataLakeLeaseClient { + + private final ClientLogger logger = new ClientLogger(DataLakeLeaseClient.class); private final BlobLeaseClient blobLeaseClient; DataLakeLeaseClient(BlobLeaseClient blobLeaseClient) { @@ -100,7 +104,8 @@ public String acquireLease(int duration) { @ServiceMethod(returns = ReturnType.SINGLE) public Response acquireLeaseWithResponse(int duration, RequestConditions modifiedRequestConditions, Duration timeout, Context context) { - return blobLeaseClient.acquireLeaseWithResponse(duration, modifiedRequestConditions, timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobLeaseClient.acquireLeaseWithResponse(duration, modifiedRequestConditions, timeout, context), logger); } /** @@ -134,7 +139,8 @@ public String renewLease() { @ServiceMethod(returns = ReturnType.SINGLE) public Response renewLeaseWithResponse(RequestConditions modifiedRequestConditions, Duration timeout, Context context) { - return blobLeaseClient.renewLeaseWithResponse(modifiedRequestConditions, timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobLeaseClient.renewLeaseWithResponse(modifiedRequestConditions, timeout, context), logger); } /** @@ -166,7 +172,8 @@ public void releaseLease() { @ServiceMethod(returns = ReturnType.SINGLE) public Response releaseLeaseWithResponse(RequestConditions modifiedRequestConditions, Duration timeout, Context context) { - return blobLeaseClient.releaseLeaseWithResponse(modifiedRequestConditions, timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobLeaseClient.releaseLeaseWithResponse(modifiedRequestConditions, timeout, context), logger); } /** @@ -207,8 +214,9 @@ public Integer breakLease() { @ServiceMethod(returns = ReturnType.SINGLE) public Response breakLeaseWithResponse(Integer breakPeriodInSeconds, RequestConditions modifiedRequestConditions, Duration timeout, Context context) { - return blobLeaseClient.breakLeaseWithResponse(breakPeriodInSeconds, modifiedRequestConditions, timeout, - context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobLeaseClient.breakLeaseWithResponse(breakPeriodInSeconds, modifiedRequestConditions, timeout, + context), logger); } /** @@ -244,7 +252,8 @@ public String changeLease(String proposedId) { @ServiceMethod(returns = ReturnType.SINGLE) public Response changeLeaseWithResponse(String proposedId, RequestConditions modifiedRequestConditions, Duration timeout, Context context) { - return blobLeaseClient.changeLeaseWithResponse(proposedId, modifiedRequestConditions, timeout, context); + return DataLakeImplUtils.returnOrConvertException(() -> + blobLeaseClient.changeLeaseWithResponse(proposedId, modifiedRequestConditions, timeout, context), logger); } /** diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/APISpec.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/APISpec.groovy index a1dd75362b39..4b69f663d6ce 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/APISpec.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/APISpec.groovy @@ -15,6 +15,7 @@ import com.azure.core.util.logging.ClientLogger import com.azure.identity.EnvironmentCredentialBuilder import com.azure.storage.common.StorageSharedKeyCredential import com.azure.storage.file.datalake.models.* +import com.azure.storage.file.datalake.specialized.DataLakeLeaseAsyncClient import com.azure.storage.file.datalake.specialized.DataLakeLeaseClient import com.azure.storage.file.datalake.specialized.DataLakeLeaseClientBuilder import reactor.core.publisher.Flux @@ -300,6 +301,17 @@ class APISpec extends Specification { .buildClient() } + static DataLakeLeaseAsyncClient createLeaseAsyncClient(DataLakeFileAsyncClient pathAsyncClient) { + return createLeaseAsyncClient(pathAsyncClient, null) + } + + static DataLakeLeaseAsyncClient createLeaseAsyncClient(DataLakeFileAsyncClient pathAsyncClient, String leaseId) { + return new DataLakeLeaseClientBuilder() + .fileAsyncClient(pathAsyncClient) + .leaseId(leaseId) + .buildAsyncClient() + } + static DataLakeLeaseClient createLeaseClient(DataLakeDirectoryClient pathClient) { return createLeaseClient(pathClient, null) } diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/AsyncErrorMappingTest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/AsyncErrorMappingTest.groovy new file mode 100644 index 000000000000..465a64096266 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/AsyncErrorMappingTest.groovy @@ -0,0 +1,132 @@ +package com.azure.storage.file.datalake + +import com.azure.storage.file.datalake.models.DataLakeStorageException +import reactor.test.StepVerifier + +class AsyncErrorMappingTest extends APISpec { + + DataLakeFileSystemAsyncClient fsac + String fileSystemName + + def setup() { + fileSystemName = generateFileSystemName() + fsac = getServiceAsyncClient(primaryCredential).createFileSystem(fileSystemName).block() + } + + def "Read file"() { + when: + def fileName = generatePathName() + def fac = fsac.getFileAsyncClient(fileName) + def readFileVerifier = StepVerifier.create(fac.readWithResponse(null, null, null, false)) + then: + readFileVerifier.verifyError(DataLakeStorageException) + } + + def "Get file properties"() { + when: + def fileName = generatePathName() + def fac = fsac.getFileAsyncClient(fileName) + def getPropertiesVerifier = StepVerifier.create(fac.getPropertiesWithResponse(null)) + then: + getPropertiesVerifier.verifyError(DataLakeStorageException) + } + + def "Set file http properties"() { + when: + def fileName = generatePathName() + def fac = fsac.getFileAsyncClient(fileName) + def setPropertiesVerifier = StepVerifier.create(fac.setHttpHeadersWithResponse(null, null)) + then: + setPropertiesVerifier.verifyError(DataLakeStorageException) + } + + def "Set file metadata"() { + when: + def fileName = generatePathName() + def fac = fsac.getFileAsyncClient(fileName) + def setMetadataVerifier = StepVerifier.create(fac.setMetadataWithResponse(null, null)) + then: + setMetadataVerifier.verifyError(DataLakeStorageException) + } + + def "Get directory properties"() { + when: + def directoryName = generatePathName() + def dac = fsac.getDirectoryAsyncClient(directoryName) + def getPropertiesVerifier = StepVerifier.create(dac.getPropertiesWithResponse(null)) + then: + getPropertiesVerifier.verifyError(DataLakeStorageException) + } + + def "Set directory http properties"() { + when: + def directoryName = generatePathName() + def dac = fsac.getDirectoryAsyncClient(directoryName) + def setPropertiesVerifier = StepVerifier.create(dac.setHttpHeadersWithResponse(null, null)) + then: + setPropertiesVerifier.verifyError(DataLakeStorageException) + } + + def "Set directory metadata"() { + when: + def directoryName = generatePathName() + def dac = fsac.getDirectoryAsyncClient(directoryName) + def setMetadataVerifier = StepVerifier.create(dac.setMetadataWithResponse(null, null)) + then: + setMetadataVerifier.verifyError(DataLakeStorageException) + } + + def "Create file system"() { + when: + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def createVerifier = StepVerifier.create(fsac.createWithResponse(null, null)) + then: + createVerifier.verifyError(DataLakeStorageException) + } + + def "Get file system properties"() { + when: + def fileSystemName = generateFileSystemName() + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def getPropertiesVerifier = StepVerifier.create(fsac.getPropertiesWithResponse(null)) + then: + getPropertiesVerifier.verifyError(DataLakeStorageException) + } + + def "Set file system metadata"() { + when: + def fileSystemName = generateFileSystemName() + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def setMetadataVerifier = StepVerifier.create(fsac.setMetadataWithResponse(null, null)) + then: + setMetadataVerifier.verifyError(DataLakeStorageException) + } + + def "Delete file system"() { + when: + def fileSystemName = generateFileSystemName() + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def setMetadataVerifier = StepVerifier.create(fsac.deleteWithResponse(null)) + then: + setMetadataVerifier.verifyError(DataLakeStorageException) + } + + def "Get file system access policy"() { + when: + def fileSystemName = generateFileSystemName() + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def getAccessPolicyVerifier = StepVerifier.create(fsac.getAccessPolicyWithResponse(null)) + then: + getAccessPolicyVerifier.verifyError(DataLakeStorageException) + } + + def "Set file system access policy"() { + when: + def fileSystemName = generateFileSystemName() + def fsac = getServiceAsyncClient(primaryCredential).getFileSystemAsyncClient(fileSystemName) + def setAccessPolicyVerifier = StepVerifier.create(fsac.setAccessPolicyWithResponse(null, null, null)) + then: + setAccessPolicyVerifier.verifyError(DataLakeStorageException) + } + +} diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DirectoryAPITest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DirectoryAPITest.groovy index 761f68166d90..28b5632cc38d 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DirectoryAPITest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/DirectoryAPITest.groovy @@ -5,7 +5,6 @@ import com.azure.core.util.Context import com.azure.identity.DefaultAzureCredentialBuilder import com.azure.storage.blob.BlobUrlParts import com.azure.storage.blob.models.BlobErrorCode -import com.azure.storage.blob.models.BlobStorageException import com.azure.storage.file.datalake.implementation.models.StorageErrorException import com.azure.storage.file.datalake.models.* @@ -61,7 +60,7 @@ class DirectoryAPITest extends APISpec { Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) } def "Exists"() { @@ -174,7 +173,7 @@ class DirectoryAPITest extends APISpec { dc.createWithResponse(null, null, null, null, drc, null, Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -210,9 +209,9 @@ class DirectoryAPITest extends APISpec { dc.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -257,7 +256,7 @@ class DirectoryAPITest extends APISpec { dc.deleteWithResponse(false, drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -273,7 +272,7 @@ class DirectoryAPITest extends APISpec { def resp = dc.setPermissions(permissions, group, owner) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) resp.getETag() resp.getLastModified() } @@ -324,7 +323,7 @@ class DirectoryAPITest extends APISpec { dc.setPermissionsWithResponse(permissions, group, owner, drc, null, Context.NONE).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -343,7 +342,7 @@ class DirectoryAPITest extends APISpec { dc.setPermissionsWithResponse(permissions, group, owner, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Set ACL min"() { @@ -351,7 +350,7 @@ class DirectoryAPITest extends APISpec { def resp = dc.setAccessControlList(pathAccessControlEntries, group, owner) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) resp.getETag() resp.getLastModified() } @@ -402,7 +401,7 @@ class DirectoryAPITest extends APISpec { dc.setAccessControlListWithResponse(pathAccessControlEntries, group, owner, drc, null, Context.NONE).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -421,7 +420,7 @@ class DirectoryAPITest extends APISpec { dc.setAccessControlList(pathAccessControlEntries, group, owner) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Get access control min"() { @@ -429,7 +428,7 @@ class DirectoryAPITest extends APISpec { PathAccessControl pac = dc.getAccessControl() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) pac.getAccessControlList() pac.getPermissions() pac.getOwner() @@ -487,7 +486,7 @@ class DirectoryAPITest extends APISpec { dc.getAccessControlWithResponse(false, drc, null, null).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -512,13 +511,13 @@ class DirectoryAPITest extends APISpec { renamedClient.getProperties() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) when: dc.getProperties() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Rename error"() { @@ -529,7 +528,7 @@ class DirectoryAPITest extends APISpec { dc.renameWithResponse(generatePathName(), null, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } @Unroll @@ -573,7 +572,7 @@ class DirectoryAPITest extends APISpec { dc.renameWithResponse(generatePathName(), drc, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -631,7 +630,7 @@ class DirectoryAPITest extends APISpec { dc.renameWithResponse(pathName, null, drc, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -722,7 +721,7 @@ class DirectoryAPITest extends APISpec { dc.getPropertiesWithResponse(drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -741,7 +740,7 @@ class DirectoryAPITest extends APISpec { dc.getProperties() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Set HTTP headers null"() { @@ -834,7 +833,7 @@ class DirectoryAPITest extends APISpec { dc.setHttpHeadersWithResponse(null, drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -853,7 +852,7 @@ class DirectoryAPITest extends APISpec { dc.setHttpHeaders(null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Set metadata all null"() { @@ -951,7 +950,7 @@ class DirectoryAPITest extends APISpec { dc.setMetadataWithResponse(null, drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -970,7 +969,7 @@ class DirectoryAPITest extends APISpec { dc.setMetadata(null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Create file min"() { @@ -978,7 +977,7 @@ class DirectoryAPITest extends APISpec { dc.getFileClient(generatePathName()).create() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Create file defaults"() { @@ -996,7 +995,7 @@ class DirectoryAPITest extends APISpec { Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } @Unroll @@ -1097,7 +1096,7 @@ class DirectoryAPITest extends APISpec { dc.createFileWithResponse(pathName, null, null, null, null, drc, null, Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1132,9 +1131,9 @@ class DirectoryAPITest extends APISpec { client.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -1183,7 +1182,7 @@ class DirectoryAPITest extends APISpec { dc.deleteFileWithResponse(pathName, drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1200,7 +1199,7 @@ class DirectoryAPITest extends APISpec { subdir.create() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Create sub dir defaults"() { @@ -1219,7 +1218,7 @@ class DirectoryAPITest extends APISpec { Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) } @Unroll @@ -1324,7 +1323,7 @@ class DirectoryAPITest extends APISpec { dc.createSubdirectoryWithResponse(pathName, null, null, null, null, drc, null, Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1366,9 +1365,9 @@ class DirectoryAPITest extends APISpec { client.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -1417,7 +1416,7 @@ class DirectoryAPITest extends APISpec { dc.deleteSubdirectoryWithResponse(pathName, false, drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1546,6 +1545,6 @@ class DirectoryAPITest extends APISpec { dirClient.getAccessControl() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } } diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAPITest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAPITest.groovy index 0365804428e8..a69ccf3afd23 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAPITest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAPITest.groovy @@ -5,9 +5,7 @@ import com.azure.core.util.Context import com.azure.identity.DefaultAzureCredentialBuilder import com.azure.storage.blob.BlobUrlParts import com.azure.storage.blob.models.BlobErrorCode -import com.azure.storage.blob.models.BlobStorageException -import com.azure.storage.file.datalake.implementation.models.StorageErrorException import com.azure.storage.file.datalake.models.* import spock.lang.Unroll @@ -41,7 +39,7 @@ class FileAPITest extends APISpec { fc.create() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Create defaults"() { @@ -65,7 +63,7 @@ class FileAPITest extends APISpec { Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Exists"() { @@ -175,7 +173,7 @@ class FileAPITest extends APISpec { fc.createWithResponse(null, null, null, null, drc, null, Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -206,9 +204,9 @@ class FileAPITest extends APISpec { fc.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -253,7 +251,7 @@ class FileAPITest extends APISpec { fc.deleteWithResponse(drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -269,7 +267,7 @@ class FileAPITest extends APISpec { def resp = fc.setPermissions(permissions, group, owner) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) resp.getETag() resp.getLastModified() } @@ -320,7 +318,7 @@ class FileAPITest extends APISpec { fc.setPermissionsWithResponse(permissions, group, owner, drc, null, Context.NONE).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -339,7 +337,7 @@ class FileAPITest extends APISpec { fc.setPermissionsWithResponse(permissions, group, owner, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Set ACL min"() { @@ -347,7 +345,7 @@ class FileAPITest extends APISpec { def resp = fc.setAccessControlList(pathAccessControlEntries, group, owner) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) resp.getETag() resp.getLastModified() } @@ -398,7 +396,7 @@ class FileAPITest extends APISpec { fc.setAccessControlListWithResponse(pathAccessControlEntries, group, owner, drc, null, Context.NONE).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -417,7 +415,7 @@ class FileAPITest extends APISpec { fc.setAccessControlList(pathAccessControlEntries, group, owner) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Get access control min"() { @@ -425,7 +423,7 @@ class FileAPITest extends APISpec { PathAccessControl pac = fc.getAccessControl() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) pac.getAccessControlList() pac.getPermissions() pac.getOwner() @@ -484,7 +482,7 @@ class FileAPITest extends APISpec { fc.getAccessControlWithResponse(false, drc, null, null).getStatusCode() == 200 then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -576,7 +574,7 @@ class FileAPITest extends APISpec { fc.getPropertiesWithResponse(drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -595,7 +593,7 @@ class FileAPITest extends APISpec { fc.getProperties() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Set HTTP headers null"() { @@ -691,7 +689,7 @@ class FileAPITest extends APISpec { fc.setHttpHeadersWithResponse(null, drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -710,7 +708,7 @@ class FileAPITest extends APISpec { fc.setHttpHeaders(null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Set metadata min"() { @@ -788,7 +786,7 @@ class FileAPITest extends APISpec { fc.setMetadataWithResponse(null, drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -807,7 +805,7 @@ class FileAPITest extends APISpec { fc.setMetadata(null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Read all null"() { @@ -858,7 +856,7 @@ class FileAPITest extends APISpec { def result = outStream.toByteArray() then: - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) result.length == 0 } @@ -976,7 +974,7 @@ class FileAPITest extends APISpec { fc.readWithResponse(new ByteArrayOutputStream(), null, null, drc, false, null, null).getStatusCode() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1024,13 +1022,13 @@ class FileAPITest extends APISpec { renamedClient.getProperties() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) when: fc.getProperties() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Rename error"() { @@ -1041,7 +1039,7 @@ class FileAPITest extends APISpec { fc.renameWithResponse(generatePathName(), null, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } @Unroll @@ -1088,7 +1086,7 @@ class FileAPITest extends APISpec { fc.renameWithResponse(generatePathName(), drc, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1146,7 +1144,7 @@ class FileAPITest extends APISpec { fc.renameWithResponse(pathName, null, drc, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1162,7 +1160,7 @@ class FileAPITest extends APISpec { fc.append(new ByteArrayInputStream(defaultData.array()), 0, defaultDataSize) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Append data"() { @@ -1216,7 +1214,7 @@ class FileAPITest extends APISpec { fc.append(new ByteArrayInputStream(new byte[0]), 0, 0) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Append data null body"() { @@ -1245,7 +1243,7 @@ class FileAPITest extends APISpec { fc.appendWithResponse(defaultInputStream.get(), 0, defaultDataSize, null, garbageLeaseID, null, null) then: - def e = thrown(StorageErrorException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 412 } @@ -1257,7 +1255,7 @@ class FileAPITest extends APISpec { fc.appendWithResponse(defaultInputStream.get(), 0, defaultDataSize, null, null, null, null) then: - def e = thrown(StorageErrorException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 } @@ -1267,7 +1265,7 @@ class FileAPITest extends APISpec { fc.flush(defaultDataSize) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Flush close"() { @@ -1278,7 +1276,7 @@ class FileAPITest extends APISpec { fc.flushWithResponse(defaultDataSize, false, true, null, null, null, null) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Flush retain uncommitted data "() { @@ -1289,7 +1287,7 @@ class FileAPITest extends APISpec { fc.flushWithResponse(defaultDataSize, true, false, null, null, null, null) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Flush IA"() { @@ -1300,7 +1298,7 @@ class FileAPITest extends APISpec { fc.flushWithResponse(4, false, false, null, null, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } @Unroll @@ -1380,7 +1378,7 @@ class FileAPITest extends APISpec { when: fc.flushWithResponse(defaultDataSize, false, false, null, drc, null, null) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1399,7 +1397,7 @@ class FileAPITest extends APISpec { fc.flush(1) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "Get File Name and Build Client"() { diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileSystemAPITest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileSystemAPITest.groovy index ce46723f3273..b49410e1f345 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileSystemAPITest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileSystemAPITest.groovy @@ -4,17 +4,13 @@ import com.azure.core.util.Context import com.azure.identity.DefaultAzureCredentialBuilder import com.azure.storage.blob.BlobUrlParts import com.azure.storage.blob.models.BlobErrorCode -import com.azure.storage.blob.models.BlobStorageException import com.azure.storage.common.Utility -import com.azure.storage.file.datalake.implementation.models.StorageErrorException import com.azure.storage.file.datalake.models.* import spock.lang.Unroll import java.time.OffsetDateTime import java.time.ZoneId import java.time.temporal.ChronoUnit -import java.time.temporal.Temporal -import java.time.temporal.TemporalUnit class FileSystemAPITest extends APISpec { @@ -38,7 +34,7 @@ class FileSystemAPITest extends APISpec { then: fsc.getProperties() - notThrown(Exception) + notThrown(DataLakeStorageException) } @Unroll @@ -91,9 +87,9 @@ class FileSystemAPITest extends APISpec { fsc.create() then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 409 - e.getErrorCode() == BlobErrorCode.CONTAINER_ALREADY_EXISTS + e.getErrorCode() == BlobErrorCode.CONTAINER_ALREADY_EXISTS.toString() e.getServiceMessage().contains("The specified container already exists.") } @@ -130,7 +126,7 @@ class FileSystemAPITest extends APISpec { fsc.getPropertiesWithResponse("garbage", null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Get properties error"() { @@ -141,7 +137,7 @@ class FileSystemAPITest extends APISpec { fsc.getProperties() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Set metadata"() { @@ -222,7 +218,7 @@ class FileSystemAPITest extends APISpec { fsc.setMetadataWithResponse(null, drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | leaseID @@ -259,7 +255,7 @@ class FileSystemAPITest extends APISpec { fsc.setMetadata(null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Delete"() { @@ -281,9 +277,9 @@ class FileSystemAPITest extends APISpec { fsc.getProperties() then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.CONTAINER_NOT_FOUND + e.getErrorCode() == BlobErrorCode.CONTAINER_NOT_FOUND.toString() e.getServiceMessage().contains("The specified container does not exist.") } @@ -319,7 +315,7 @@ class FileSystemAPITest extends APISpec { fsc.deleteWithResponse(drc, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | leaseID @@ -355,7 +351,7 @@ class FileSystemAPITest extends APISpec { fsc.delete() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Create file min"() { @@ -363,7 +359,7 @@ class FileSystemAPITest extends APISpec { fsc.createFile(generatePathName()) then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Create file defaults"() { @@ -382,7 +378,7 @@ class FileSystemAPITest extends APISpec { Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } @Unroll @@ -483,7 +479,7 @@ class FileSystemAPITest extends APISpec { fsc.createFileWithResponse(pathName, null, null, null, null, drc, null, Context.NONE) then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -518,9 +514,9 @@ class FileSystemAPITest extends APISpec { client.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -569,7 +565,7 @@ class FileSystemAPITest extends APISpec { fsc.deleteFileWithResponse(pathName, drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -586,7 +582,7 @@ class FileSystemAPITest extends APISpec { dir.create() then: - notThrown(StorageErrorException) + notThrown(DataLakeStorageException) } def "Create dir defaults"() { @@ -605,7 +601,7 @@ class FileSystemAPITest extends APISpec { Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) } @Unroll @@ -710,7 +706,7 @@ class FileSystemAPITest extends APISpec { fsc.createDirectoryWithResponse(pathName, null, null, null, null, drc, null, Context.NONE) then: - thrown(Exception) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -752,9 +748,9 @@ class FileSystemAPITest extends APISpec { client.getPropertiesWithResponse(null, null, null) then: - def e = thrown(BlobStorageException) + def e = thrown(DataLakeStorageException) e.getResponse().getStatusCode() == 404 - e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND + e.getErrorCode() == BlobErrorCode.BLOB_NOT_FOUND.toString() // e.getServiceMessage().contains("The specified blob does not exist.") } @@ -803,7 +799,7 @@ class FileSystemAPITest extends APISpec { fsc.deleteDirectoryWithResponse(pathName, false, drc, null, null).getStatusCode() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch | leaseID @@ -1048,7 +1044,7 @@ class FileSystemAPITest extends APISpec { fsc.setAccessPolicyWithResponse(null, null, cac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | leaseID @@ -1082,7 +1078,7 @@ class FileSystemAPITest extends APISpec { fsc.setAccessPolicy(null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Get access policy"() { @@ -1119,7 +1115,7 @@ class FileSystemAPITest extends APISpec { fsc.getAccessPolicyWithResponse(garbageLeaseID, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Get access policy error"() { @@ -1130,7 +1126,7 @@ class FileSystemAPITest extends APISpec { fsc.getAccessPolicy() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Builder bearer token validation"() { diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/SASTest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/SASTest.groovy index fe1e2e8789db..6e16cd439b61 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/SASTest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/SASTest.groovy @@ -4,13 +4,11 @@ package com.azure.storage.file.datalake import com.azure.storage.blob.implementation.util.BlobSasImplUtil -import com.azure.storage.blob.models.BlobStorageException import com.azure.storage.common.implementation.Constants -import com.azure.storage.common.implementation.StorageImplUtils import com.azure.storage.common.sas.* -import com.azure.storage.file.datalake.implementation.models.StorageErrorException import com.azure.storage.file.datalake.models.DataLakeAccessPolicy import com.azure.storage.file.datalake.models.DataLakeSignedIdentifier +import com.azure.storage.file.datalake.models.DataLakeStorageException import com.azure.storage.file.datalake.models.FileRange import com.azure.storage.file.datalake.models.PathProperties import com.azure.storage.file.datalake.models.UserDelegationKey @@ -122,7 +120,7 @@ class SASTest extends APISpec { then: os.toString() == new String(defaultData.array()) validateSasProperties(properties) - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "serviceSASSignatureValues network test file system"() { @@ -163,7 +161,7 @@ class SASTest extends APISpec { client2.listPaths().iterator().hasNext() then: - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "serviceSASSignatureValues network test file user delegation"() { @@ -189,7 +187,7 @@ class SASTest extends APISpec { then: os.toString() == new String(defaultData.array()) validateSasProperties(properties) - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "serviceSASSignatureValues network test file system user delegation"() { @@ -220,7 +218,7 @@ class SASTest extends APISpec { client.listPaths().iterator().hasNext() then: - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "accountSAS network test file read"() { @@ -275,7 +273,7 @@ class SASTest extends APISpec { client.delete() then: - thrown(StorageErrorException) + thrown(DataLakeStorageException) } def "accountSAS network create file system fails"() { @@ -298,7 +296,7 @@ class SASTest extends APISpec { sc.createFileSystem(generateFileSystemName()) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "accountSAS network create file system succeeds"() { @@ -321,7 +319,7 @@ class SASTest extends APISpec { sc.createFileSystem(generateFileSystemName()) then: - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "accountSAS network account sas token on endpoint"() { @@ -354,7 +352,7 @@ class SASTest extends APISpec { fc.create() then: - notThrown(Exception) + notThrown(DataLakeStorageException) } /* diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/ServiceAPITest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/ServiceAPITest.groovy index 93669173678c..9184cba3500b 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/ServiceAPITest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/ServiceAPITest.groovy @@ -3,10 +3,14 @@ package com.azure.storage.file.datalake +import com.azure.core.http.rest.PagedIterable import com.azure.core.http.rest.Response import com.azure.identity.DefaultAzureCredentialBuilder import com.azure.storage.blob.BlobUrlParts +import com.azure.storage.blob.models.BlobContainerItem import com.azure.storage.blob.models.BlobStorageException +import com.azure.storage.file.datalake.implementation.util.DataLakeImplUtils +import com.azure.storage.file.datalake.models.DataLakeStorageException import com.azure.storage.file.datalake.models.FileSystemItem import com.azure.storage.file.datalake.models.FileSystemListDetails import com.azure.storage.file.datalake.models.ListFileSystemsOptions @@ -41,7 +45,7 @@ class ServiceAPITest extends APISpec { primaryDataLakeServiceClient.listFileSystems().iterator().hasNext() then: - notThrown(BlobStorageException) + notThrown(DataLakeStorageException) } def "List file systems marker"() { @@ -98,10 +102,15 @@ class ServiceAPITest extends APISpec { def "List file systems error"() { when: - primaryDataLakeServiceClient.listFileSystems().streamByPage("garbage continuation token").count() + PagedIterable items = primaryDataLakeServiceClient.listFileSystems() + try { + items.streamByPage("garbage continuation token").count() + } catch (BlobStorageException ex) { + throw DataLakeImplUtils.transformBlobStorageException(ex) + } then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "List file systems with timeout still backed by PagedFlux"() { diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAPITest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAPITest.groovy index e8b541334b09..c8047bcfebce 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAPITest.groovy +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAPITest.groovy @@ -4,9 +4,9 @@ package com.azure.storage.file.datalake.specialized import com.azure.core.http.RequestConditions -import com.azure.storage.blob.models.BlobStorageException import com.azure.storage.file.datalake.APISpec import com.azure.storage.file.datalake.DataLakeFileClient +import com.azure.storage.file.datalake.models.DataLakeStorageException import com.azure.storage.file.datalake.models.LeaseDurationType import com.azure.storage.file.datalake.models.LeaseStateType import spock.lang.Unroll @@ -63,7 +63,7 @@ class LeaseAPITest extends APISpec { leaseClient.acquireLease(duration) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: duration | _ @@ -112,7 +112,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc).acquireLeaseWithResponse(-1, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch @@ -130,7 +130,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc).acquireLease(20) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Renew file lease"() { @@ -201,7 +201,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, leaseID).renewLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch @@ -219,7 +219,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, "id").renewLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Release file lease"() { @@ -282,7 +282,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, leaseID).releaseLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch @@ -300,7 +300,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, "id").releaseLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } @Unroll @@ -375,7 +375,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc).breakLeaseWithResponse(null, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch @@ -393,7 +393,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc).breakLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Change file lease"() { @@ -458,7 +458,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, leaseID).changeLeaseWithResponse(getRandomUUID(), mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified | match | noneMatch @@ -476,7 +476,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fc, "id").changeLease("id") then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } @@ -515,7 +515,7 @@ class LeaseAPITest extends APISpec { leaseClient.acquireLease(duration) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: duration | _ @@ -554,7 +554,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc).acquireLeaseWithResponse(-1, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified @@ -570,7 +570,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc).acquireLease(50) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Renew file system lease"() { @@ -620,7 +620,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, leaseID).renewLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified @@ -637,7 +637,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, APISpec.receivedEtag).renewLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: match | noneMatch @@ -653,7 +653,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, "id").renewLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Release file system lease"() { @@ -701,7 +701,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, leaseID).releaseLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified @@ -718,7 +718,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, APISpec.receivedLeaseID).releaseLeaseWithResponse(mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: match | noneMatch @@ -734,7 +734,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, "id").releaseLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } @Unroll @@ -797,7 +797,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc).breakLeaseWithResponse(null, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified @@ -814,7 +814,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc).breakLeaseWithResponse(null, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: match | noneMatch @@ -830,7 +830,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc).breakLease() then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } def "Change file system lease"() { @@ -879,7 +879,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, leaseID).changeLeaseWithResponse(getRandomUUID(), mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: modified | unmodified @@ -896,7 +896,7 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, APISpec.receivedLeaseID).changeLeaseWithResponse(APISpec.garbageLeaseID, mac, null, null) then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) where: match | noneMatch @@ -912,6 +912,6 @@ class LeaseAPITest extends APISpec { createLeaseClient(fsc, "id").changeLease("id") then: - thrown(BlobStorageException) + thrown(DataLakeStorageException) } } diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAsyncErrorMappingTest.groovy b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAsyncErrorMappingTest.groovy new file mode 100644 index 000000000000..0774e312dc45 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/specialized/LeaseAsyncErrorMappingTest.groovy @@ -0,0 +1,59 @@ +package com.azure.storage.file.datalake.specialized + +import com.azure.storage.file.datalake.APISpec +import com.azure.storage.file.datalake.DataLakeFileAsyncClient +import com.azure.storage.file.datalake.models.DataLakeStorageException +import reactor.test.StepVerifier + +class LeaseAsyncErrorMappingTest extends APISpec { + private DataLakeFileAsyncClient createPathAsyncClient() { + def fac = getServiceAsyncClient(primaryCredential) + .createFileSystem(generateFileSystemName()).block() + .getFileAsyncClient(generatePathName()) + return fac + } + + DataLakeFileAsyncClient fac + DataLakeLeaseAsyncClient leaseAsyncClient + + def setup() { + fac = createPathAsyncClient() + leaseAsyncClient = createLeaseAsyncClient(fac) + } + + def "Acquire Lease"() { + when: + def acquireLeaseVerifier = StepVerifier.create(leaseAsyncClient.acquireLeaseWithResponse(-10, null)) + then: + acquireLeaseVerifier.verifyError(DataLakeStorageException) + } + + def "Renew Lease"() { + when: + def renewLeaseVerifier = StepVerifier.create(leaseAsyncClient.renewLeaseWithResponse(null)) + then: + renewLeaseVerifier.verifyError(DataLakeStorageException) + } + + def "Release Lease"() { + when: + def releaseLeaseVerifier = StepVerifier.create(leaseAsyncClient.releaseLeaseWithResponse(null)) + then: + releaseLeaseVerifier.verifyError(DataLakeStorageException) + } + + def "Change Lease"() { + when: + def changeLeaseVerifier = StepVerifier.create(leaseAsyncClient.changeLeaseWithResponse(null, null)) + then: + changeLeaseVerifier.verifyError(DataLakeStorageException) + } + + def "Break Lease"() { + when: + def breakLeaseVerifier = StepVerifier.create(leaseAsyncClient.breakLeaseWithResponse(null, null)) + then: + breakLeaseVerifier.verifyError(DataLakeStorageException) + } + +} diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestcreatefilesystem.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestcreatefilesystem.json new file mode 100644 index 000000000000..ed13ddb7232a --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestcreatefilesystem.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfscreatefilesystem0635390a8a5342aef74156bc?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "3f79ceff-5f1c-4693-90b1-6e63593657c3" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBFAD8520AF", + "Last-Modified" : "Tue, 10 Dec 2019 22:24:09 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e272146e-401e-0017-60a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "3f79ceff-5f1c-4693-90b1-6e63593657c3" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfscreatefilesystem1528863dc510b2b6e443dd94?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "13dc8504-da5c-46e5-96dd-8112f9df45dc" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBFADA72DC1", + "Last-Modified" : "Tue, 10 Dec 2019 22:24:10 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e27214e3-401e-0017-47a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "13dc8504-da5c-46e5-96dd-8112f9df45dc" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfscreatefilesystem1528863dc510b2b6e443dd94?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a9e6b42c-56f9-44e3-a2f1-7891a6716651" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerAlreadyExists", + "retry-after" : "0", + "Content-Length" : "230", + "StatusCode" : "409", + "x-ms-request-id" : "e272150e-401e-0017-70a8-af8e19000000", + "Body" : "ContainerAlreadyExistsThe specified container already exists.\nRequestId:e272150e-401e-0017-70a8-af8e19000000\nTime:2019-12-10T22:24:10.2805321Z", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "a9e6b42c-56f9-44e3-a2f1-7891a6716651", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfscreatefilesystem&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "582cb319-cddf-4e7b-a860-f21c84016621" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e2721553-401e-0017-2ea8-af8e19000000", + "Body" : "jtfscreatefilesystemjtfscreatefilesystem0635390a8a5342aef74156bcTue, 10 Dec 2019 22:24:09 GMT\"0x8D77DBFAD8520AF\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfscreatefilesystem1528863dc510b2b6e443dd94Tue, 10 Dec 2019 22:24:10 GMT\"0x8D77DBFADA72DC1\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "582cb319-cddf-4e7b-a860-f21c84016621", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfscreatefilesystem0635390a8a5342aef74156bc?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "9dd1da16-f820-47f2-82d2-a4ef28d286ec" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e272156d-401e-0017-44a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "9dd1da16-f820-47f2-82d2-a4ef28d286ec" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfscreatefilesystem1528863dc510b2b6e443dd94?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "99e94f47-76f1-4888-b77d-aa138bc72721" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2721582-401e-0017-51a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:09 GMT", + "x-ms-client-request-id" : "99e94f47-76f1-4888-b77d-aa138bc72721" + }, + "Exception" : null + } ], + "variables" : [ "jtfscreatefilesystem0635390a8a5342aef74156bc", "jtfscreatefilesystem1528863dc510b2b6e443dd94" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestdeletefilesystem.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestdeletefilesystem.json new file mode 100644 index 000000000000..1f376cd36871 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestdeletefilesystem.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsdeletefilesystem089903ad3bb74a625f42888f?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "917d36e4-2d77-4161-99ac-2a5a5d1bd702" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBFB192FF68", + "Last-Modified" : "Tue, 10 Dec 2019 22:24:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e2721c8b-401e-0017-10a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:15 GMT", + "x-ms-client-request-id" : "917d36e4-2d77-4161-99ac-2a5a5d1bd702" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsdeletefilesystem1115884f26f935c42f4695a6?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "4cc1360d-e292-4aab-8fdb-e0458b4ebd5e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBFB1AE2D69", + "Last-Modified" : "Tue, 10 Dec 2019 22:24:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e2721caa-401e-0017-27a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:16 GMT", + "x-ms-client-request-id" : "4cc1360d-e292-4aab-8fdb-e0458b4ebd5e" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsdeletefilesystem200449a51e251c74774b74a9?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "08770211-159e-4160-8249-93dbc07c90b1" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "e2721cc8-401e-0017-42a8-af8e19000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:e2721cc8-401e-0017-42a8-af8e19000000\nTime:2019-12-10T22:24:17.0422889Z", + "Date" : "Tue, 10 Dec 2019 22:24:16 GMT", + "x-ms-client-request-id" : "08770211-159e-4160-8249-93dbc07c90b1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsdeletefilesystem&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "20f70a83-1c7f-406e-97eb-2d7699b1805d" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e2721cff-401e-0017-6fa8-af8e19000000", + "Body" : "jtfsdeletefilesystemjtfsdeletefilesystem089903ad3bb74a625f42888fTue, 10 Dec 2019 22:24:16 GMT\"0x8D77DBFB192FF68\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsdeletefilesystem1115884f26f935c42f4695a6Tue, 10 Dec 2019 22:24:16 GMT\"0x8D77DBFB1AE2D69\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:24:16 GMT", + "x-ms-client-request-id" : "20f70a83-1c7f-406e-97eb-2d7699b1805d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsdeletefilesystem089903ad3bb74a625f42888f?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "95905277-f429-46b6-875c-50e957c20110" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2721d1f-401e-0017-0da8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:16 GMT", + "x-ms-client-request-id" : "95905277-f429-46b6-875c-50e957c20110" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsdeletefilesystem1115884f26f935c42f4695a6?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "3b3625c5-6a7b-40b3-9aa8-3480be6a7c5e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2721d37-401e-0017-24a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:24:16 GMT", + "x-ms-client-request-id" : "3b3625c5-6a7b-40b3-9aa8-3480be6a7c5e" + }, + "Exception" : null + } ], + "variables" : [ "jtfsdeletefilesystem089903ad3bb74a625f42888f", "jtfsdeletefilesystem1115884f26f935c42f4695a6", "jtfsdeletefilesystem200449a51e251c74774b74a9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetdirectoryproperties.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetdirectoryproperties.json new file mode 100644 index 000000000000..502c77e0e675 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetdirectoryproperties.json @@ -0,0 +1,124 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetdirectoryproperties06845176794473d425454?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "06a0237d-ea41-45a8-8610-5caf8de044ef" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBED49D5DBD", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:06 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944ea40-601e-0066-02a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "06a0237d-ea41-45a8-8610-5caf8de044ef" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetdirectoryproperties144653881d96dc286d4f2?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "02877df7-0357-499a-9a0b-8a79646d341c" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBED4BC0EDA", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:06 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944ea92-601e-0066-4ba7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "02877df7-0357-499a-9a0b-8a79646d341c" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetdirectoryproperties144653881d96dc286d4f2/javapathgetdirectoryproperties26658026708c906a5e4", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d84eb136-6c36-4fcd-9a5a-23af693b7517" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "4944eaad-601e-0066-62a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "d84eb136-6c36-4fcd-9a5a-23af693b7517" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsgetdirectoryproperties&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "db348f42-846d-4447-896b-ee33de28061e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4944eac5-601e-0066-77a7-affc20000000", + "Body" : "jtfsgetdirectorypropertiesjtfsgetdirectoryproperties06845176794473d425454Tue, 10 Dec 2019 22:18:06 GMT\"0x8D77DBED49D5DBD\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsgetdirectoryproperties144653881d96dc286d4f2Tue, 10 Dec 2019 22:18:06 GMT\"0x8D77DBED4BC0EDA\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "db348f42-846d-4447-896b-ee33de28061e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetdirectoryproperties06845176794473d425454?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "f5f839a2-39c2-40e1-97af-449f66d1167f" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944eafc-601e-0066-2aa7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "f5f839a2-39c2-40e1-97af-449f66d1167f" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetdirectoryproperties144653881d96dc286d4f2?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "f96a0289-3edd-4746-8153-c099b15ceba5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944eb18-601e-0066-44a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:05 GMT", + "x-ms-client-request-id" : "f96a0289-3edd-4746-8153-c099b15ceba5" + }, + "Exception" : null + } ], + "variables" : [ "jtfsgetdirectoryproperties06845176794473d425454", "jtfsgetdirectoryproperties144653881d96dc286d4f2", "javapathgetdirectoryproperties26658026708c906a5e4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfileproperties.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfileproperties.json new file mode 100644 index 000000000000..a9bd2f407260 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfileproperties.json @@ -0,0 +1,124 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfileproperties088557cfcb6e3a0ab0419f89?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "02430b9e-da9e-4a5f-85f1-f9ed3e9d9f1b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBE369952D5", + "Last-Modified" : "Tue, 10 Dec 2019 22:13:40 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "49436330-601e-0066-0aa7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:13:40 GMT", + "x-ms-client-request-id" : "02430b9e-da9e-4a5f-85f1-f9ed3e9d9f1b" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfileproperties1801762c4a213107bb491e9e?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "15531968-9265-4d5b-9407-0129f1d4599e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBE36BD34F3", + "Last-Modified" : "Tue, 10 Dec 2019 22:13:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "494363a0-601e-0066-6ca7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:13:40 GMT", + "x-ms-client-request-id" : "15531968-9265-4d5b-9407-0129f1d4599e" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfileproperties1801762c4a213107bb491e9e/javapathgetfileproperties20191102217d1c14d24da6", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "58086d44-2647-4038-ac9c-22a7e2dc6c6e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "StatusCode" : "404", + "x-ms-request-id" : "494363d2-601e-0066-1aa7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:13:41 GMT", + "x-ms-client-request-id" : "58086d44-2647-4038-ac9c-22a7e2dc6c6e" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsgetfileproperties&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "bffb64e8-117e-4b77-9aa7-4f40207f7935" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "494363fc-601e-0066-40a7-affc20000000", + "Body" : "jtfsgetfilepropertiesjtfsgetfileproperties088557cfcb6e3a0ab0419f89Tue, 10 Dec 2019 22:13:40 GMT\"0x8D77DBE369952D5\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsgetfileproperties1801762c4a213107bb491e9eTue, 10 Dec 2019 22:13:41 GMT\"0x8D77DBE36BD34F3\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:13:41 GMT", + "x-ms-client-request-id" : "bffb64e8-117e-4b77-9aa7-4f40207f7935", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfileproperties088557cfcb6e3a0ab0419f89?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c01b3330-e2f8-4ec9-8fce-eb8b755e3d17" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "49436418-601e-0066-5ba7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:13:41 GMT", + "x-ms-client-request-id" : "c01b3330-e2f8-4ec9-8fce-eb8b755e3d17" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfileproperties1801762c4a213107bb491e9e?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "bd4d47e4-2ac0-4036-82fb-15c995eb73ff" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4943642d-601e-0066-6ea7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:13:41 GMT", + "x-ms-client-request-id" : "bd4d47e4-2ac0-4036-82fb-15c995eb73ff" + }, + "Exception" : null + } ], + "variables" : [ "jtfsgetfileproperties088557cfcb6e3a0ab0419f89", "jtfsgetfileproperties1801762c4a213107bb491e9e", "javapathgetfileproperties20191102217d1c14d24da6" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemaccesspolicy.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemaccesspolicy.json new file mode 100644 index 000000000000..c1486d57b82c --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemaccesspolicy.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfsgetfilesystemaccesspolicy08823810338c8890a242?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "9215a725-0a9e-4b07-8725-5a34d1429a19" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77E5A23AABD9E", + "Last-Modified" : "Wed, 11 Dec 2019 16:49:50 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6d309d08-501e-00ed-5443-b047fe000000", + "Date" : "Wed, 11 Dec 2019 16:49:50 GMT", + "x-ms-client-request-id" : "9215a725-0a9e-4b07-8725-5a34d1429a19" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfsgetfilesystemaccesspolicy180390e03b1642bd2c43?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "cb6a66fb-e169-47d8-a424-2bfb38e78815" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77E5A23DC7C4A", + "Last-Modified" : "Wed, 11 Dec 2019 16:49:51 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6d309da8-501e-00ed-6143-b047fe000000", + "Date" : "Wed, 11 Dec 2019 16:49:50 GMT", + "x-ms-client-request-id" : "cb6a66fb-e169-47d8-a424-2bfb38e78815" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfsgetfilesystemaccesspolicy273895eb9dc939004c43?restype=container&comp=acl", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "98b2418a-d4e7-4eec-8254-62df3383352c" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "6d309dd0-501e-00ed-0543-b047fe000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:6d309dd0-501e-00ed-0543-b047fe000000\nTime:2019-12-11T16:49:51.1033309Z", + "Date" : "Wed, 11 Dec 2019 16:49:50 GMT", + "x-ms-client-request-id" : "98b2418a-d4e7-4eec-8254-62df3383352c", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://gaprahns.blob.core.windows.net?prefix=jtfsgetfilesystemaccesspolicy&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "ca6d548f-d1eb-470c-83dc-fd2e2267af72" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "6d309e21-501e-00ed-4a43-b047fe000000", + "Body" : "jtfsgetfilesystemaccesspolicyjtfsgetfilesystemaccesspolicy08823810338c8890a242Wed, 11 Dec 2019 16:49:50 GMT\"0x8D77E5A23AABD9E\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsgetfilesystemaccesspolicy180390e03b1642bd2c43Wed, 11 Dec 2019 16:49:51 GMT\"0x8D77E5A23DC7C4A\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Wed, 11 Dec 2019 16:49:51 GMT", + "x-ms-client-request-id" : "ca6d548f-d1eb-470c-83dc-fd2e2267af72", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfsgetfilesystemaccesspolicy08823810338c8890a242?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "4e471bc3-776c-45b6-97eb-3ce8bae06902" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "6d309e5f-501e-00ed-0443-b047fe000000", + "Date" : "Wed, 11 Dec 2019 16:49:51 GMT", + "x-ms-client-request-id" : "4e471bc3-776c-45b6-97eb-3ce8bae06902" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfsgetfilesystemaccesspolicy180390e03b1642bd2c43?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "44ee409f-7ebf-449c-9825-3ff128c67496" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "6d309e73-501e-00ed-1743-b047fe000000", + "Date" : "Wed, 11 Dec 2019 16:49:51 GMT", + "x-ms-client-request-id" : "44ee409f-7ebf-449c-9825-3ff128c67496" + }, + "Exception" : null + } ], + "variables" : [ "jtfsgetfilesystemaccesspolicy08823810338c8890a242", "jtfsgetfilesystemaccesspolicy180390e03b1642bd2c43", "jtfsgetfilesystemaccesspolicy273895eb9dc939004c43" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemproperties.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemproperties.json new file mode 100644 index 000000000000..fe4794b4403a --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestgetfilesystemproperties.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfilesystemproperties0229480b0e7279993b41a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7ec55c5b-211d-4b62-86e0-b23000ea22f6" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBF4DAA16F1", + "Last-Modified" : "Tue, 10 Dec 2019 22:21:29 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e2715409-401e-0017-75a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:21:28 GMT", + "x-ms-client-request-id" : "7ec55c5b-211d-4b62-86e0-b23000ea22f6" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfilesystemproperties1348314f03ffb6ee9e4ea?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c02c44d9-59f7-45aa-9b09-537f8c7acd11" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBF4DC67DAA", + "Last-Modified" : "Tue, 10 Dec 2019 22:21:29 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e271542b-401e-0017-10a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:21:28 GMT", + "x-ms-client-request-id" : "c02c44d9-59f7-45aa-9b09-537f8c7acd11" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfilesystemproperties2322352e33f504b172413?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7af7c737-668c-49ed-83c1-37e280824ddb" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "e2715451-401e-0017-30a8-af8e19000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:e2715451-401e-0017-30a8-af8e19000000\nTime:2019-12-10T22:21:29.4845085Z", + "Date" : "Tue, 10 Dec 2019 22:21:28 GMT", + "x-ms-client-request-id" : "7af7c737-668c-49ed-83c1-37e280824ddb", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsgetfilesystemproperties&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "99bba2cb-4e43-4cb7-ae32-1e3d58c0a9ee" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e2715466-401e-0017-42a8-af8e19000000", + "Body" : "jtfsgetfilesystempropertiesjtfsgetfilesystemproperties0229480b0e7279993b41aTue, 10 Dec 2019 22:21:29 GMT\"0x8D77DBF4DAA16F1\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsgetfilesystemproperties1348314f03ffb6ee9e4eaTue, 10 Dec 2019 22:21:29 GMT\"0x8D77DBF4DC67DAA\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:21:29 GMT", + "x-ms-client-request-id" : "99bba2cb-4e43-4cb7-ae32-1e3d58c0a9ee", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfilesystemproperties0229480b0e7279993b41a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "adc053f0-004b-4bd7-a8cf-24cf103d6ff2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2715476-401e-0017-52a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:21:29 GMT", + "x-ms-client-request-id" : "adc053f0-004b-4bd7-a8cf-24cf103d6ff2" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsgetfilesystemproperties1348314f03ffb6ee9e4ea?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "4529fc12-73c2-498f-b862-fcb351d819e5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2715486-401e-0017-62a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:21:29 GMT", + "x-ms-client-request-id" : "4529fc12-73c2-498f-b862-fcb351d819e5" + }, + "Exception" : null + } ], + "variables" : [ "jtfsgetfilesystemproperties0229480b0e7279993b41a", "jtfsgetfilesystemproperties1348314f03ffb6ee9e4ea", "jtfsgetfilesystemproperties2322352e33f504b172413" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestreadfile.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestreadfile.json new file mode 100644 index 000000000000..6a74ba17893c --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestreadfile.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreadfile0asyncerrormappingtestreadfiled335395118d5a7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "75823295-27a8-4a2b-9ebf-1f47d1bbd5dc" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBDC9ABB7A9", + "Last-Modified" : "Tue, 10 Dec 2019 22:10:38 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e7f4ddb5-701e-00be-44a6-af5bf1000000", + "Date" : "Tue, 10 Dec 2019 22:10:37 GMT", + "x-ms-client-request-id" : "75823295-27a8-4a2b-9ebf-1f47d1bbd5dc" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreadfile1asyncerrormappingtestreadfiled3305911f7876a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7473fe05-38ff-4384-a488-65ea04e4dc38" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBDC9C44D2C", + "Last-Modified" : "Tue, 10 Dec 2019 22:10:38 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e7f4de23-701e-00be-1ba6-af5bf1000000", + "Date" : "Tue, 10 Dec 2019 22:10:37 GMT", + "x-ms-client-request-id" : "7473fe05-38ff-4384-a488-65ea04e4dc38" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreadfile1asyncerrormappingtestreadfiled3305911f7876a/javapathreadfile2asyncerrormappingtestreadfiled333422099f3", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "ed269b00-5792-4435-8af2-13d16c8f73b3" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "e7f4de60-701e-00be-51a6-af5bf1000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:e7f4de60-701e-00be-51a6-af5bf1000000\nTime:2019-12-10T22:10:38.4721499Z", + "Date" : "Tue, 10 Dec 2019 22:10:37 GMT", + "x-ms-client-request-id" : "ed269b00-5792-4435-8af2-13d16c8f73b3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsreadfile&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d9db5008-559b-4965-95ee-6ac129434dd3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e7f4deba-701e-00be-20a6-af5bf1000000", + "Body" : "jtfsreadfilejtfsreadfile0asyncerrormappingtestreadfiled335395118d5a7Tue, 10 Dec 2019 22:10:38 GMT\"0x8D77DBDC9ABB7A9\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsreadfile1asyncerrormappingtestreadfiled3305911f7876aTue, 10 Dec 2019 22:10:38 GMT\"0x8D77DBDC9C44D2C\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:10:37 GMT", + "x-ms-client-request-id" : "d9db5008-559b-4965-95ee-6ac129434dd3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreadfile0asyncerrormappingtestreadfiled335395118d5a7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "93469513-5bcd-4f41-b08d-b6c8c6cb6609" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e7f4dee7-701e-00be-49a6-af5bf1000000", + "Date" : "Tue, 10 Dec 2019 22:10:37 GMT", + "x-ms-client-request-id" : "93469513-5bcd-4f41-b08d-b6c8c6cb6609" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreadfile1asyncerrormappingtestreadfiled3305911f7876a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "097c07df-27f3-45a6-a1c6-cc2138ecf670" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e7f4defb-701e-00be-5aa6-af5bf1000000", + "Date" : "Tue, 10 Dec 2019 22:10:38 GMT", + "x-ms-client-request-id" : "097c07df-27f3-45a6-a1c6-cc2138ecf670" + }, + "Exception" : null + } ], + "variables" : [ "jtfsreadfile0asyncerrormappingtestreadfiled335395118d5a7", "jtfsreadfile1asyncerrormappingtestreadfiled3305911f7876a", "javapathreadfile2asyncerrormappingtestreadfiled333422099f3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectoryhttpproperties.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectoryhttpproperties.json new file mode 100644 index 000000000000..e1dbfc68307d --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectoryhttpproperties.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectoryhttpproperties0354466ccdff8fbaeb4?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "8f87744b-fd8d-4b81-872e-828c0049aadc" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBEDAD0F162", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944f8b3-601e-0066-11a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:15 GMT", + "x-ms-client-request-id" : "8f87744b-fd8d-4b81-872e-828c0049aadc" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectoryhttpproperties13299405c36839bf494?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "77d3ddf1-fa7a-4f24-96c6-95ee3c3840c4" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBEDAE9FC29", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:16 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944f8df-601e-0066-35a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:15 GMT", + "x-ms-client-request-id" : "77d3ddf1-fa7a-4f24-96c6-95ee3c3840c4" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectoryhttpproperties13299405c36839bf494/javapathsetdirectoryhttpproperties27207705ad77b2c2c?comp=properties", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a6a9b0a0-7ee2-41cd-acc2-f277273da618" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "4944f8fc-601e-0066-4ca7-affc20000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:4944f8fc-601e-0066-4ca7-affc20000000\nTime:2019-12-10T22:18:16.7551219Z", + "Date" : "Tue, 10 Dec 2019 22:18:15 GMT", + "x-ms-client-request-id" : "a6a9b0a0-7ee2-41cd-acc2-f277273da618", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfssetdirectoryhttpproperties&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c941c933-4169-4130-86ec-997cdcd97453" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4944f91e-601e-0066-68a7-affc20000000", + "Body" : "jtfssetdirectoryhttppropertiesjtfssetdirectoryhttpproperties0354466ccdff8fbaeb4Tue, 10 Dec 2019 22:18:16 GMT\"0x8D77DBEDAD0F162\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetdirectoryhttpproperties13299405c36839bf494Tue, 10 Dec 2019 22:18:16 GMT\"0x8D77DBEDAE9FC29\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:18:15 GMT", + "x-ms-client-request-id" : "c941c933-4169-4130-86ec-997cdcd97453", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectoryhttpproperties0354466ccdff8fbaeb4?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "9a5b6e4c-234e-4e9c-b32e-70268378cebf" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944f931-601e-0066-7aa7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:16 GMT", + "x-ms-client-request-id" : "9a5b6e4c-234e-4e9c-b32e-70268378cebf" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectoryhttpproperties13299405c36839bf494?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a39d903f-86df-407e-8c4b-cc92e09e35cd" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944f942-601e-0066-09a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:16 GMT", + "x-ms-client-request-id" : "a39d903f-86df-407e-8c4b-cc92e09e35cd" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetdirectoryhttpproperties0354466ccdff8fbaeb4", "jtfssetdirectoryhttpproperties13299405c36839bf494", "javapathsetdirectoryhttpproperties27207705ad77b2c2c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectorymetadata.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectorymetadata.json new file mode 100644 index 000000000000..13da07b38b1f --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetdirectorymetadata.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectorymetadata09644585c62a38ba8f425f?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "b7456159-388e-470d-b65d-3d7a8e09a7de" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBEC5CEB26B", + "Last-Modified" : "Tue, 10 Dec 2019 22:17:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944c1f6-601e-0066-1ca7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:17:40 GMT", + "x-ms-client-request-id" : "b7456159-388e-470d-b65d-3d7a8e09a7de" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectorymetadata104362a4763509ffbe483b?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "162bc598-653b-46a4-ab92-881b4ff2bafa" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBEC5F72948", + "Last-Modified" : "Tue, 10 Dec 2019 22:17:41 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944c261-601e-0066-7ca7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:17:40 GMT", + "x-ms-client-request-id" : "162bc598-653b-46a4-ab92-881b4ff2bafa" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectorymetadata104362a4763509ffbe483b/javapathsetdirectorymetadata2732861a8e4f2fcd4b47?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "eb10e157-3487-4597-a365-e6082452e61b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "4944c295-601e-0066-2aa7-affc20000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:4944c295-601e-0066-2aa7-affc20000000\nTime:2019-12-10T22:17:41.6523510Z", + "Date" : "Tue, 10 Dec 2019 22:17:40 GMT", + "x-ms-client-request-id" : "eb10e157-3487-4597-a365-e6082452e61b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfssetdirectorymetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "63f8b2be-91f3-4a63-b007-82a1ebb2fed1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4944c2ce-601e-0066-5ca7-affc20000000", + "Body" : "jtfssetdirectorymetadatajtfssetdirectorymetadata09644585c62a38ba8f425fTue, 10 Dec 2019 22:17:41 GMT\"0x8D77DBEC5CEB26B\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetdirectorymetadata104362a4763509ffbe483bTue, 10 Dec 2019 22:17:41 GMT\"0x8D77DBEC5F72948\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:17:40 GMT", + "x-ms-client-request-id" : "63f8b2be-91f3-4a63-b007-82a1ebb2fed1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectorymetadata09644585c62a38ba8f425f?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "3fa9b8ea-5975-421d-857d-59c66bea3b9e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944c2f3-601e-0066-7da7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:17:41 GMT", + "x-ms-client-request-id" : "3fa9b8ea-5975-421d-857d-59c66bea3b9e" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetdirectorymetadata104362a4763509ffbe483b?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "b9a8a0b7-1437-4649-8f04-2f216405298d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944c317-601e-0066-1ba7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:17:41 GMT", + "x-ms-client-request-id" : "b9a8a0b7-1437-4649-8f04-2f216405298d" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetdirectorymetadata09644585c62a38ba8f425f", "jtfssetdirectorymetadata104362a4763509ffbe483b", "javapathsetdirectorymetadata2732861a8e4f2fcd4b47" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilehttpproperties.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilehttpproperties.json new file mode 100644 index 000000000000..662af99dc37e --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilehttpproperties.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilehttpproperties037341d629819ca0a04dc4?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7af0db4d-fdad-4526-9573-0f2f407ee9f6" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBE6198539A", + "Last-Modified" : "Tue, 10 Dec 2019 22:14:53 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4943cc30-601e-0066-6da7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:14:52 GMT", + "x-ms-client-request-id" : "7af0db4d-fdad-4526-9573-0f2f407ee9f6" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilehttpproperties183086b7e4fd92426248e8?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "886e5b82-df90-4c6f-a8b5-f73c4a6f3ed7" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBE61BA1276", + "Last-Modified" : "Tue, 10 Dec 2019 22:14:53 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4943cc88-601e-0066-36a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:14:52 GMT", + "x-ms-client-request-id" : "886e5b82-df90-4c6f-a8b5-f73c4a6f3ed7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilehttpproperties183086b7e4fd92426248e8/javapathsetfilehttpproperties2456071a16bec8d0b44e?comp=properties", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "e90ab8ed-9c57-4cb4-beea-450f6ce1a2a6" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "4943cca8-601e-0066-4da7-affc20000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:4943cca8-601e-0066-4da7-affc20000000\nTime:2019-12-10T22:14:53.4948487Z", + "Date" : "Tue, 10 Dec 2019 22:14:53 GMT", + "x-ms-client-request-id" : "e90ab8ed-9c57-4cb4-beea-450f6ce1a2a6", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfssetfilehttpproperties&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a6ed7bdf-7b96-419c-90c2-b0bedaa5e3b1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4943ccd0-601e-0066-6fa7-affc20000000", + "Body" : "jtfssetfilehttppropertiesjtfssetfilehttpproperties037341d629819ca0a04dc4Tue, 10 Dec 2019 22:14:53 GMT\"0x8D77DBE6198539A\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetfilehttpproperties183086b7e4fd92426248e8Tue, 10 Dec 2019 22:14:53 GMT\"0x8D77DBE61BA1276\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:14:53 GMT", + "x-ms-client-request-id" : "a6ed7bdf-7b96-419c-90c2-b0bedaa5e3b1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilehttpproperties037341d629819ca0a04dc4?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a7fcd91b-0339-441b-86ca-29a785f848ef" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4943cce3-601e-0066-80a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:14:53 GMT", + "x-ms-client-request-id" : "a7fcd91b-0339-441b-86ca-29a785f848ef" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilehttpproperties183086b7e4fd92426248e8?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "556ee871-5cd9-4ed6-a563-8883079c6bce" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4943cd02-601e-0066-1ba7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:14:53 GMT", + "x-ms-client-request-id" : "556ee871-5cd9-4ed6-a563-8883079c6bce" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetfilehttpproperties037341d629819ca0a04dc4", "jtfssetfilehttpproperties183086b7e4fd92426248e8", "javapathsetfilehttpproperties2456071a16bec8d0b44e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilemetadata.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilemetadata.json new file mode 100644 index 000000000000..365e82cc6e0b --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilemetadata.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilemetadata06388431f266d378c044f5ae0?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "b42dd3a9-8dd6-4608-879c-bdb9fd489053" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBED79DBB28", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944f10e-601e-0066-1ea7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "b42dd3a9-8dd6-4608-879c-bdb9fd489053" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilemetadata1050001ec8a0f823d54d1eb1d?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "132a6a7f-d562-4f5c-98e0-339096e635b5" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBED7B6ED0B", + "Last-Modified" : "Tue, 10 Dec 2019 22:18:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "4944f15c-601e-0066-63a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "132a6a7f-d562-4f5c-98e0-339096e635b5" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilemetadata1050001ec8a0f823d54d1eb1d/javapathsetfilemetadata22580087a638649b284bea8?comp=metadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "6bc069e3-e637-422c-adc2-16fdc14bd5c2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "4944f184-601e-0066-08a7-affc20000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:4944f184-601e-0066-08a7-affc20000000\nTime:2019-12-10T22:18:11.3893383Z", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "6bc069e3-e637-422c-adc2-16fdc14bd5c2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfssetfilemetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "b00147bf-c803-4953-88e9-0a12ca9eca80" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "4944f1ad-601e-0066-2ba7-affc20000000", + "Body" : "jtfssetfilemetadatajtfssetfilemetadata06388431f266d378c044f5ae0Tue, 10 Dec 2019 22:18:11 GMT\"0x8D77DBED79DBB28\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetfilemetadata1050001ec8a0f823d54d1eb1dTue, 10 Dec 2019 22:18:11 GMT\"0x8D77DBED7B6ED0B\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "b00147bf-c803-4953-88e9-0a12ca9eca80", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilemetadata06388431f266d378c044f5ae0?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a5be83c4-14f4-4f5d-90d9-d8387c22f87e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944f1cb-601e-0066-49a7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "a5be83c4-14f4-4f5d-90d9-d8387c22f87e" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilemetadata1050001ec8a0f823d54d1eb1d?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "bd304768-8fed-4e0a-9493-796934fab11b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "4944f1df-601e-0066-5aa7-affc20000000", + "Date" : "Tue, 10 Dec 2019 22:18:10 GMT", + "x-ms-client-request-id" : "bd304768-8fed-4e0a-9493-796934fab11b" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetfilemetadata06388431f266d378c044f5ae0", "jtfssetfilemetadata1050001ec8a0f823d54d1eb1d", "javapathsetfilemetadata22580087a638649b284bea8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemaccesspolicy.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemaccesspolicy.json new file mode 100644 index 000000000000..8aa65daf8578 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemaccesspolicy.json @@ -0,0 +1,128 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfssetfilesystemaccesspolicy091719f3226da9e92545?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "2133405a-1385-4223-9251-18cb4b80230b" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77E5A4A4D4A33", + "Last-Modified" : "Wed, 11 Dec 2019 16:50:55 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "07c578f0-e01e-0092-3c43-b0d9cc000000", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "2133405a-1385-4223-9251-18cb4b80230b" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfssetfilesystemaccesspolicy185772a05001dad96649?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "ec77b1c2-ba10-4da7-abf6-0d8359989638" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77E5A4A685122", + "Last-Modified" : "Wed, 11 Dec 2019 16:50:55 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "07c5796d-e01e-0092-2d43-b0d9cc000000", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "ec77b1c2-ba10-4da7-abf6-0d8359989638" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfssetfilesystemaccesspolicy27319595b82ed55c5045?restype=container&comp=acl", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d0731857-0c71-4b58-84c4-cdb519ebde71", + "Content-Type" : "application/xml; charset=utf-8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "07c579cc-e01e-0092-0843-b0d9cc000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:07c579cc-e01e-0092-0843-b0d9cc000000\nTime:2019-12-11T16:50:55.8022342Z", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "d0731857-0c71-4b58-84c4-cdb519ebde71", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://gaprahns.blob.core.windows.net?prefix=jtfssetfilesystemaccesspolicy&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "86b3d905-ee0b-4803-b705-4636206ab5c4" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "07c57a18-e01e-0092-4943-b0d9cc000000", + "Body" : "jtfssetfilesystemaccesspolicyjtfssetfilesystemaccesspolicy091719f3226da9e92545Wed, 11 Dec 2019 16:50:55 GMT\"0x8D77E5A4A4D4A33\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetfilesystemaccesspolicy185772a05001dad96649Wed, 11 Dec 2019 16:50:55 GMT\"0x8D77E5A4A685122\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "86b3d905-ee0b-4803-b705-4636206ab5c4", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfssetfilesystemaccesspolicy091719f3226da9e92545?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "cfec19ec-e1b3-4c30-8572-7648cef6d704" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "07c57a2e-e01e-0092-5d43-b0d9cc000000", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "cfec19ec-e1b3-4c30-8572-7648cef6d704" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "https://gaprahns.blob.core.windows.net/jtfssetfilesystemaccesspolicy185772a05001dad96649?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "566a8362-43c9-404b-bc85-bc6eeae245e0" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "07c57a42-e01e-0092-6e43-b0d9cc000000", + "Date" : "Wed, 11 Dec 2019 16:50:55 GMT", + "x-ms-client-request-id" : "566a8362-43c9-404b-bc85-bc6eeae245e0" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetfilesystemaccesspolicy091719f3226da9e92545", "jtfssetfilesystemaccesspolicy185772a05001dad96649", "jtfssetfilesystemaccesspolicy27319595b82ed55c5045" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemmetadata.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemmetadata.json new file mode 100644 index 000000000000..1dd7944a57f3 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/AsyncErrorMappingTestsetfilesystemmetadata.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilesystemmetadata0722556a05518252de4cd0?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "3ad8321b-1a5b-4526-8f82-81e3afd4f40c" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBF6613E7C1", + "Last-Modified" : "Tue, 10 Dec 2019 22:22:10 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e27185bb-401e-0017-40a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:22:09 GMT", + "x-ms-client-request-id" : "3ad8321b-1a5b-4526-8f82-81e3afd4f40c" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilesystemmetadata1793568b28d792245d41b7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "0693d7e0-9a86-4dfa-8bac-5a5510e23100" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DBF662EA081", + "Last-Modified" : "Tue, 10 Dec 2019 22:22:10 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e27185f7-401e-0017-6fa8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:22:09 GMT", + "x-ms-client-request-id" : "0693d7e0-9a86-4dfa-8bac-5a5510e23100" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilesystemmetadata2491059416a78e8bad4da9?restype=container&comp=metadata", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "05be8e55-3fe9-4b9a-a0a0-680dc3aea6a3" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ContainerNotFound", + "retry-after" : "0", + "Content-Length" : "225", + "StatusCode" : "404", + "x-ms-request-id" : "e2718614-401e-0017-08a8-af8e19000000", + "Body" : "ContainerNotFoundThe specified container does not exist.\nRequestId:e2718614-401e-0017-08a8-af8e19000000\nTime:2019-12-10T22:22:10.3772540Z", + "Date" : "Tue, 10 Dec 2019 22:22:09 GMT", + "x-ms-client-request-id" : "05be8e55-3fe9-4b9a-a0a0-680dc3aea6a3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfssetfilesystemmetadata&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "5859b644-1495-456e-b08e-dac3b998e7ef" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "e271863a-401e-0017-25a8-af8e19000000", + "Body" : "jtfssetfilesystemmetadatajtfssetfilesystemmetadata0722556a05518252de4cd0Tue, 10 Dec 2019 22:22:10 GMT\"0x8D77DBF6613E7C1\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfssetfilesystemmetadata1793568b28d792245d41b7Tue, 10 Dec 2019 22:22:10 GMT\"0x8D77DBF662EA081\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:22:09 GMT", + "x-ms-client-request-id" : "5859b644-1495-456e-b08e-dac3b998e7ef", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilesystemmetadata0722556a05518252de4cd0?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "79257cc7-357f-4adc-85a3-d2e0b3a22966" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e271864d-401e-0017-35a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:22:10 GMT", + "x-ms-client-request-id" : "79257cc7-357f-4adc-85a3-d2e0b3a22966" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfssetfilesystemmetadata1793568b28d792245d41b7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d43e7ab7-d509-4a17-a865-d38077dcf18c" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "e2718664-401e-0017-47a8-af8e19000000", + "Date" : "Tue, 10 Dec 2019 22:22:10 GMT", + "x-ms-client-request-id" : "d43e7ab7-d509-4a17-a865-d38077dcf18c" + }, + "Exception" : null + } ], + "variables" : [ "jtfssetfilesystemmetadata0722556a05518252de4cd0", "jtfssetfilesystemmetadata1793568b28d792245d41b7", "jtfssetfilesystemmetadata2491059416a78e8bad4da9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestacquirelease.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestacquirelease.json new file mode 100644 index 000000000000..aae4d59aa87e --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestacquirelease.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsacquirelease02113312720c122e6144a9a1b3?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d885cc46-ec44-4be2-a481-d677338d332a" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC12D9CAF8D", + "Last-Modified" : "Tue, 10 Dec 2019 22:34:54 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa5d3b-201e-00e9-3aaa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "d885cc46-ec44-4be2-a481-d677338d332a" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsacquirelease16852841b3c19937864b2fa0f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "a524718c-9dbc-4024-adf8-8673680cff35" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC12DC37166", + "Last-Modified" : "Tue, 10 Dec 2019 22:34:54 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa5dda-201e-00e9-48aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "a524718c-9dbc-4024-adf8-8673680cff35" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsacquirelease16852841b3c19937864b2fa0f7/javapathacquirelease28717976ee780e23db4febaa?comp=lease", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-file-datalake/12.0.0-preview.7 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "8db5cb13-e462-44c1-9be3-1975456e047f" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "InvalidHeaderValue", + "retry-after" : "0", + "Content-Length" : "328", + "StatusCode" : "400", + "x-ms-request-id" : "80aa5e2f-201e-00e9-18aa-afb27c000000", + "Body" : "InvalidHeaderValueThe value for one of the HTTP headers is not in the correct format.\nRequestId:80aa5e2f-201e-00e9-18aa-afb27c000000\nTime:2019-12-10T22:34:54.7347941Zx-ms-lease-duration-10", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "8db5cb13-e462-44c1-9be3-1975456e047f", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsacquirelease&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7db20438-3a9d-476c-90b2-ed9424d991cd" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "80aa5e6e-201e-00e9-56aa-afb27c000000", + "Body" : "jtfsacquireleasejtfsacquirelease02113312720c122e6144a9a1b3Tue, 10 Dec 2019 22:34:54 GMT\"0x8D77DC12D9CAF8D\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsacquirelease16852841b3c19937864b2fa0f7Tue, 10 Dec 2019 22:34:54 GMT\"0x8D77DC12DC37166\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "7db20438-3a9d-476c-90b2-ed9424d991cd", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsacquirelease02113312720c122e6144a9a1b3?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "894accc7-e709-42c1-a2f1-ec4bfa958945" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa5e8f-201e-00e9-76aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "894accc7-e709-42c1-a2f1-ec4bfa958945" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsacquirelease16852841b3c19937864b2fa0f7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "2f7dd999-eea6-4fbc-b022-eab05f89d7c0" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa5eb2-201e-00e9-18aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:54 GMT", + "x-ms-client-request-id" : "2f7dd999-eea6-4fbc-b022-eab05f89d7c0" + }, + "Exception" : null + } ], + "variables" : [ "jtfsacquirelease02113312720c122e6144a9a1b3", "jtfsacquirelease16852841b3c19937864b2fa0f7", "javapathacquirelease28717976ee780e23db4febaa" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestbreaklease.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestbreaklease.json new file mode 100644 index 000000000000..49f96101dcae --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestbreaklease.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsbreaklease0leaseasyncerrormappingtestbreaklease7b15307458?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "05bdd149-4d39-467c-8a1f-35aa0a1991f8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC15BB01D26", + "Last-Modified" : "Tue, 10 Dec 2019 22:36:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80ab00da-201e-00e9-67aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "05bdd149-4d39-467c-8a1f-35aa0a1991f8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsbreaklease1leaseasyncerrormappingtestbreaklease7b12340351?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "512ba361-411d-426e-82d4-6868ed9c304e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC15BC81247", + "Last-Modified" : "Tue, 10 Dec 2019 22:36:11 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80ab013c-201e-00e9-41aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "512ba361-411d-426e-82d4-6868ed9c304e" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsbreaklease1leaseasyncerrormappingtestbreaklease7b12340351/javapathbreaklease29497173800ab772ec4bc4a59?comp=lease", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-file-datalake/12.0.0-preview.7 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d2e6c18e-c807-4f3e-9074-369608f1acc8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "80ab017c-201e-00e9-7eaa-afb27c000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:80ab017c-201e-00e9-7eaa-afb27c000000\nTime:2019-12-10T22:36:11.9843201Z", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "d2e6c18e-c807-4f3e-9074-369608f1acc8", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsbreaklease&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "987011c1-1993-4839-ab91-1d857534da6e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "80ab01c7-201e-00e9-40aa-afb27c000000", + "Body" : "jtfsbreakleasejtfsbreaklease0leaseasyncerrormappingtestbreaklease7b15307458Tue, 10 Dec 2019 22:36:11 GMT\"0x8D77DC15BB01D26\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsbreaklease1leaseasyncerrormappingtestbreaklease7b12340351Tue, 10 Dec 2019 22:36:11 GMT\"0x8D77DC15BC81247\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "987011c1-1993-4839-ab91-1d857534da6e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsbreaklease0leaseasyncerrormappingtestbreaklease7b15307458?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c3494482-66a4-4614-b0b8-8063e0150357" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80ab01ea-201e-00e9-5faa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "c3494482-66a4-4614-b0b8-8063e0150357" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsbreaklease1leaseasyncerrormappingtestbreaklease7b12340351?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c85b26c9-a881-4c78-bbc7-fb2dfc7a3b4a" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80ab0206-201e-00e9-79aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:36:11 GMT", + "x-ms-client-request-id" : "c85b26c9-a881-4c78-bbc7-fb2dfc7a3b4a" + }, + "Exception" : null + } ], + "variables" : [ "jtfsbreaklease0leaseasyncerrormappingtestbreaklease7b15307458", "jtfsbreaklease1leaseasyncerrormappingtestbreaklease7b12340351", "javapathbreaklease29497173800ab772ec4bc4a59" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestchangelease.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestchangelease.json new file mode 100644 index 000000000000..f140a4fa4632 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestchangelease.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfschangelease0leaseasyncerrormappingtestchangeleaseaea163808?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "f518f3ca-4335-4e15-a85a-bd610e2e71c8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC14E1A913C", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:48 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aace8d-201e-00e9-80aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:48 GMT", + "x-ms-client-request-id" : "f518f3ca-4335-4e15-a85a-bd610e2e71c8" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfschangelease1leaseasyncerrormappingtestchangeleaseaea16133a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "079a95b5-e8f2-4dc7-9b72-f82cdd708790" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC14E33709E", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:49 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aacee7-201e-00e9-4aaa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:48 GMT", + "x-ms-client-request-id" : "079a95b5-e8f2-4dc7-9b72-f82cdd708790" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfschangelease1leaseasyncerrormappingtestchangeleaseaea16133a/javapathchangelease254080bee61464ab3f4e05834?comp=lease", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-file-datalake/12.0.0-preview.7 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "659247e2-d81c-4ea5-b029-83eddade3e42" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "MissingRequiredHeader", + "retry-after" : "0", + "Content-Length" : "303", + "StatusCode" : "400", + "x-ms-request-id" : "80aacf30-201e-00e9-0baa-afb27c000000", + "Body" : "MissingRequiredHeaderAn HTTP header that's mandatory for this request is not specified.\nRequestId:80aacf30-201e-00e9-0baa-afb27c000000\nTime:2019-12-10T22:35:49.1648670Zx-ms-proposed-lease-id", + "Date" : "Tue, 10 Dec 2019 22:35:48 GMT", + "x-ms-client-request-id" : "659247e2-d81c-4ea5-b029-83eddade3e42", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfschangelease&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "75e7bc29-95f5-43b8-b581-d3edee514f5b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "80aacf7d-201e-00e9-4eaa-afb27c000000", + "Body" : "jtfschangeleasejtfschangelease0leaseasyncerrormappingtestchangeleaseaea163808Tue, 10 Dec 2019 22:35:48 GMT\"0x8D77DC14E1A913C\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfschangelease1leaseasyncerrormappingtestchangeleaseaea16133aTue, 10 Dec 2019 22:35:49 GMT\"0x8D77DC14E33709E\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:35:48 GMT", + "x-ms-client-request-id" : "75e7bc29-95f5-43b8-b581-d3edee514f5b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfschangelease0leaseasyncerrormappingtestchangeleaseaea163808?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "30b707ae-58fc-4943-89a1-bff04ca634f6" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aacfa7-201e-00e9-73aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:49 GMT", + "x-ms-client-request-id" : "30b707ae-58fc-4943-89a1-bff04ca634f6" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfschangelease1leaseasyncerrormappingtestchangeleaseaea16133a?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "499abe5b-38b6-4e7e-9513-d0113f1df7c2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aacfc1-201e-00e9-0aaa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:49 GMT", + "x-ms-client-request-id" : "499abe5b-38b6-4e7e-9513-d0113f1df7c2" + }, + "Exception" : null + } ], + "variables" : [ "jtfschangelease0leaseasyncerrormappingtestchangeleaseaea163808", "jtfschangelease1leaseasyncerrormappingtestchangeleaseaea16133a", "javapathchangelease254080bee61464ab3f4e05834" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestreleaselease.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestreleaselease.json new file mode 100644 index 000000000000..1dbca91af79c --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestreleaselease.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreleaselease028489a8d46f945851407b9de7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d3a19b25-37f1-4303-a2dc-961e7aa364e7" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC13FBE5909", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:24 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa9bc2-201e-00e9-50aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:24 GMT", + "x-ms-client-request-id" : "d3a19b25-37f1-4303-a2dc-961e7aa364e7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreleaselease1904156d22e1f8f03e47e5ac2e?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "1893d59c-e34a-4322-8344-edf65232a941" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC13FD8E5E3", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:24 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa9c15-201e-00e9-13aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:24 GMT", + "x-ms-client-request-id" : "1893d59c-e34a-4322-8344-edf65232a941" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreleaselease1904156d22e1f8f03e47e5ac2e/javapathreleaselease279161810d2baa1830465097?comp=lease", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-file-datalake/12.0.0-preview.7 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "387a1dc6-98c5-4253-96e4-4855beba368e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "80aa9c5b-201e-00e9-4daa-afb27c000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:80aa9c5b-201e-00e9-4daa-afb27c000000\nTime:2019-12-10T22:35:25.1133956Z", + "Date" : "Tue, 10 Dec 2019 22:35:24 GMT", + "x-ms-client-request-id" : "387a1dc6-98c5-4253-96e4-4855beba368e", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsreleaselease&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "ac741296-802b-4197-b5a5-d4fd917850a6" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "80aa9cbc-201e-00e9-26aa-afb27c000000", + "Body" : "jtfsreleaseleasejtfsreleaselease028489a8d46f945851407b9de7Tue, 10 Dec 2019 22:35:24 GMT\"0x8D77DC13FBE5909\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsreleaselease1904156d22e1f8f03e47e5ac2eTue, 10 Dec 2019 22:35:24 GMT\"0x8D77DC13FD8E5E3\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:35:24 GMT", + "x-ms-client-request-id" : "ac741296-802b-4197-b5a5-d4fd917850a6", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreleaselease028489a8d46f945851407b9de7?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d3a1323c-8899-46a9-b38b-b07937812733" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa9cff-201e-00e9-64aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:25 GMT", + "x-ms-client-request-id" : "d3a1323c-8899-46a9-b38b-b07937812733" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsreleaselease1904156d22e1f8f03e47e5ac2e?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "15191cd6-7969-4bea-9ed4-d1a33a76c8d2" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa9d1a-201e-00e9-7faa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:25 GMT", + "x-ms-client-request-id" : "15191cd6-7969-4bea-9ed4-d1a33a76c8d2" + }, + "Exception" : null + } ], + "variables" : [ "jtfsreleaselease028489a8d46f945851407b9de7", "jtfsreleaselease1904156d22e1f8f03e47e5ac2e", "javapathreleaselease279161810d2baa1830465097" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestrenewlease.json b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestrenewlease.json new file mode 100644 index 000000000000..9b2fdf3d2c32 --- /dev/null +++ b/sdk/storage/azure-storage-file-datalake/src/test/resources/session-records/LeaseAsyncErrorMappingTestrenewlease.json @@ -0,0 +1,127 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsrenewlease0leaseasyncerrormappingtestrenewleasec7e26581fc?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "c027df60-0e56-432b-81b9-4e6cd2e17bb0" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC1310692A8", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:00 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa6976-201e-00e9-31aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:59 GMT", + "x-ms-client-request-id" : "c027df60-0e56-432b-81b9-4e6cd2e17bb0" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsrenewlease1leaseasyncerrormappingtestrenewleasec7e7174173?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "7e826641-2592-4711-a4f8-bad1dbf0515e" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "ETag" : "0x8D77DC1311FE727", + "Last-Modified" : "Tue, 10 Dec 2019 22:35:00 GMT", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80aa69cd-201e-00e9-7caa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:34:59 GMT", + "x-ms-client-request-id" : "7e826641-2592-4711-a4f8-bad1dbf0515e" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsrenewlease1leaseasyncerrormappingtestrenewleasec7e7174173/javapathrenewlease2284788d0fc3edc1f741febb4?comp=lease", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-file-datalake/12.0.0-preview.7 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "06a23a8e-d5bf-4bff-9ac4-d7779810135d" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "BlobNotFound", + "retry-after" : "0", + "Content-Length" : "215", + "StatusCode" : "404", + "x-ms-request-id" : "80aa6a0b-201e-00e9-36aa-afb27c000000", + "Body" : "BlobNotFoundThe specified blob does not exist.\nRequestId:80aa6a0b-201e-00e9-36aa-afb27c000000\nTime:2019-12-10T22:35:00.4409099Z", + "Date" : "Tue, 10 Dec 2019 22:35:00 GMT", + "x-ms-client-request-id" : "06a23a8e-d5bf-4bff-9ac4-d7779810135d", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://gaprahns.blob.core.windows.net?prefix=jtfsrenewlease&comp=list", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "d96c194f-18cc-4be9-b85e-c874de105ed2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "200", + "x-ms-request-id" : "80aa6a93-201e-00e9-2baa-afb27c000000", + "Body" : "jtfsrenewleasejtfsrenewlease0leaseasyncerrormappingtestrenewleasec7e26581fcTue, 10 Dec 2019 22:35:00 GMT\"0x8D77DC1310692A8\"unlockedavailable$account-encryption-keyfalsefalsefalsejtfsrenewlease1leaseasyncerrormappingtestrenewleasec7e7174173Tue, 10 Dec 2019 22:35:00 GMT\"0x8D77DC1311FE727\"unlockedavailable$account-encryption-keyfalsefalsefalse", + "Date" : "Tue, 10 Dec 2019 22:35:00 GMT", + "x-ms-client-request-id" : "d96c194f-18cc-4be9-b85e-c874de105ed2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsrenewlease0leaseasyncerrormappingtestrenewleasec7e26581fc?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "306233cb-54fc-444f-aa6b-a6ecc49b6c7a" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa6af9-201e-00e9-01aa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:00 GMT", + "x-ms-client-request-id" : "306233cb-54fc-444f-aa6b-a6ecc49b6c7a" + }, + "Exception" : null + }, { + "Method" : "DELETE", + "Uri" : "http://gaprahns.blob.core.windows.net/jtfsrenewlease1leaseasyncerrormappingtestrenewleasec7e7174173?restype=container", + "Headers" : { + "x-ms-version" : "2019-02-02", + "User-Agent" : "azsdk-java-azure-storage-blob/12.2.0-beta.1 (11.0.4; Windows 10 10.0)", + "x-ms-client-request-id" : "9988c81e-808b-4a01-ada7-b12e51fcaec8" + }, + "Response" : { + "x-ms-version" : "2019-02-02", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "Content-Length" : "0", + "StatusCode" : "202", + "x-ms-request-id" : "80aa6b27-201e-00e9-2baa-afb27c000000", + "Date" : "Tue, 10 Dec 2019 22:35:00 GMT", + "x-ms-client-request-id" : "9988c81e-808b-4a01-ada7-b12e51fcaec8" + }, + "Exception" : null + } ], + "variables" : [ "jtfsrenewlease0leaseasyncerrormappingtestrenewleasec7e26581fc", "jtfsrenewlease1leaseasyncerrormappingtestrenewleasec7e7174173", "javapathrenewlease2284788d0fc3edc1f741febb4" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-file-datalake/swagger/README.md b/sdk/storage/azure-storage-file-datalake/swagger/README.md index 123efeb117d2..a04e654eb5d5 100644 --- a/sdk/storage/azure-storage-file-datalake/swagger/README.md +++ b/sdk/storage/azure-storage-file-datalake/swagger/README.md @@ -157,5 +157,47 @@ directive: return $.replace('@JsonProperty(value = "eTag")\n private String eTag;', '@JsonProperty(value = "etag")\n private String eTag;'); ``` +### Change StorageErrorException to StorageException +``` yaml +directive: +- from: ServicesImpl.java + where: $ + transform: > + return $. + replace( + "com.azure.storage.file.datalake.implementation.models.StorageErrorException", + "com.azure.storage.file.datalake.models.DataLakeStorageException" + ). + replace( + /\@UnexpectedResponseExceptionType\(StorageErrorException\.class\)/g, + "@UnexpectedResponseExceptionType(DataLakeStorageException.class)" + ); +- from: FileSystemsImpl.java + where: $ + transform: > + return $. + replace( + "com.azure.storage.file.datalake.implementation.models.StorageErrorException", + "com.azure.storage.file.datalake.models.DataLakeStorageException" + ). + replace( + /\@UnexpectedResponseExceptionType\(StorageErrorException\.class\)/g, + "@UnexpectedResponseExceptionType(DataLakeStorageException.class)" + ); +- from: PathsImpl.java + where: $ + transform: > + return $. + replace( + "com.azure.storage.file.datalake.implementation.models.StorageErrorException", + "com.azure.storage.file.datalake.models.DataLakeStorageException" + ). + replace( + /\@UnexpectedResponseExceptionType\(StorageErrorException\.class\)/g, + "@UnexpectedResponseExceptionType(DataLakeStorageException.class)" + ); +``` + + ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-file-datalake%2Fswagger%2FREADME.png)