From f9633f9f07dd3bf00c7c3994152fc5ce699348f7 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 22 Mar 2022 16:53:22 -0700 Subject: [PATCH 01/19] Generated code --- .../blob/implementation/AppendBlobsImpl.java | 8 +- .../AzureBlobStorageImplBuilder.java | 40 ++- .../blob/implementation/BlobsImpl.java | 54 +-- .../blob/implementation/BlockBlobsImpl.java | 18 +- .../blob/implementation/ContainersImpl.java | 40 +-- .../blob/implementation/PageBlobsImpl.java | 317 +++++++++++++++--- .../blob/implementation/ServicesImpl.java | 18 +- .../models/BlobCopySourceTags.java | 47 +++ ...PageBlobsGetPageRangesDiffNextHeaders.java | 212 ++++++++++++ ...ageBlobsGetPageRangesDiffNextResponse.java | 37 ++ .../PageBlobsGetPageRangesDiffResponse.java | 7 +- .../PageBlobsGetPageRangesNextHeaders.java | 212 ++++++++++++ .../PageBlobsGetPageRangesNextResponse.java | 37 ++ .../PageBlobsGetPageRangesResponse.java | 8 +- .../models/PageListCollection.java | 69 ++++ .../storage/blob/models/BlobErrorCode.java | 9 +- .../azure/storage/blob/models/PageList.java | 26 ++ .../blob/specialized/BlobAsyncClientBase.java | 2 +- .../specialized/BlockBlobAsyncClient.java | 4 +- .../blob/specialized/PageBlobAsyncClient.java | 14 +- .../azure-storage-blob/swagger/README.md | 46 +++ 21 files changed, 1079 insertions(+), 146 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobCopySourceTags.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextHeaders.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextResponse.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextHeaders.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextResponse.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java index b186a132ba5b5..57c80fade816e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java @@ -222,7 +222,7 @@ Mono seal( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( @@ -377,7 +377,7 @@ public Mono createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono appendBlockWithResponseAsync( @@ -505,7 +505,7 @@ public Mono appendBlockWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono appendBlockFromUrlWithResponseAsync( @@ -629,7 +629,7 @@ public Mono appendBlockFromUrlWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono sealWithResponseAsync( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java index c71233fd7b55a..60b54270333b7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java @@ -4,6 +4,7 @@ package com.azure.storage.blob.implementation; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; @@ -32,13 +33,14 @@ /** A builder for creating a new instance of the AzureBlobStorage type. */ @ServiceClientBuilder(serviceClients = {AzureBlobStorageImpl.class}) public final class AzureBlobStorageImplBuilder { - private static final String SDK_NAME = "name"; + @Generated private static final String SDK_NAME = "name"; - private static final String SDK_VERSION = "version"; + @Generated private static final String SDK_VERSION = "version"; - private final Map properties = new HashMap<>(); + @Generated private final Map properties = new HashMap<>(); /** Create an instance of the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder() { this.pipelinePolicies = new ArrayList<>(); } @@ -47,7 +49,7 @@ public AzureBlobStorageImplBuilder() { * The URL of the service account, container, or blob that is the target of * the desired operation. */ - private String url; + @Generated private String url; /** * Sets The URL of the service account, container, or blob that is the target of the desired operation. @@ -55,6 +57,7 @@ public AzureBlobStorageImplBuilder() { * @param url the url value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder url(String url) { this.url = url; return this; @@ -63,7 +66,7 @@ public AzureBlobStorageImplBuilder url(String url) { /* * Specifies the version of the operation to use for this request. */ - private String version; + @Generated private String version; /** * Sets Specifies the version of the operation to use for this request. @@ -71,6 +74,7 @@ public AzureBlobStorageImplBuilder url(String url) { * @param version the version value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder version(String version) { this.version = version; return this; @@ -79,7 +83,7 @@ public AzureBlobStorageImplBuilder version(String version) { /* * The HTTP pipeline to send requests through */ - private HttpPipeline pipeline; + @Generated private HttpPipeline pipeline; /** * Sets The HTTP pipeline to send requests through. @@ -87,6 +91,7 @@ public AzureBlobStorageImplBuilder version(String version) { * @param pipeline the pipeline value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; @@ -95,7 +100,7 @@ public AzureBlobStorageImplBuilder pipeline(HttpPipeline pipeline) { /* * The serializer to serialize an object into a string */ - private SerializerAdapter serializerAdapter; + @Generated private SerializerAdapter serializerAdapter; /** * Sets The serializer to serialize an object into a string. @@ -103,6 +108,7 @@ public AzureBlobStorageImplBuilder pipeline(HttpPipeline pipeline) { * @param serializerAdapter the serializerAdapter value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; @@ -111,7 +117,7 @@ public AzureBlobStorageImplBuilder serializerAdapter(SerializerAdapter serialize /* * The HTTP client used to send the request. */ - private HttpClient httpClient; + @Generated private HttpClient httpClient; /** * Sets The HTTP client used to send the request. @@ -119,6 +125,7 @@ public AzureBlobStorageImplBuilder serializerAdapter(SerializerAdapter serialize * @param httpClient the httpClient value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { this.httpClient = httpClient; return this; @@ -128,7 +135,7 @@ public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { * The configuration store that is used during construction of the service * client. */ - private Configuration configuration; + @Generated private Configuration configuration; /** * Sets The configuration store that is used during construction of the service client. @@ -136,6 +143,7 @@ public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { * @param configuration the configuration value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; @@ -144,7 +152,7 @@ public AzureBlobStorageImplBuilder configuration(Configuration configuration) { /* * The logging configuration for HTTP requests and responses. */ - private HttpLogOptions httpLogOptions; + @Generated private HttpLogOptions httpLogOptions; /** * Sets The logging configuration for HTTP requests and responses. @@ -152,6 +160,7 @@ public AzureBlobStorageImplBuilder configuration(Configuration configuration) { * @param httpLogOptions the httpLogOptions value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { this.httpLogOptions = httpLogOptions; return this; @@ -161,7 +170,7 @@ public AzureBlobStorageImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) * The retry policy that will attempt to retry failed requests, if * applicable. */ - private RetryPolicy retryPolicy; + @Generated private RetryPolicy retryPolicy; /** * Sets The retry policy that will attempt to retry failed requests, if applicable. @@ -169,6 +178,7 @@ public AzureBlobStorageImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) * @param retryPolicy the retryPolicy value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) { this.retryPolicy = retryPolicy; return this; @@ -177,13 +187,13 @@ public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) { /* * The list of Http pipeline policies to add. */ - private final List pipelinePolicies; + @Generated private final List pipelinePolicies; /* * The client options such as application ID and custom headers to set on a * request. */ - private ClientOptions clientOptions; + @Generated private ClientOptions clientOptions; /** * Sets The client options such as application ID and custom headers to set on a request. @@ -191,6 +201,7 @@ public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) { * @param clientOptions the clientOptions value. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder clientOptions(ClientOptions clientOptions) { this.clientOptions = clientOptions; return this; @@ -202,6 +213,7 @@ public AzureBlobStorageImplBuilder clientOptions(ClientOptions clientOptions) { * @param customPolicy The custom Http pipeline policy to add. * @return the AzureBlobStorageImplBuilder. */ + @Generated public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { pipelinePolicies.add(customPolicy); return this; @@ -212,6 +224,7 @@ public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { * * @return an instance of AzureBlobStorageImpl. */ + @Generated public AzureBlobStorageImpl buildClient() { if (version == null) { this.version = "2021-04-10"; @@ -226,6 +239,7 @@ public AzureBlobStorageImpl buildClient() { return client; } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index bd8dd0e714dae..c0604daf9d658 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -25,6 +25,7 @@ import com.azure.core.util.Base64Util; import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; +import com.azure.storage.blob.implementation.models.BlobCopySourceTags; import com.azure.storage.blob.implementation.models.BlobDeleteType; import com.azure.storage.blob.implementation.models.BlobExpiryOptions; import com.azure.storage.blob.implementation.models.BlobTags; @@ -486,6 +487,7 @@ Mono copyFromURL( @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("x-ms-encryption-scope") String encryptionScope, + @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTags copySourceTags, @HeaderParam("Accept") String accept, Context context); @@ -638,7 +640,7 @@ Mono setTags( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono downloadWithResponseAsync( @@ -734,7 +736,7 @@ public Mono downloadWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesWithResponseAsync( @@ -841,7 +843,7 @@ public Mono getPropertiesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteWithResponseAsync( @@ -900,7 +902,7 @@ public Mono deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono undeleteWithResponseAsync( @@ -935,7 +937,7 @@ public Mono undeleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setExpiryWithResponseAsync( @@ -985,7 +987,7 @@ public Mono setExpiryWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setHttpHeadersWithResponseAsync( @@ -1080,7 +1082,7 @@ public Mono setHttpHeadersWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setImmutabilityPolicyWithResponseAsync( @@ -1127,7 +1129,7 @@ public Mono setImmutabilityPolicyWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteImmutabilityPolicyWithResponseAsync( @@ -1161,7 +1163,7 @@ public Mono deleteImmutabilityPolicyWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setLegalHoldWithResponseAsync( @@ -1212,7 +1214,7 @@ public Mono setLegalHoldWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setMetadataWithResponseAsync( @@ -1306,7 +1308,7 @@ public Mono setMetadataWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono acquireLeaseWithResponseAsync( @@ -1371,7 +1373,7 @@ public Mono acquireLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releaseLeaseWithResponseAsync( @@ -1434,7 +1436,7 @@ public Mono releaseLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono renewLeaseWithResponseAsync( @@ -1500,7 +1502,7 @@ public Mono renewLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono changeLeaseWithResponseAsync( @@ -1570,7 +1572,7 @@ public Mono changeLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono breakLeaseWithResponseAsync( @@ -1641,7 +1643,7 @@ public Mono breakLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createSnapshotWithResponseAsync( @@ -1753,7 +1755,7 @@ public Mono createSnapshotWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startCopyFromURLWithResponseAsync( @@ -1866,12 +1868,14 @@ public Mono startCopyFromURLWithResponseAsync( * @param legalHold Specified if a legal hold should be set on the blob. * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyFromURLWithResponseAsync( @@ -1898,6 +1902,7 @@ public Mono copyFromURLWithResponseAsync( BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, + BlobCopySourceTags copySourceTags, EncryptionScope encryptionScopeParam, Context context) { final String xMsRequiresSync = "true"; @@ -1946,6 +1951,7 @@ public Mono copyFromURLWithResponseAsync( legalHold, copySourceAuthorization, encryptionScope, + copySourceTags, accept, context); } @@ -1967,7 +1973,7 @@ public Mono copyFromURLWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono abortCopyFromURLWithResponseAsync( @@ -2023,7 +2029,7 @@ public Mono abortCopyFromURLWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setTierWithResponseAsync( @@ -2067,7 +2073,7 @@ public Mono setTierWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoWithResponseAsync( @@ -2107,7 +2113,7 @@ public Mono getAccountInfoWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono queryWithResponseAsync( @@ -2191,7 +2197,7 @@ public Mono queryWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return blob tags. + * @return blob tags on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getTagsWithResponseAsync( @@ -2243,7 +2249,7 @@ public Mono getTagsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setTagsWithResponseAsync( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java index 2670e65a5ae85..75ee74d897d32 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java @@ -21,6 +21,7 @@ import com.azure.core.util.Base64Util; import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; +import com.azure.storage.blob.implementation.models.BlobCopySourceTags; import com.azure.storage.blob.implementation.models.BlockBlobsCommitBlockListResponse; import com.azure.storage.blob.implementation.models.BlockBlobsGetBlockListResponse; import com.azure.storage.blob.implementation.models.BlockBlobsPutBlobFromUrlResponse; @@ -148,6 +149,7 @@ Mono putBlobFromUrl( @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-copy-source-blob-properties") Boolean copySourceBlobProperties, @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, + @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTags copySourceTags, @HeaderParam("Accept") String accept, Context context); @@ -305,7 +307,7 @@ Mono getBlockList( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono uploadWithResponseAsync( @@ -476,6 +478,8 @@ public Mono uploadWithResponseAsync( * copied. * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to * copy source. + * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the + * tags specified by x-ms-tags. * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. @@ -483,7 +487,7 @@ public Mono uploadWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono putBlobFromUrlWithResponseAsync( @@ -511,6 +515,7 @@ public Mono putBlobFromUrlWithResponseAsync( String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, + BlobCopySourceTags copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, @@ -616,6 +621,7 @@ public Mono putBlobFromUrlWithResponseAsync( copySource, copySourceBlobProperties, copySourceAuthorization, + copySourceTags, accept, context); } @@ -644,7 +650,7 @@ public Mono putBlobFromUrlWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stageBlockWithResponseAsync( @@ -742,7 +748,7 @@ public Mono stageBlockWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono stageBlockFromURLWithResponseAsync( @@ -865,7 +871,7 @@ public Mono stageBlockFromURLWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono commitBlockListWithResponseAsync( @@ -1012,7 +1018,7 @@ public Mono commitBlockListWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getBlockListWithResponseAsync( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java index fa8b865fee30e..b563aecef5b01 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ContainersImpl.java @@ -229,7 +229,7 @@ Mono submitBatch( @Get("/{containerName}") @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(com.azure.storage.blob.models.BlobStorageException.class) + @UnexpectedResponseExceptionType(BlobStorageException.class) Mono filterBlobs( @HostParam("url") String url, @PathParam("containerName") String containerName, @@ -408,7 +408,7 @@ Mono getAccountInfo( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( @@ -462,7 +462,7 @@ public Mono createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesWithResponseAsync( @@ -500,7 +500,7 @@ public Mono getPropertiesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteWithResponseAsync( @@ -553,7 +553,7 @@ public Mono deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setMetadataWithResponseAsync( @@ -599,7 +599,7 @@ public Mono setMetadataWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the permissions for the specified container. + * @return the permissions for the specified container on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccessPolicyWithResponseAsync( @@ -641,7 +641,7 @@ public Mono getAccessPolicyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setAccessPolicyWithResponseAsync( @@ -696,7 +696,7 @@ public Mono setAccessPolicyWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreWithResponseAsync( @@ -739,7 +739,7 @@ public Mono restoreWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono renameWithResponseAsync( @@ -783,7 +783,7 @@ public Mono renameWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono submitBatchWithResponseAsync( @@ -835,9 +835,9 @@ public Mono submitBatchWithResponseAsync( * results than specified by maxresults, or than the default of 5000. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws StorageErrorException thrown if the request is rejected by server. + * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call. + * @return the result of a Filter Blobs API call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono filterBlobsWithResponseAsync( @@ -890,7 +890,7 @@ public Mono filterBlobsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono acquireLeaseWithResponseAsync( @@ -946,7 +946,7 @@ public Mono acquireLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono releaseLeaseWithResponseAsync( @@ -1000,7 +1000,7 @@ public Mono releaseLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono renewLeaseWithResponseAsync( @@ -1059,7 +1059,7 @@ public Mono renewLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono breakLeaseWithResponseAsync( @@ -1116,7 +1116,7 @@ public Mono breakLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono changeLeaseWithResponseAsync( @@ -1178,7 +1178,7 @@ public Mono changeLeaseWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs. + * @return an enumeration of blobs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listBlobFlatSegmentWithResponseAsync( @@ -1239,7 +1239,7 @@ public Mono listBlobFlatSegmentWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of blobs. + * @return an enumeration of blobs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listBlobHierarchySegmentWithResponseAsync( @@ -1282,7 +1282,7 @@ public Mono listBlobHierarchySegment * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoWithResponseAsync( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 0e0487039be98..fa69b3b4ec07b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -17,6 +17,8 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Base64Util; import com.azure.core.util.Context; @@ -25,7 +27,9 @@ import com.azure.storage.blob.implementation.models.PageBlobsClearPagesResponse; import com.azure.storage.blob.implementation.models.PageBlobsCopyIncrementalResponse; import com.azure.storage.blob.implementation.models.PageBlobsCreateResponse; +import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffNextResponse; import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffResponse; +import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesNextResponse; import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesResponse; import com.azure.storage.blob.implementation.models.PageBlobsResizeResponse; import com.azure.storage.blob.implementation.models.PageBlobsUpdateSequenceNumberResponse; @@ -37,6 +41,7 @@ import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; +import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.SequenceNumberActionType; import java.nio.ByteBuffer; import java.time.OffsetDateTime; @@ -230,6 +235,8 @@ Mono getPageRanges( @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @@ -254,6 +261,8 @@ Mono getPageRangesDiff( @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId, + @QueryParam("marker") String marker, + @QueryParam("maxresults") Integer maxresults, @HeaderParam("Accept") String accept, Context context); @@ -323,6 +332,43 @@ Mono copyIncremental( @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(BlobStorageException.class) + Mono getPageRangesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("url") String url, + @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, + @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @HeaderParam("x-ms-if-tags") String ifTags, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("Accept") String accept, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(BlobStorageException.class) + Mono getPageRangesDiffNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("url") String url, + @HeaderParam("x-ms-previous-snapshot-url") String prevSnapshotUrl, + @HeaderParam("x-ms-range") String range, + @HeaderParam("x-ms-lease-id") String leaseId, + @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, + @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, + @HeaderParam("If-Match") String ifMatch, + @HeaderParam("If-None-Match") String ifNoneMatch, + @HeaderParam("x-ms-if-tags") String ifTags, + @HeaderParam("x-ms-version") String version, + @HeaderParam("x-ms-client-request-id") String requestId, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -366,7 +412,7 @@ Mono copyIncremental( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createWithResponseAsync( @@ -524,7 +570,7 @@ public Mono createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono uploadPagesWithResponseAsync( @@ -641,7 +687,7 @@ public Mono uploadPagesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono clearPagesWithResponseAsync( @@ -765,7 +811,7 @@ public Mono clearPagesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono uploadPagesFromURLWithResponseAsync( @@ -890,14 +936,24 @@ public Mono uploadPagesFromURLWithResponseA * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param marker A string value that identifies the portion of the list of containers to be returned with the next + * listing operation. The operation returns the NextMarker value within the response body if the listing + * operation did not return all containers remaining to be listed with the current page. The NextMarker value + * can be used as the value for the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param maxresults Specifies the maximum number of containers to return. If the request does not specify + * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the + * listing operation crosses a partition boundary, then the service will return a continuation token for + * retrieving the remainder of the results. For this reason, it is possible that the service will return fewer + * results than specified by maxresults, or than the default of 5000. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesWithResponseAsync( + public Mono> getPageRangesSinglePageAsync( String containerName, String blob, String snapshot, @@ -910,6 +966,8 @@ public Mono getPageRangesWithResponseAsync( String ifNoneMatch, String ifTags, String requestId, + String marker, + Integer maxresults, Context context) { final String comp = "pagelist"; final String accept = "application/xml"; @@ -918,23 +976,34 @@ public Mono getPageRangesWithResponseAsync( DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.getPageRanges( - this.client.getUrl(), - containerName, - blob, - comp, - snapshot, - timeout, - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - accept, - context); + this.client.getUrl(), + containerName, + blob, + comp, + snapshot, + timeout, + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + marker, + maxresults, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextLink(), + res.getDeserializedHeaders())); } /** @@ -969,14 +1038,24 @@ public Mono getPageRangesWithResponseAsync( * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the * analytics logs when storage analytics logging is enabled. + * @param marker A string value that identifies the portion of the list of containers to be returned with the next + * listing operation. The operation returns the NextMarker value within the response body if the listing + * operation did not return all containers remaining to be listed with the current page. The NextMarker value + * can be used as the value for the marker parameter in a subsequent call to request the next page of list + * items. The marker value is opaque to the client. + * @param maxresults Specifies the maximum number of containers to return. If the request does not specify + * maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the + * listing operation crosses a partition boundary, then the service will return a continuation token for + * retrieving the remainder of the results. For this reason, it is possible that the service will return fewer + * results than specified by maxresults, or than the default of 5000. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of pages. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getPageRangesDiffWithResponseAsync( + public Mono> getPageRangesDiffSinglePageAsync( String containerName, String blob, String snapshot, @@ -991,6 +1070,8 @@ public Mono getPageRangesDiffWithResponseAsy String ifNoneMatch, String ifTags, String requestId, + String marker, + Integer maxresults, Context context) { final String comp = "pagelist"; final String accept = "application/xml"; @@ -999,25 +1080,36 @@ public Mono getPageRangesDiffWithResponseAsy DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.getPageRangesDiff( - this.client.getUrl(), - containerName, - blob, - comp, - snapshot, - timeout, - prevsnapshot, - prevSnapshotUrl, - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - accept, - context); + this.client.getUrl(), + containerName, + blob, + comp, + snapshot, + timeout, + prevsnapshot, + prevSnapshotUrl, + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + marker, + maxresults, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextMarker(), + res.getDeserializedHeaders())); } /** @@ -1046,7 +1138,7 @@ public Mono getPageRangesDiffWithResponseAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono resizeWithResponseAsync( @@ -1140,7 +1232,7 @@ public Mono resizeWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateSequenceNumberWithResponseAsync( @@ -1210,7 +1302,7 @@ public Mono updateSequenceNumberWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyIncrementalWithResponseAsync( @@ -1248,4 +1340,135 @@ public Mono copyIncrementalWithResponseAsync( accept, context); } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param range Return only the bytes of the blob in the specified range. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. + * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPageRangesNextSinglePageAsync( + String nextLink, + String range, + String leaseId, + OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, + String ifMatch, + String ifNoneMatch, + String ifTags, + String requestId, + Context context) { + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted = + ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = + ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service.getPageRangesNext( + nextLink, + this.client.getUrl(), + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextMarker(), + res.getDeserializedHeaders())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param prevSnapshotUrl Optional. This header is only supported in service versions 2019-04-19 and after and + * specifies the URL of a previous snapshot of the target blob. The response will only contain pages that were + * changed between the target blob and its previous snapshot. + * @param range Return only the bytes of the blob in the specified range. + * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. + * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the + * specified date/time. + * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since + * the specified date/time. + * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. + * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. + * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. + * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the + * analytics logs when storage analytics logging is enabled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws BlobStorageException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPageRangesDiffNextSinglePageAsync( + String nextLink, + String prevSnapshotUrl, + String range, + String leaseId, + OffsetDateTime ifModifiedSince, + OffsetDateTime ifUnmodifiedSince, + String ifMatch, + String ifNoneMatch, + String ifTags, + String requestId, + Context context) { + final String accept = "application/xml"; + DateTimeRfc1123 ifModifiedSinceConverted = + ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); + DateTimeRfc1123 ifUnmodifiedSinceConverted = + ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); + return service.getPageRangesDiffNext( + nextLink, + this.client.getUrl(), + prevSnapshotUrl, + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().getValue(), + res.getValue().getNextMarker(), + res.getDeserializedHeaders())); + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java index ee017452dbc16..833ef377fc3e5 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/ServicesImpl.java @@ -205,7 +205,7 @@ Mono listBlobContainersSegmentNex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setPropertiesWithResponseAsync( @@ -239,7 +239,7 @@ public Mono setPropertiesWithResponseAsync( * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the properties of a storage account's Blob service, including properties for Storage Analytics and CORS - * (Cross-Origin Resource Sharing) rules. + * (Cross-Origin Resource Sharing) rules on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getPropertiesWithResponseAsync( @@ -264,7 +264,7 @@ public Mono getPropertiesWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return stats for the storage service. + * @return stats for the storage service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getStatisticsWithResponseAsync( @@ -301,7 +301,7 @@ public Mono getStatisticsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listBlobContainersSegmentSinglePageAsync( @@ -354,7 +354,7 @@ public Mono> listBlobContainersSegmentSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a user delegation key. + * @return a user delegation key on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getUserDelegationKeyWithResponseAsync( @@ -381,7 +381,7 @@ public Mono getUserDelegationKeyWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAccountInfoWithResponseAsync(Context context) { @@ -407,7 +407,7 @@ public Mono getAccountInfoWithResponseAsync(Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono submitBatchWithResponseAsync( @@ -457,7 +457,7 @@ public Mono submitBatchWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result of a Filter Blobs API call. + * @return the result of a Filter Blobs API call on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono filterBlobsWithResponseAsync( @@ -487,7 +487,7 @@ public Mono filterBlobsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an enumeration of containers. + * @return an enumeration of containers along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listBlobContainersSegmentNextSinglePageAsync( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobCopySourceTags.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobCopySourceTags.java new file mode 100644 index 0000000000000..8be341d202564 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobCopySourceTags.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for BlobCopySourceTags. */ +public enum BlobCopySourceTags { + /** Enum value REPLACE. */ + REPLACE("REPLACE"), + + /** Enum value COPY. */ + COPY("COPY"); + + /** The actual serialized value for a BlobCopySourceTags instance. */ + private final String value; + + BlobCopySourceTags(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a BlobCopySourceTags instance. + * + * @param value the serialized value to parse. + * @return the parsed BlobCopySourceTags object, or null if unable to parse. + */ + @JsonCreator + public static BlobCopySourceTags fromString(String value) { + BlobCopySourceTags[] items = BlobCopySourceTags.values(); + for (BlobCopySourceTags item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextHeaders.java new file mode 100644 index 0000000000000..ea0270911aef6 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextHeaders.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.DateTimeRfc1123; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** The PageBlobsGetPageRangesDiffNextHeaders model. */ +@JacksonXmlRootElement(localName = "null") +@Fluent +public final class PageBlobsGetPageRangesDiffNextHeaders { + /* + * The x-ms-version property. + */ + @JsonProperty(value = "x-ms-version") + private String xMsVersion; + + /* + * The x-ms-blob-content-length property. + */ + @JsonProperty(value = "x-ms-blob-content-length") + private Long xMsBlobContentLength; + + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /* + * The Last-Modified property. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-client-request-id property. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String xMsClientRequestId; + + /* + * The Date property. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the xMsVersion property: The x-ms-version property. + * + * @return the xMsVersion value. + */ + public String getXMsVersion() { + return this.xMsVersion; + } + + /** + * Set the xMsVersion property: The x-ms-version property. + * + * @param xMsVersion the xMsVersion value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setXMsVersion(String xMsVersion) { + this.xMsVersion = xMsVersion; + return this; + } + + /** + * Get the xMsBlobContentLength property: The x-ms-blob-content-length property. + * + * @return the xMsBlobContentLength value. + */ + public Long getXMsBlobContentLength() { + return this.xMsBlobContentLength; + } + + /** + * Set the xMsBlobContentLength property: The x-ms-blob-content-length property. + * + * @param xMsBlobContentLength the xMsBlobContentLength value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setXMsBlobContentLength(Long xMsBlobContentLength) { + this.xMsBlobContentLength = xMsBlobContentLength; + return this; + } + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified property: The Last-Modified property. + * + * @return the lastModified value. + */ + public OffsetDateTime getLastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.getDateTime(); + } + + /** + * Set the lastModified property: The Last-Modified property. + * + * @param lastModified the lastModified value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setLastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String getXMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsClientRequestId property: The x-ms-client-request-id property. + * + * @return the xMsClientRequestId value. + */ + public String getXMsClientRequestId() { + return this.xMsClientRequestId; + } + + /** + * Set the xMsClientRequestId property: The x-ms-client-request-id property. + * + * @param xMsClientRequestId the xMsClientRequestId value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setXMsClientRequestId(String xMsClientRequestId) { + this.xMsClientRequestId = xMsClientRequestId; + return this; + } + + /** + * Get the dateProperty property: The Date property. + * + * @return the dateProperty value. + */ + public OffsetDateTime getDateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.getDateTime(); + } + + /** + * Set the dateProperty property: The Date property. + * + * @param dateProperty the dateProperty value to set. + * @return the PageBlobsGetPageRangesDiffNextHeaders object itself. + */ + public PageBlobsGetPageRangesDiffNextHeaders setDateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextResponse.java new file mode 100644 index 0000000000000..b8fc884af6fe0 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffNextResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getPageRangesDiffNext operation. */ +public final class PageBlobsGetPageRangesDiffNextResponse + extends ResponseBase { + /** + * Creates an instance of PageBlobsGetPageRangesDiffNextResponse. + * + * @param request the request which resulted in this PageBlobsGetPageRangesDiffNextResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PageBlobsGetPageRangesDiffNextResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PageListCollection value, + PageBlobsGetPageRangesDiffNextHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PageListCollection getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java index e454deb04d79f..13f66ac33651f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java @@ -7,11 +7,10 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; -import com.azure.storage.blob.models.PageList; /** Contains all response data for the getPageRangesDiff operation. */ public final class PageBlobsGetPageRangesDiffResponse - extends ResponseBase { + extends ResponseBase { /** * Creates an instance of PageBlobsGetPageRangesDiffResponse. * @@ -25,14 +24,14 @@ public PageBlobsGetPageRangesDiffResponse( HttpRequest request, int statusCode, HttpHeaders rawHeaders, - PageList value, + PageListCollection value, PageBlobsGetPageRangesDiffHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** @return the deserialized response body. */ @Override - public PageList getValue() { + public PageListCollection getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextHeaders.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextHeaders.java new file mode 100644 index 0000000000000..c1bc081a9a17d --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextHeaders.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.DateTimeRfc1123; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.time.OffsetDateTime; + +/** The PageBlobsGetPageRangesNextHeaders model. */ +@JacksonXmlRootElement(localName = "null") +@Fluent +public final class PageBlobsGetPageRangesNextHeaders { + /* + * The x-ms-version property. + */ + @JsonProperty(value = "x-ms-version") + private String xMsVersion; + + /* + * The x-ms-blob-content-length property. + */ + @JsonProperty(value = "x-ms-blob-content-length") + private Long xMsBlobContentLength; + + /* + * The ETag property. + */ + @JsonProperty(value = "ETag") + private String eTag; + + /* + * The Last-Modified property. + */ + @JsonProperty(value = "Last-Modified") + private DateTimeRfc1123 lastModified; + + /* + * The x-ms-request-id property. + */ + @JsonProperty(value = "x-ms-request-id") + private String xMsRequestId; + + /* + * The x-ms-client-request-id property. + */ + @JsonProperty(value = "x-ms-client-request-id") + private String xMsClientRequestId; + + /* + * The Date property. + */ + @JsonProperty(value = "Date") + private DateTimeRfc1123 dateProperty; + + /** + * Get the xMsVersion property: The x-ms-version property. + * + * @return the xMsVersion value. + */ + public String getXMsVersion() { + return this.xMsVersion; + } + + /** + * Set the xMsVersion property: The x-ms-version property. + * + * @param xMsVersion the xMsVersion value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setXMsVersion(String xMsVersion) { + this.xMsVersion = xMsVersion; + return this; + } + + /** + * Get the xMsBlobContentLength property: The x-ms-blob-content-length property. + * + * @return the xMsBlobContentLength value. + */ + public Long getXMsBlobContentLength() { + return this.xMsBlobContentLength; + } + + /** + * Set the xMsBlobContentLength property: The x-ms-blob-content-length property. + * + * @param xMsBlobContentLength the xMsBlobContentLength value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setXMsBlobContentLength(Long xMsBlobContentLength) { + this.xMsBlobContentLength = xMsBlobContentLength; + return this; + } + + /** + * Get the eTag property: The ETag property. + * + * @return the eTag value. + */ + public String getETag() { + return this.eTag; + } + + /** + * Set the eTag property: The ETag property. + * + * @param eTag the eTag value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get the lastModified property: The Last-Modified property. + * + * @return the lastModified value. + */ + public OffsetDateTime getLastModified() { + if (this.lastModified == null) { + return null; + } + return this.lastModified.getDateTime(); + } + + /** + * Set the lastModified property: The Last-Modified property. + * + * @param lastModified the lastModified value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setLastModified(OffsetDateTime lastModified) { + if (lastModified == null) { + this.lastModified = null; + } else { + this.lastModified = new DateTimeRfc1123(lastModified); + } + return this; + } + + /** + * Get the xMsRequestId property: The x-ms-request-id property. + * + * @return the xMsRequestId value. + */ + public String getXMsRequestId() { + return this.xMsRequestId; + } + + /** + * Set the xMsRequestId property: The x-ms-request-id property. + * + * @param xMsRequestId the xMsRequestId value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setXMsRequestId(String xMsRequestId) { + this.xMsRequestId = xMsRequestId; + return this; + } + + /** + * Get the xMsClientRequestId property: The x-ms-client-request-id property. + * + * @return the xMsClientRequestId value. + */ + public String getXMsClientRequestId() { + return this.xMsClientRequestId; + } + + /** + * Set the xMsClientRequestId property: The x-ms-client-request-id property. + * + * @param xMsClientRequestId the xMsClientRequestId value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setXMsClientRequestId(String xMsClientRequestId) { + this.xMsClientRequestId = xMsClientRequestId; + return this; + } + + /** + * Get the dateProperty property: The Date property. + * + * @return the dateProperty value. + */ + public OffsetDateTime getDateProperty() { + if (this.dateProperty == null) { + return null; + } + return this.dateProperty.getDateTime(); + } + + /** + * Set the dateProperty property: The Date property. + * + * @param dateProperty the dateProperty value to set. + * @return the PageBlobsGetPageRangesNextHeaders object itself. + */ + public PageBlobsGetPageRangesNextHeaders setDateProperty(OffsetDateTime dateProperty) { + if (dateProperty == null) { + this.dateProperty = null; + } else { + this.dateProperty = new DateTimeRfc1123(dateProperty); + } + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextResponse.java new file mode 100644 index 0000000000000..c04dfa186ea69 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesNextResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the getPageRangesNext operation. */ +public final class PageBlobsGetPageRangesNextResponse + extends ResponseBase { + /** + * Creates an instance of PageBlobsGetPageRangesNextResponse. + * + * @param request the request which resulted in this PageBlobsGetPageRangesNextResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PageBlobsGetPageRangesNextResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PageListCollection value, + PageBlobsGetPageRangesNextHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PageListCollection getValue() { + return super.getValue(); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java index 015ac69ddf3ef..e03c4adc59663 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java @@ -7,10 +7,10 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; -import com.azure.storage.blob.models.PageList; /** Contains all response data for the getPageRanges operation. */ -public final class PageBlobsGetPageRangesResponse extends ResponseBase { +public final class PageBlobsGetPageRangesResponse + extends ResponseBase { /** * Creates an instance of PageBlobsGetPageRangesResponse. * @@ -24,14 +24,14 @@ public PageBlobsGetPageRangesResponse( HttpRequest request, int statusCode, HttpHeaders rawHeaders, - PageList value, + PageListCollection value, PageBlobsGetPageRangesHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** @return the deserialized response body. */ @Override - public PageList getValue() { + public PageListCollection getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java new file mode 100644 index 0000000000000..3a431cf1496f1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.storage.blob.models.PageList; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** The PageListCollection model. */ +@JacksonXmlRootElement(localName = "PageListCollection") +@Fluent +public final class PageListCollection { + /* + * The value property. + */ + @JsonProperty("PageList") + private List value = new ArrayList<>(); + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List getValue() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the PageListCollection object itself. + */ + public PageListCollection setValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String getNextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the PageListCollection object itself. + */ + public PageListCollection setNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java index e13b327f3a562..e8a5852567fa4 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java @@ -326,12 +326,6 @@ public final class BlobErrorCode extends ExpandableStringEnum { /** Static value SnapshotCountExceeded for BlobErrorCode. */ public static final BlobErrorCode SNAPSHOT_COUNT_EXCEEDED = fromString("SnapshotCountExceeded"); - /** Static value SnapshotOperationRateExceeded for BlobErrorCode. - * @deprecated Please use {@link BlobErrorCode#SNAPSHOT_OPERATION_RATE_EXCEEDED} - */ - @Deprecated - public static final BlobErrorCode SNAPHOT_OPERATION_RATE_EXCEEDED = fromString("SnapshotOperationRateExceeded"); - /** Static value SnapshotOperationRateExceeded for BlobErrorCode. */ public static final BlobErrorCode SNAPSHOT_OPERATION_RATE_EXCEEDED = fromString("SnapshotOperationRateExceeded"); @@ -375,6 +369,9 @@ public final class BlobErrorCode extends ExpandableStringEnum { public static final BlobErrorCode AUTHORIZATION_RESOURCE_TYPE_MISMATCH = fromString("AuthorizationResourceTypeMismatch"); + /** Static value SnaphotOperationRateExceeded for BlobErrorCode. */ + public static final BlobErrorCode SNAPHOT_OPERATION_RATE_EXCEEDED = fromString("SnaphotOperationRateExceeded"); + /** * Creates or finds a BlobErrorCode from its string representation. * diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java index 3a6d6de247d63..657baf212d412 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java @@ -28,6 +28,12 @@ public final class PageList { @JsonProperty("ClearRange") private List clearRange = new ArrayList<>(); + /* + * The NextMarker property. + */ + @JsonProperty(value = "NextMarker") + private String nextMarker; + /** * Get the pageRange property: The PageRange property. * @@ -67,4 +73,24 @@ public PageList setClearRange(List clearRange) { this.clearRange = clearRange; return this; } + + /** + * Get the nextMarker property: The NextMarker property. + * + * @return the nextMarker value. + */ + public String getNextMarker() { + return this.nextMarker; + } + + /** + * Set the nextMarker property: The NextMarker property. + * + * @param nextMarker the nextMarker value to set. + * @return the PageList object itself. + */ + public PageList setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + return this; + } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index e0938aed9a93a..5ed011d7763a9 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -1032,7 +1032,7 @@ Mono> copyFromUrlWithResponse(BlobCopyFromUrlOptions options, C destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), destRequestConditions.getLeaseId(), null, null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), - options.hasLegalHold(), sourceAuth, this.encryptionScope, context) + options.hasLegalHold(), sourceAuth, null, this.encryptionScope, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyId())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java index 0df0e68aed268..e9062df4f021b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java @@ -509,8 +509,8 @@ Mono> uploadFromUrlWithResponse(BlobUploadFromUrlOptions sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), - options.isCopySourceBlobProperties(), sourceAuth, options.getHeaders(), - getCustomerProvidedKey(), encryptionScope, + options.isCopySourceBlobProperties(), sourceAuth, null, options.getHeaders(), + getCustomerProvidedKey(),encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 2d5ca5df0aabc..757ddc140f3d6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -792,13 +792,14 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; context = context == null ? Context.NONE : context; - return this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, + return this.azureBlobStorage.getPageBlobs().getPageRangesSinglePageAsync(containerName, blobName, getSnapshotId(), null, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), - requestConditions.getTagsConditions(), null, + requestConditions.getTagsConditions(), null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), + response.getHeaders(), response.getValue().get(0))); } /** @@ -974,13 +975,14 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri } context = context == null ? Context.NONE : context; - return this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponseAsync(containerName, blobName, + return this.azureBlobStorage.getPageBlobs().getPageRangesDiffSinglePageAsync(containerName, blobName, getSnapshotId(), null, prevSnapshot, prevSnapshotUrl, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), - requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, + requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) - .map(response -> new SimpleResponse<>(response, response.getValue())); + .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), + response.getHeaders(), response.getValue().get(0))); } /** diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 45bc645fd67cf..41e82f22b8db7 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -573,4 +573,50 @@ directive: $["x-ms-enum"].modelAsString = true; ``` +### Define PageListCollection +```yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + $.PageListCollection = { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/PageList" + } + }, + "nextLink": { + "x-ms-client-name": "NextMarker" + "type": "string" + } + } + } + +``` +### PageList schema update +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"] + transform: > + delete $.get.responses["200"].schema; + $.get.responses["200"].schema = { + "$ref": "#/definitions/PageListCollection" + }; +``` +### PageList diff schema update +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"] + transform: > + delete $.get.responses["200"].schema; + $.get.responses["200"].schema = { + "$ref": "#/definitions/PageListCollection" + }; +``` + ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fswagger%2FREADME.png) From f06a0b38751b763a6fd09f87a7473f4339da639b Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 22 Mar 2022 17:12:08 -0700 Subject: [PATCH 02/19] Fixed nextMarker --- .../blob/implementation/PageBlobsImpl.java | 2 +- .../models/PageListCollection.java | 20 +++++++++---------- .../azure-storage-blob/swagger/README.md | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index fa69b3b4ec07b..5e2539489fa86 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -1002,7 +1002,7 @@ public Mono> getPageRangesSinglePageAsync( res.getStatusCode(), res.getHeaders(), res.getValue().getValue(), - res.getValue().getNextLink(), + res.getValue().getNextMarker(), res.getDeserializedHeaders())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java index 3a431cf1496f1..6b8ad863adde8 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java @@ -12,7 +12,7 @@ import java.util.List; /** The PageListCollection model. */ -@JacksonXmlRootElement(localName = "PageListCollection") +@JacksonXmlRootElement(localName = "PageList") @Fluent public final class PageListCollection { /* @@ -25,7 +25,7 @@ public final class PageListCollection { * The nextLink property. */ @JsonProperty(value = "nextLink") - private String nextLink; + private String nextMarker; /** * Get the value property: The value property. @@ -48,22 +48,22 @@ public PageListCollection setValue(List value) { } /** - * Get the nextLink property: The nextLink property. + * Get the nextMarker property: The nextLink property. * - * @return the nextLink value. + * @return the nextMarker value. */ - public String getNextLink() { - return this.nextLink; + public String getNextMarker() { + return this.nextMarker; } /** - * Set the nextLink property: The nextLink property. + * Set the nextMarker property: The nextLink property. * - * @param nextLink the nextLink value to set. + * @param nextMarker the nextMarker value to set. * @return the PageListCollection object itself. */ - public PageListCollection setNextLink(String nextLink) { - this.nextLink = nextLink; + public PageListCollection setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; return this; } } diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 41e82f22b8db7..a2a8ebcfc7bf0 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -589,7 +589,7 @@ directive: } }, "nextLink": { - "x-ms-client-name": "NextMarker" + "x-ms-client-name": "NextMarker", "type": "string" } } From 44926693ae9e5c69dba249810f049f93c959d065 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 22 Mar 2022 17:43:25 -0700 Subject: [PATCH 03/19] Tried to reformat the xml tags --- .../storage/blob/implementation/PageBlobsImpl.java | 10 +++++----- .../implementation/models/PageListCollection.java | 12 ++++++------ .../blob/specialized/PageBlobAsyncClient.java | 2 +- sdk/storage/azure-storage-blob/swagger/README.md | 13 +++++++++++-- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 5e2539489fa86..1650408e6285c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -41,7 +41,7 @@ import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; -import com.azure.storage.blob.models.PageList; +import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; import java.nio.ByteBuffer; import java.time.OffsetDateTime; @@ -953,7 +953,7 @@ public Mono uploadPagesFromURLWithResponseA * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesSinglePageAsync( + public Mono> getPageRangesSinglePageAsync( String containerName, String blob, String snapshot, @@ -1055,7 +1055,7 @@ public Mono> getPageRangesSinglePageAsync( * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffSinglePageAsync( + public Mono> getPageRangesDiffSinglePageAsync( String containerName, String blob, String snapshot, @@ -1363,7 +1363,7 @@ public Mono copyIncrementalWithResponseAsync( * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesNextSinglePageAsync( + public Mono> getPageRangesNextSinglePageAsync( String nextLink, String range, String leaseId, @@ -1429,7 +1429,7 @@ public Mono> getPageRangesNextSinglePageAsync( * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffNextSinglePageAsync( + public Mono> getPageRangesDiffNextSinglePageAsync( String nextLink, String prevSnapshotUrl, String range, diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java index 6b8ad863adde8..915f2c1562b95 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java @@ -5,21 +5,21 @@ package com.azure.storage.blob.implementation.models; import com.azure.core.annotation.Fluent; -import com.azure.storage.blob.models.PageList; +import com.azure.storage.blob.models.PageRange; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; /** The PageListCollection model. */ -@JacksonXmlRootElement(localName = "PageList") +@JacksonXmlRootElement(localName = "PageListCollection") @Fluent public final class PageListCollection { /* * The value property. */ - @JsonProperty("PageList") - private List value = new ArrayList<>(); + @JsonProperty("PageRange") + private List value = new ArrayList<>(); /* * The nextLink property. @@ -32,7 +32,7 @@ public final class PageListCollection { * * @return the value value. */ - public List getValue() { + public List getValue() { return this.value; } @@ -42,7 +42,7 @@ public List getValue() { * @param value the value value to set. * @return the PageListCollection object itself. */ - public PageListCollection setValue(List value) { + public PageListCollection setValue(List value) { this.value = value; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 757ddc140f3d6..d2ef653b55e0e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -982,7 +982,7 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().get(0))); + response.getHeaders(), response.getValue())); } /** diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index a2a8ebcfc7bf0..cecdcb3acd7de 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -581,11 +581,20 @@ directive: transform: > $.PageListCollection = { "type": "object", + "xml": { + "name": "PageList" + }, "properties": { - "value": { + "PageRanges": { "type": "array", "items": { - "$ref": "#/definitions/PageList" + "$ref": "#/definitions/PageRange" + } + }, + "ClearRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/ClearRange" } }, "nextLink": { From 69bd18a5849f0b84dc07f1402320f3855841dcf5 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 22 Mar 2022 18:10:45 -0700 Subject: [PATCH 04/19] Tried to add a segment type to reformat xml tags --- .../azure-storage-blob/swagger/README.md | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index cecdcb3acd7de..5ba7d039750ed 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -573,17 +573,14 @@ directive: $["x-ms-enum"].modelAsString = true; ``` -### Define PageListCollection +### Define PageListSegment ```yaml directive: - from: swagger-document where: $.definitions transform: > - $.PageListCollection = { + $.PageListSegment = { "type": "object", - "xml": { - "name": "PageList" - }, "properties": { "PageRanges": { "type": "array", @@ -597,8 +594,30 @@ directive: "$ref": "#/definitions/ClearRange" } }, - "nextLink": { - "x-ms-client-name": "NextMarker", + "NextMarker": { + "type": "string" + } + } + } + +``` + +### Define PageListCollection +```yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + $.PageListCollection = { + "xml": { + "name": "PageList" + }, + "type": "object", + "properties": { + "Segment": { + "$ref": "#/definitions/PageListSegment" + }, + "NextMarker": { "type": "string" } } From 1e62851cfdd3b08c952c2069e0ef6768a1152cc6 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Wed, 23 Mar 2022 11:01:21 -0700 Subject: [PATCH 05/19] Tried another thing --- .../models/BlobHierarchyListSegment.java | 1 - .../models/PageListCollection.java | 10 +- .../models/PageListSegment.java | 96 +++++++ .../azure/storage/blob/models/PageList.java | 1 - .../azure-storage-blob/swagger/README.md | 250 +++++++++++++----- 5 files changed, 282 insertions(+), 76 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListSegment.java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java index 74eb721fecdff..3295326a2bc6b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java index 915f2c1562b95..ed7548f24962a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListCollection.java @@ -12,7 +12,7 @@ import java.util.List; /** The PageListCollection model. */ -@JacksonXmlRootElement(localName = "PageListCollection") +@JacksonXmlRootElement(localName = "PageList") @Fluent public final class PageListCollection { /* @@ -22,9 +22,9 @@ public final class PageListCollection { private List value = new ArrayList<>(); /* - * The nextLink property. + * The nextMarker property. */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextMarker") private String nextMarker; /** @@ -48,7 +48,7 @@ public PageListCollection setValue(List value) { } /** - * Get the nextMarker property: The nextLink property. + * Get the nextMarker property: The nextMarker property. * * @return the nextMarker value. */ @@ -57,7 +57,7 @@ public String getNextMarker() { } /** - * Set the nextMarker property: The nextLink property. + * Set the nextMarker property: The nextMarker property. * * @param nextMarker the nextMarker value to set. * @return the PageListCollection object itself. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListSegment.java new file mode 100644 index 0000000000000..43b275673f6d1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListSegment.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.storage.blob.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.storage.blob.models.ClearRange; +import com.azure.storage.blob.models.PageRange; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import java.util.ArrayList; +import java.util.List; + +/** The PageListSegment model. */ +@JacksonXmlRootElement(localName = "PageListSegment") +@Fluent +public final class PageListSegment { + /* + * The PageRanges property. + */ + @JsonProperty("PageRange") + private List pageRanges = new ArrayList<>(); + + /* + * The ClearRanges property. + */ + @JsonProperty("ClearRange") + private List clearRanges = new ArrayList<>(); + + /* + * The NextMarker property. + */ + @JsonProperty(value = "NextMarker") + private String nextMarker; + + /** + * Get the pageRanges property: The PageRanges property. + * + * @return the pageRanges value. + */ + public List getPageRanges() { + return this.pageRanges; + } + + /** + * Set the pageRanges property: The PageRanges property. + * + * @param pageRanges the pageRanges value to set. + * @return the PageListSegment object itself. + */ + public PageListSegment setPageRanges(List pageRanges) { + this.pageRanges = pageRanges; + return this; + } + + /** + * Get the clearRanges property: The ClearRanges property. + * + * @return the clearRanges value. + */ + public List getClearRanges() { + return this.clearRanges; + } + + /** + * Set the clearRanges property: The ClearRanges property. + * + * @param clearRanges the clearRanges value to set. + * @return the PageListSegment object itself. + */ + public PageListSegment setClearRanges(List clearRanges) { + this.clearRanges = clearRanges; + return this; + } + + /** + * Get the nextMarker property: The NextMarker property. + * + * @return the nextMarker value. + */ + public String getNextMarker() { + return this.nextMarker; + } + + /** + * Set the nextMarker property: The NextMarker property. + * + * @param nextMarker the nextMarker value to set. + * @return the PageListSegment object itself. + */ + public PageListSegment setNextMarker(String nextMarker) { + this.nextMarker = nextMarker; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java index 657baf212d412..353f306b7a506 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 5ba7d039750ed..f1669f3fd730f 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -555,14 +555,21 @@ directive: delete $["x-ms-pageable"]; ``` -### Delete Container_ListBlobHierarchySegment x-ms-pageable as autorest can't recognize the itemName for this -``` yaml -directive: -- from: swagger-document - where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&hierarchy"].get - transform: > - delete $["x-ms-pageable"]; -``` +[//]: # (### Delete Container_ListBlobHierarchySegment x-ms-pageable as autorest can't recognize the itemName for this) + +[//]: # (``` yaml) + +[//]: # (directive:) + +[//]: # (- from: swagger-document) + +[//]: # ( where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&hierarchy"].get) + +[//]: # ( transform: >) + +[//]: # ( delete $["x-ms-pageable"];) + +[//]: # (```) ### BlobDeleteType expandable string enum ``` yaml @@ -573,78 +580,183 @@ directive: $["x-ms-enum"].modelAsString = true; ``` -### Define PageListSegment -```yaml -directive: -- from: swagger-document - where: $.definitions - transform: > - $.PageListSegment = { - "type": "object", - "properties": { - "PageRanges": { - "type": "array", - "items": { - "$ref": "#/definitions/PageRange" - } - }, - "ClearRanges": { - "type": "array", - "items": { - "$ref": "#/definitions/ClearRange" - } - }, - "NextMarker": { - "type": "string" - } - } - } - -``` - -### Define PageListCollection -```yaml -directive: -- from: swagger-document - where: $.definitions - transform: > - $.PageListCollection = { - "xml": { - "name": "PageList" - }, - "type": "object", - "properties": { - "Segment": { - "$ref": "#/definitions/PageListSegment" - }, - "NextMarker": { - "type": "string" - } - } - } - -``` -### PageList schema update +### Delete PageBlob_GetPageRanges x-ms-pageable as autorest can't recognize the itemName for this ``` yaml directive: - from: swagger-document where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"] transform: > - delete $.get.responses["200"].schema; - $.get.responses["200"].schema = { - "$ref": "#/definitions/PageListCollection" - }; + delete $["x-ms-pageable"]; ``` -### PageList diff schema update + +### Delete PageList_GetPageRangesDiff x-ms-pageable as autorest can't recognize the itemName for this ``` yaml directive: - from: swagger-document where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"] transform: > - delete $.get.responses["200"].schema; - $.get.responses["200"].schema = { - "$ref": "#/definitions/PageListCollection" - }; + delete $["x-ms-pageable"]; ``` +[//]: # (### Define PageListSegment) + +[//]: # (```yaml) + +[//]: # (directive:) + +[//]: # (- from: swagger-document) + +[//]: # ( where: $.definitions) + +[//]: # ( transform: >) + +[//]: # ( $.PageListSegment = {) + +[//]: # ( "type": "object",) + +[//]: # ( "properties": {) + +[//]: # ( "PageRanges": {) + +[//]: # ( "type": "array",) + +[//]: # ( "items": {) + +[//]: # ( "$ref": "#/definitions/PageRange") + +[//]: # ( }) + +[//]: # ( },) + +[//]: # ( "ClearRanges": {) + +[//]: # ( "type": "array",) + +[//]: # ( "items": {) + +[//]: # ( "$ref": "#/definitions/ClearRange") + +[//]: # ( }) + +[//]: # ( },) + +[//]: # ( "NextMarker": {) + +[//]: # ( "type": "string") + +[//]: # ( }) + +[//]: # ( }) + +[//]: # ( }) + +[//]: # ( ) +[//]: # (```) + +[//]: # () +[//]: # (### Define PageListCollection) + +[//]: # (```yaml) + +[//]: # (directive:) + +[//]: # (- from: swagger-document) + +[//]: # ( where: $.definitions) + +[//]: # ( transform: >) + +[//]: # ( $.PageListCollection = {) + +[//]: # ( "xml": {) + +[//]: # ( "name": "PageList") + +[//]: # ( },) + +[//]: # ( "type": "object",) + +[//]: # ( "properties": {) + +[//]: # ( "PageRanges": {) + +[//]: # ( "type": "array",) + +[//]: # ( "items": {) + +[//]: # ( "$ref": "#/definitions/PageRange") + +[//]: # ( }) + +[//]: # ( },) + +[//]: # ( "ClearRanges": {) + +[//]: # ( "type": "array",) + +[//]: # ( "items": {) + +[//]: # ( "$ref": "#/definitions/ClearRange") + +[//]: # ( }) + +[//]: # ( },) + +[//]: # ( "nextMarker": {) + +[//]: # ( "type": "string") + +[//]: # ( }) + +[//]: # ( }) + +[//]: # ( }) + +[//]: # ( ) +[//]: # (```) + +[//]: # (### PageList schema update) + +[//]: # (``` yaml) + +[//]: # (directive:) + +[//]: # (- from: swagger-document) + +[//]: # ( where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"]) + +[//]: # ( transform: >) + +[//]: # ( delete $.get.responses["200"].schema;) + +[//]: # ( $.get.responses["200"].schema = {) + +[//]: # ( "$ref": "#/definitions/PageListCollection") + +[//]: # ( };) + +[//]: # (```) + +[//]: # (### PageList diff schema update) + +[//]: # (``` yaml) + +[//]: # (directive:) + +[//]: # (- from: swagger-document) + +[//]: # ( where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"]) + +[//]: # ( transform: >) + +[//]: # ( delete $.get.responses["200"].schema;) + +[//]: # ( $.get.responses["200"].schema = {) + +[//]: # ( "$ref": "#/definitions/PageListCollection") + +[//]: # ( };) + +[//]: # (```) + ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fswagger%2FREADME.png) From d8ae96172937fef191f4bc8ce537726deb1f6a8c Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Thu, 24 Mar 2022 12:49:21 -0700 Subject: [PATCH 06/19] Got it generating --- .../blob/implementation/PageBlobsImpl.java | 279 +++--------------- .../PageBlobsGetPageRangesDiffResponse.java | 7 +- .../PageBlobsGetPageRangesResponse.java | 8 +- .../azure/storage/blob/models/PageList.java | 1 + .../azure-storage-blob/swagger/README.md | 188 +----------- 5 files changed, 63 insertions(+), 420 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java index 1650408e6285c..115d86e5fef9a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/PageBlobsImpl.java @@ -17,8 +17,6 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.Base64Util; import com.azure.core.util.Context; @@ -27,9 +25,7 @@ import com.azure.storage.blob.implementation.models.PageBlobsClearPagesResponse; import com.azure.storage.blob.implementation.models.PageBlobsCopyIncrementalResponse; import com.azure.storage.blob.implementation.models.PageBlobsCreateResponse; -import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffNextResponse; import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffResponse; -import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesNextResponse; import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesResponse; import com.azure.storage.blob.implementation.models.PageBlobsResizeResponse; import com.azure.storage.blob.implementation.models.PageBlobsUpdateSequenceNumberResponse; @@ -41,7 +37,6 @@ import com.azure.storage.blob.models.BlobStorageException; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.EncryptionAlgorithmType; -import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; import java.nio.ByteBuffer; import java.time.OffsetDateTime; @@ -332,43 +327,6 @@ Mono copyIncremental( @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getPageRangesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("url") String url, - @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(BlobStorageException.class) - Mono getPageRangesDiffNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("url") String url, - @HeaderParam("x-ms-previous-snapshot-url") String prevSnapshotUrl, - @HeaderParam("x-ms-range") String range, - @HeaderParam("x-ms-lease-id") String leaseId, - @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince, - @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince, - @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("x-ms-if-tags") String ifTags, - @HeaderParam("x-ms-version") String version, - @HeaderParam("x-ms-client-request-id") String requestId, - @HeaderParam("Accept") String accept, - Context context); } /** @@ -950,10 +908,10 @@ public Mono uploadPagesFromURLWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesSinglePageAsync( + public Mono getPageRangesWithResponseAsync( String containerName, String blob, String snapshot, @@ -976,34 +934,25 @@ public Mono> getPageRangesSinglePageAsync( DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.getPageRanges( - this.client.getUrl(), - containerName, - blob, - comp, - snapshot, - timeout, - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - marker, - maxresults, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextMarker(), - res.getDeserializedHeaders())); + this.client.getUrl(), + containerName, + blob, + comp, + snapshot, + timeout, + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + marker, + maxresults, + accept, + context); } /** @@ -1052,10 +1001,10 @@ public Mono> getPageRangesSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws BlobStorageException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of pages on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffSinglePageAsync( + public Mono getPageRangesDiffWithResponseAsync( String containerName, String blob, String snapshot, @@ -1080,36 +1029,27 @@ public Mono> getPageRangesDiffSinglePageAsync( DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); return service.getPageRangesDiff( - this.client.getUrl(), - containerName, - blob, - comp, - snapshot, - timeout, - prevsnapshot, - prevSnapshotUrl, - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - marker, - maxresults, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextMarker(), - res.getDeserializedHeaders())); + this.client.getUrl(), + containerName, + blob, + comp, + snapshot, + timeout, + prevsnapshot, + prevSnapshotUrl, + range, + leaseId, + ifModifiedSinceConverted, + ifUnmodifiedSinceConverted, + ifMatch, + ifNoneMatch, + ifTags, + this.client.getVersion(), + requestId, + marker, + maxresults, + accept, + context); } /** @@ -1340,135 +1280,4 @@ public Mono copyIncrementalWithResponseAsync( accept, context); } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesNextSinglePageAsync( - String nextLink, - String range, - String leaseId, - OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, - String ifMatch, - String ifNoneMatch, - String ifTags, - String requestId, - Context context) { - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted = - ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted = - ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesNext( - nextLink, - this.client.getUrl(), - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextMarker(), - res.getDeserializedHeaders())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param prevSnapshotUrl Optional. This header is only supported in service versions 2019-04-19 and after and - * specifies the URL of a previous snapshot of the target blob. The response will only contain pages that were - * changed between the target blob and its previous snapshot. - * @param range Return only the bytes of the blob in the specified range. - * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID. - * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the - * specified date/time. - * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since - * the specified date/time. - * @param ifMatch Specify an ETag value to operate only on blobs with a matching value. - * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value. - * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value. - * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the - * analytics logs when storage analytics logging is enabled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws BlobStorageException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getPageRangesDiffNextSinglePageAsync( - String nextLink, - String prevSnapshotUrl, - String range, - String leaseId, - OffsetDateTime ifModifiedSince, - OffsetDateTime ifUnmodifiedSince, - String ifMatch, - String ifNoneMatch, - String ifTags, - String requestId, - Context context) { - final String accept = "application/xml"; - DateTimeRfc1123 ifModifiedSinceConverted = - ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince); - DateTimeRfc1123 ifUnmodifiedSinceConverted = - ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince); - return service.getPageRangesDiffNext( - nextLink, - this.client.getUrl(), - prevSnapshotUrl, - range, - leaseId, - ifModifiedSinceConverted, - ifUnmodifiedSinceConverted, - ifMatch, - ifNoneMatch, - ifTags, - this.client.getVersion(), - requestId, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextMarker(), - res.getDeserializedHeaders())); - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java index 13f66ac33651f..e454deb04d79f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java @@ -7,10 +7,11 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; +import com.azure.storage.blob.models.PageList; /** Contains all response data for the getPageRangesDiff operation. */ public final class PageBlobsGetPageRangesDiffResponse - extends ResponseBase { + extends ResponseBase { /** * Creates an instance of PageBlobsGetPageRangesDiffResponse. * @@ -24,14 +25,14 @@ public PageBlobsGetPageRangesDiffResponse( HttpRequest request, int statusCode, HttpHeaders rawHeaders, - PageListCollection value, + PageList value, PageBlobsGetPageRangesDiffHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** @return the deserialized response body. */ @Override - public PageListCollection getValue() { + public PageList getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java index e03c4adc59663..015ac69ddf3ef 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java @@ -7,10 +7,10 @@ import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpRequest; import com.azure.core.http.rest.ResponseBase; +import com.azure.storage.blob.models.PageList; /** Contains all response data for the getPageRanges operation. */ -public final class PageBlobsGetPageRangesResponse - extends ResponseBase { +public final class PageBlobsGetPageRangesResponse extends ResponseBase { /** * Creates an instance of PageBlobsGetPageRangesResponse. * @@ -24,14 +24,14 @@ public PageBlobsGetPageRangesResponse( HttpRequest request, int statusCode, HttpHeaders rawHeaders, - PageListCollection value, + PageList value, PageBlobsGetPageRangesHeaders headers) { super(request, statusCode, rawHeaders, value, headers); } /** @return the deserialized response body. */ @Override - public PageListCollection getValue() { + public PageList getValue() { return super.getValue(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java index 353f306b7a506..657baf212d412 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index f1669f3fd730f..58ed91777b852 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -555,21 +555,14 @@ directive: delete $["x-ms-pageable"]; ``` -[//]: # (### Delete Container_ListBlobHierarchySegment x-ms-pageable as autorest can't recognize the itemName for this) - -[//]: # (``` yaml) - -[//]: # (directive:) - -[//]: # (- from: swagger-document) - -[//]: # ( where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&hierarchy"].get) - -[//]: # ( transform: >) - -[//]: # ( delete $["x-ms-pageable"];) - -[//]: # (```) +### Delete Container_ListBlobHierarchySegment x-ms-pageable as autorest can't recognize the itemName for this +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}?restype=container&comp=list&hierarchy"].get + transform: > + delete $["x-ms-pageable"]; +``` ### BlobDeleteType expandable string enum ``` yaml @@ -584,7 +577,7 @@ directive: ``` yaml directive: - from: swagger-document - where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"] + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"].get transform: > delete $["x-ms-pageable"]; ``` @@ -593,170 +586,9 @@ directive: ``` yaml directive: - from: swagger-document - where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"] + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"].get transform: > delete $["x-ms-pageable"]; ``` -[//]: # (### Define PageListSegment) - -[//]: # (```yaml) - -[//]: # (directive:) - -[//]: # (- from: swagger-document) - -[//]: # ( where: $.definitions) - -[//]: # ( transform: >) - -[//]: # ( $.PageListSegment = {) - -[//]: # ( "type": "object",) - -[//]: # ( "properties": {) - -[//]: # ( "PageRanges": {) - -[//]: # ( "type": "array",) - -[//]: # ( "items": {) - -[//]: # ( "$ref": "#/definitions/PageRange") - -[//]: # ( }) - -[//]: # ( },) - -[//]: # ( "ClearRanges": {) - -[//]: # ( "type": "array",) - -[//]: # ( "items": {) - -[//]: # ( "$ref": "#/definitions/ClearRange") - -[//]: # ( }) - -[//]: # ( },) - -[//]: # ( "NextMarker": {) - -[//]: # ( "type": "string") - -[//]: # ( }) - -[//]: # ( }) - -[//]: # ( }) - -[//]: # ( ) -[//]: # (```) - -[//]: # () -[//]: # (### Define PageListCollection) - -[//]: # (```yaml) - -[//]: # (directive:) - -[//]: # (- from: swagger-document) - -[//]: # ( where: $.definitions) - -[//]: # ( transform: >) - -[//]: # ( $.PageListCollection = {) - -[//]: # ( "xml": {) - -[//]: # ( "name": "PageList") - -[//]: # ( },) - -[//]: # ( "type": "object",) - -[//]: # ( "properties": {) - -[//]: # ( "PageRanges": {) - -[//]: # ( "type": "array",) - -[//]: # ( "items": {) - -[//]: # ( "$ref": "#/definitions/PageRange") - -[//]: # ( }) - -[//]: # ( },) - -[//]: # ( "ClearRanges": {) - -[//]: # ( "type": "array",) - -[//]: # ( "items": {) - -[//]: # ( "$ref": "#/definitions/ClearRange") - -[//]: # ( }) - -[//]: # ( },) - -[//]: # ( "nextMarker": {) - -[//]: # ( "type": "string") - -[//]: # ( }) - -[//]: # ( }) - -[//]: # ( }) - -[//]: # ( ) -[//]: # (```) - -[//]: # (### PageList schema update) - -[//]: # (``` yaml) - -[//]: # (directive:) - -[//]: # (- from: swagger-document) - -[//]: # ( where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist"]) - -[//]: # ( transform: >) - -[//]: # ( delete $.get.responses["200"].schema;) - -[//]: # ( $.get.responses["200"].schema = {) - -[//]: # ( "$ref": "#/definitions/PageListCollection") - -[//]: # ( };) - -[//]: # (```) - -[//]: # (### PageList diff schema update) - -[//]: # (``` yaml) - -[//]: # (directive:) - -[//]: # (- from: swagger-document) - -[//]: # ( where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"]) - -[//]: # ( transform: >) - -[//]: # ( delete $.get.responses["200"].schema;) - -[//]: # ( $.get.responses["200"].schema = {) - -[//]: # ( "$ref": "#/definitions/PageListCollection") - -[//]: # ( };) - -[//]: # (```) - ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fswagger%2FREADME.png) From e095a001d1656aaa7d3c48e09ef35e9073d69aae Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Fri, 25 Mar 2022 13:07:18 -0700 Subject: [PATCH 07/19] Finished feature --- .../blob/implementation/BlobsImpl.java | 6 - .../blob/implementation/BlockBlobsImpl.java | 6 - .../models/BlobHierarchyListSegment.java | 1 + .../storage/blob/models/PageBlobRange.java | 28 ++ .../blob/models/PageListDeserializer.java | 6 +- .../PageBlobGetPageRangesDiffOptions.java | 60 ++++ .../options/PageBlobGetPageRangesOptions.java | 53 ++++ .../blob/specialized/BlobAsyncClientBase.java | 2 +- .../specialized/BlockBlobAsyncClient.java | 4 +- .../blob/specialized/PageBlobAsyncClient.java | 270 +++++++++++++++++- .../blob/specialized/PageBlobClient.java | 137 +++++++++ .../azure-storage-blob/swagger/README.md | 2 +- 12 files changed, 555 insertions(+), 20 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java index c0604daf9d658..ff32b346f030a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java @@ -25,7 +25,6 @@ import com.azure.core.util.Base64Util; import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; -import com.azure.storage.blob.implementation.models.BlobCopySourceTags; import com.azure.storage.blob.implementation.models.BlobDeleteType; import com.azure.storage.blob.implementation.models.BlobExpiryOptions; import com.azure.storage.blob.implementation.models.BlobTags; @@ -487,7 +486,6 @@ Mono copyFromURL( @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, @HeaderParam("x-ms-encryption-scope") String encryptionScope, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTags copySourceTags, @HeaderParam("Accept") String accept, Context context); @@ -1868,8 +1866,6 @@ public Mono startCopyFromURLWithResponseAsync( * @param legalHold Specified if a legal hold should be set on the blob. * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. * @param encryptionScopeParam Parameter group. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1902,7 +1898,6 @@ public Mono copyFromURLWithResponseAsync( BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, String copySourceAuthorization, - BlobCopySourceTags copySourceTags, EncryptionScope encryptionScopeParam, Context context) { final String xMsRequiresSync = "true"; @@ -1951,7 +1946,6 @@ public Mono copyFromURLWithResponseAsync( legalHold, copySourceAuthorization, encryptionScope, - copySourceTags, accept, context); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java index 75ee74d897d32..da9bcbcbd1a78 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlockBlobsImpl.java @@ -21,7 +21,6 @@ import com.azure.core.util.Base64Util; import com.azure.core.util.Context; import com.azure.core.util.DateTimeRfc1123; -import com.azure.storage.blob.implementation.models.BlobCopySourceTags; import com.azure.storage.blob.implementation.models.BlockBlobsCommitBlockListResponse; import com.azure.storage.blob.implementation.models.BlockBlobsGetBlockListResponse; import com.azure.storage.blob.implementation.models.BlockBlobsPutBlobFromUrlResponse; @@ -149,7 +148,6 @@ Mono putBlobFromUrl( @HeaderParam("x-ms-copy-source") String copySource, @HeaderParam("x-ms-copy-source-blob-properties") Boolean copySourceBlobProperties, @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization, - @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTags copySourceTags, @HeaderParam("Accept") String accept, Context context); @@ -478,8 +476,6 @@ public Mono uploadWithResponseAsync( * copied. * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to * copy source. - * @param copySourceTags Optional, default 'replace'. Indicates if source tags should be copied or replaced with the - * tags specified by x-ms-tags. * @param blobHttpHeaders Parameter group. * @param cpkInfo Parameter group. * @param encryptionScopeParam Parameter group. @@ -515,7 +511,6 @@ public Mono putBlobFromUrlWithResponseAsync( String blobTagsString, Boolean copySourceBlobProperties, String copySourceAuthorization, - BlobCopySourceTags copySourceTags, BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, @@ -621,7 +616,6 @@ public Mono putBlobFromUrlWithResponseAsync( copySource, copySourceBlobProperties, copySourceAuthorization, - copySourceTags, accept, context); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java index 3295326a2bc6b..74eb721fecdff 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobHierarchyListSegment.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; import java.util.ArrayList; import java.util.List; diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java new file mode 100644 index 0000000000000..d315f9c1ce653 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.models; + +public class PageBlobRange { + private final long start; + private final long end; + private final boolean isClear; + + public PageBlobRange(long start, long end, boolean isClear) { + this.start = start; + this.end = end; + this.isClear = isClear; + } + + public long getStart() { + return this.start; + } + + public long getEnd() { + return this.end; + } + + public boolean isClear() { + return this.isClear; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java index f7ab9521f2392..7e089ec2865d3 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java @@ -53,6 +53,7 @@ public PageList getNullValue(DeserializationContext ctxt) { public PageList deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { ArrayList pageRanges = new ArrayList<>(); ArrayList clearRanges = new ArrayList<>(); + String nextMarker = null; // Get the deserializer that handles PageRange. JsonDeserializer pageRangeDeserializer = @@ -73,9 +74,12 @@ public PageList deserialize(JsonParser p, DeserializationContext ctxt) throws IO } else if (p.getCurrentName().equals("ClearRange")) { // Current token is the node that begins a ClearRange object. clearRanges.add((ClearRange) clearRangeDeserializer.deserialize(p, ctxt)); + } else if (p.getCurrentName().equals("NextMarker")) { + // Current token is the next marker + nextMarker = p.getText(); } } - return new PageList().setPageRange(pageRanges).setClearRange(clearRanges); + return new PageList().setPageRange(pageRanges).setClearRange(clearRanges).setNextMarker(nextMarker); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java new file mode 100644 index 0000000000000..aabc0a715dba4 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.storage.blob.options; + +import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; + +import java.time.Duration; +import java.util.Objects; + +public class PageBlobGetPageRangesDiffOptions { + private final BlobRange range; + private final String previousSnapshot; + private BlobRequestConditions requestConditions; + private Integer pageSize; + private Duration timeout; + + + public PageBlobGetPageRangesDiffOptions(BlobRange range, String previousSnapshot) { + Objects.requireNonNull(range); + Objects.requireNonNull(previousSnapshot); + this.range = new BlobRange(range.getOffset(), range.getCount()); + this.previousSnapshot = previousSnapshot; + } + + public BlobRange getRange() { + return this.range; + } + + public String getPreviousSnapshot() { + return this.previousSnapshot; + } + + public PageBlobGetPageRangesDiffOptions setMaxResultsPerPage(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + public Integer getMaxResultsPerPage() { + return this.pageSize; + } + + public BlobRequestConditions getRequestConditions() { + return this.requestConditions; + } + + public PageBlobGetPageRangesDiffOptions setRequestConditions(BlobRequestConditions requestConditions) { + this.requestConditions = requestConditions; + return this; + } + + public Duration getTimeout() { + return this.timeout; + } + + public PageBlobGetPageRangesDiffOptions setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java new file mode 100644 index 0000000000000..d78c765493194 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.storage.blob.options; + +import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; + +import java.time.Duration; +import java.util.Objects; + +public class PageBlobGetPageRangesOptions { + private final BlobRange range; + private BlobRequestConditions requestConditions; + private Integer pageSize; + private Duration timeout; + + + public PageBlobGetPageRangesOptions(BlobRange range) { + Objects.requireNonNull(range); + this.range = new BlobRange(range.getOffset(), range.getCount()); + } + + public BlobRange getRange() { + return this.range; + } + + public PageBlobGetPageRangesOptions setMaxResultsPerPage(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + public Integer getMaxResultsPerPage() { + return this.pageSize; + } + + public BlobRequestConditions getRequestConditions() { + return this.requestConditions; + } + + public PageBlobGetPageRangesOptions setRequestConditions(BlobRequestConditions requestConditions) { + this.requestConditions = requestConditions; + return this; + } + + public Duration getTimeout() { + return this.timeout; + } + + public PageBlobGetPageRangesOptions setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java index 5ed011d7763a9..e0938aed9a93a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlobAsyncClientBase.java @@ -1032,7 +1032,7 @@ Mono> copyFromUrlWithResponse(BlobCopyFromUrlOptions options, C destRequestConditions.getIfNoneMatch(), destRequestConditions.getTagsConditions(), destRequestConditions.getLeaseId(), null, null, tagsToString(options.getTags()), immutabilityPolicy.getExpiryTime(), immutabilityPolicy.getPolicyMode(), - options.hasLegalHold(), sourceAuth, null, this.encryptionScope, context) + options.hasLegalHold(), sourceAuth, this.encryptionScope, context) .map(rb -> new SimpleResponse<>(rb, rb.getDeserializedHeaders().getXMsCopyId())); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java index e9062df4f021b..0df0e68aed268 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/BlockBlobAsyncClient.java @@ -509,8 +509,8 @@ Mono> uploadFromUrlWithResponse(BlobUploadFromUrlOptions sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), - options.isCopySourceBlobProperties(), sourceAuth, null, options.getHeaders(), - getCustomerProvidedKey(),encryptionScope, + options.isCopySourceBlobProperties(), sourceAuth, options.getHeaders(), + getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index d2ef653b55e0e..884ac8a22ff4d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -8,6 +8,9 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.HttpPipeline; import com.azure.core.http.RequestConditions; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -19,6 +22,8 @@ import com.azure.storage.blob.implementation.models.EncryptionScope; import com.azure.storage.blob.implementation.models.PageBlobsClearPagesHeaders; import com.azure.storage.blob.implementation.models.PageBlobsCreateHeaders; +import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesDiffResponse; +import com.azure.storage.blob.implementation.models.PageBlobsGetPageRangesResponse; import com.azure.storage.blob.implementation.models.PageBlobsResizeHeaders; import com.azure.storage.blob.implementation.models.PageBlobsUpdateSequenceNumberHeaders; import com.azure.storage.blob.implementation.models.PageBlobsUploadPagesFromURLHeaders; @@ -28,17 +33,21 @@ import com.azure.storage.blob.models.BlobImmutabilityPolicy; import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; +import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.CopyStatusType; import com.azure.storage.blob.models.CpkInfo; import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; import com.azure.storage.blob.models.PageBlobItem; +import com.azure.storage.blob.models.PageBlobRange; import com.azure.storage.blob.models.PageBlobRequestConditions; import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; +import com.azure.storage.blob.options.PageBlobGetPageRangesDiffOptions; +import com.azure.storage.blob.options.PageBlobGetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; @@ -48,7 +57,13 @@ import java.net.MalformedURLException; import java.net.URL; import java.nio.ByteBuffer; +import java.time.Duration; +import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.function.BiFunction; +import java.util.stream.Collectors; +import java.util.stream.Stream; import static com.azure.core.util.FluxUtil.monoError; import static com.azure.core.util.FluxUtil.withContext; @@ -745,8 +760,10 @@ Mono> clearPagesWithResponse(PageRange pageRange, * @param blobRange {@link BlobRange} * * @return A reactive response containing the information of the cleared pages. + * @deprecated Use {@link #getPageRangesPageable(BlobRange)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Mono getPageRanges(BlobRange blobRange) { return getPageRangesWithResponse(blobRange, null).flatMap(FluxUtil::toMono); } @@ -775,8 +792,10 @@ public Mono getPageRanges(BlobRange blobRange) { * @param blobRange {@link BlobRange} * @param requestConditions {@link BlobRequestConditions} * @return A reactive response emitting all the page ranges. + * @deprecated Use {@link #getPageRangesPageable(PageBlobGetPageRangesOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequestConditions requestConditions) { try { @@ -792,14 +811,134 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions; context = context == null ? Context.NONE : context; - return this.azureBlobStorage.getPageBlobs().getPageRangesSinglePageAsync(containerName, blobName, + return this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, getSnapshotId(), null, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), requestConditions.getTagsConditions(), null, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(response -> new SimpleResponse<>(response.getRequest(), response.getStatusCode(), - response.getHeaders(), response.getValue().get(0))); + response.getHeaders(), response.getValue())); + } + + /** + * Returns the list of valid page ranges for a page blob or snapshot of a page blob. For more information, see the + * Azure Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     *
+     * client.getPageRanges(blobRange).subscribe(response -> {
+     *     System.out.println("Valid Page Ranges are:");
+     *     for (PageRange pageRange : response.getPageRange()) {
+     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *     }
+     * });
+     * 
+ * + * + * @param blobRange {@link BlobRange} + * + * @return A reactive response containing the information of the cleared pages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedFlux getPageRangesPageable(BlobRange blobRange) { + return getPageRangesPageable(new PageBlobGetPageRangesOptions(blobRange)); + } + + /** + * Returns the list of valid page ranges for a page blob or snapshot of a page blob. For more information, see the + * Azure Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     *
+     * client.getPageRangesWithResponse(blobRange, blobRequestConditions)
+     *     .subscribe(response -> {
+     *         System.out.println("Valid Page Ranges are:");
+     *         for (PageRange pageRange : response.getValue().getPageRange()) {
+     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *         }
+     *     });
+     * 
+ * + * + * @param options {@link PageBlobGetPageRangesOptions} + * @return A reactive response emitting all the page ranges. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedFlux getPageRangesPageable(PageBlobGetPageRangesOptions options) { + return getPageRangesWithOptionalTimeout(options, null); + } + + /* + * Implementation for this paged listing operation, supporting an optional timeout provided by the synchronous + * ContainerClient. Applies the given timeout to each Mono backing the + * PagedFlux. + * + * @param delimiter The delimiter for blob hierarchy, "/" for hierarchy based on directories + * @param options {@link PageBlobGetPageRangesOptions} + * @param timeout An optional timeout to be applied to the network asynchronous operations. + * @return A reactive response emitting the listed blobs, flattened. + */ + PagedFlux getPageRangesWithOptionalTimeout(PageBlobGetPageRangesOptions options, + Duration timeout) { + BiFunction>> func = + (marker, pageSize) -> { + PageBlobGetPageRangesOptions finalOptions; + /* + If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. + Otherwise, prefer the new value. + */ + if (pageSize != null) { + finalOptions = new PageBlobGetPageRangesOptions(options.getRange()).setMaxResultsPerPage(pageSize); + } else { + finalOptions = options; + } + return getPageRangesSegment(marker, finalOptions, timeout) + .map(response -> { + List value = response.getValue() == null + ? Collections.emptyList() + : Stream.concat( + response.getValue().getPageRange().stream().map(PageBlobAsyncClient::toPageBlobRange), + response.getValue().getClearRange().stream().map(PageBlobAsyncClient::toPageBlobRange) + ).collect(Collectors.toList()); + + return new PagedResponseBase<>( + response.getRequest(), + response.getStatusCode(), + response.getHeaders(), + value, + response.getValue().getNextMarker(), + response.getDeserializedHeaders()); + }); + }; + return new PagedFlux<>(pageSize -> func.apply(null, pageSize), func); + } + + private Mono getPageRangesSegment(String marker, + PageBlobGetPageRangesOptions options, Duration timeout) { + + return StorageImplUtils.applyOptionalTimeout( + this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, + null, null, null, null, null, null, null, null, null, null, marker, options.getMaxResultsPerPage(), + Context.NONE), + timeout); + } + + private static PageBlobRange toPageBlobRange(PageRange range) { + return new PageBlobRange(range.getStart(), range.getEnd(), false); + } + + private static PageBlobRange toPageBlobRange(ClearRange range) { + return new PageBlobRange(range.getStart(), range.getEnd(), true); } /** @@ -829,8 +968,10 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ * long as the snapshot specified by prevsnapshot is the older of the two. * * @return A reactive response emitting all the different page ranges. + * @deprecated See {@link #getPageRangesDiffPageable(BlobRange, String)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Mono getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return getPageRangesDiffWithResponse(blobRange, prevSnapshot, null).flatMap(FluxUtil::toMono); } @@ -866,8 +1007,10 @@ public Mono getPageRangesDiff(BlobRange blobRange, String prevSnapshot * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} + * @deprecated See {@link #getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Mono> getPageRangesDiffWithResponse(BlobRange blobRange, String prevSnapshot, BlobRequestConditions requestConditions) { try { @@ -878,6 +1021,72 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang } } + /** + * Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more + * information, see the Azure + * Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * final String prevSnapshot = "previous snapshot";
+     *
+     * client.getPageRangesDiff(blobRange, prevSnapshot).subscribe(response -> {
+     *     System.out.println("Valid Page Ranges are:");
+     *     for (PageRange pageRange : response.getPageRange()) {
+     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *     }
+     * });
+     * 
+ * + * + * @param blobRange {@link BlobRange} + * @param prevSnapshot Specifies that the response will contain only pages that were changed between target blob and + * previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as + * long as the snapshot specified by prevsnapshot is the older of the two. + * + * @return A reactive response emitting all the different page ranges. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedFlux getPageRangesDiffPageable(BlobRange blobRange, String prevSnapshot) { + return getPageRangesDiffPageable(new PageBlobGetPageRangesDiffOptions(blobRange, prevSnapshot)); + } + + /** + * Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more + * information, see the Azure + * Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * final String prevSnapshot = "previous snapshot";
+     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     *
+     * client.getPageRangesDiffWithResponse(blobRange, prevSnapshot, blobRequestConditions)
+     *     .subscribe(response -> {
+     *         System.out.println("Valid Page Ranges are:");
+     *         for (PageRange pageRange : response.getValue().getPageRange()) {
+     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *         }
+     *     });
+     * 
+ * + * + * @param options {@link PageBlobGetPageRangesDiffOptions}. + * @return A reactive response emitting all the different page ranges. + * + * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedFlux getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions options) { + return getPageRangesDiffWithOptionalTimeout(options, null); + } + /** * This API only works for managed disk accounts. *

Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more @@ -975,7 +1184,7 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri } context = context == null ? Context.NONE : context; - return this.azureBlobStorage.getPageBlobs().getPageRangesDiffSinglePageAsync(containerName, blobName, + return this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponseAsync(containerName, blobName, getSnapshotId(), null, prevSnapshot, prevSnapshotUrl, blobRange.toHeaderValue(), requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), requestConditions.getIfMatch(), @@ -985,6 +1194,61 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri response.getHeaders(), response.getValue())); } + /* + * Implementation for this paged listing operation, supporting an optional timeout provided by the synchronous + * ContainerClient. Applies the given timeout to each Mono backing the + * PagedFlux. + * + * @param delimiter The delimiter for blob hierarchy, "/" for hierarchy based on directories + * @param options {@link PageBlobGetPageRangesDiffOptions} + * @param timeout An optional timeout to be applied to the network asynchronous operations. + * @return A reactive response emitting the listed blobs, flattened. + */ + PagedFlux getPageRangesDiffWithOptionalTimeout(PageBlobGetPageRangesDiffOptions options, + Duration timeout) { + BiFunction>> func = + (marker, pageSize) -> { + PageBlobGetPageRangesDiffOptions finalOptions; + /* + If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. + Otherwise, prefer the new value. + */ + if (pageSize != null) { + finalOptions = + new PageBlobGetPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) + .setMaxResultsPerPage(pageSize); + } else { + finalOptions = options; + } + return getPageRangesDiffSegment(marker, finalOptions, timeout) + .map(response -> { + List value = response.getValue() == null + ? Collections.emptyList() + : response.getValue().getClearRange(); + + return new PagedResponseBase<>( + response.getRequest(), + response.getStatusCode(), + response.getHeaders(), + value, + response.getValue().getNextMarker(), + response.getDeserializedHeaders()); + }); + }; + return new PagedFlux<>(pageSize -> func.apply(null, pageSize), func); + } + + private Mono getPageRangesDiffSegment(String marker, + PageBlobGetPageRangesDiffOptions options, Duration timeout) { + + return StorageImplUtils.applyOptionalTimeout( + this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponseAsync(containerName, blobName, + null, null, null, null, null, null, null, null, null, null, null, null, marker, + options.getMaxResultsPerPage(), + Context.NONE), + timeout); + } + /** * Resizes the page blob to the specified size (which must be a multiple of 512). For more information, see the Azure Docs. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index a17e71d40690a..216d6d7d90b16 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.UnexpectedLengthException; import com.azure.core.http.RequestConditions; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.storage.blob.BlobClient; @@ -16,8 +17,10 @@ import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.BlobStorageException; +import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.CopyStatusType; import com.azure.storage.blob.models.CustomerProvidedKey; +import com.azure.storage.blob.models.PageBlobRange; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.models.PageBlobItem; @@ -25,6 +28,8 @@ import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; +import com.azure.storage.blob.options.PageBlobGetPageRangesDiffOptions; +import com.azure.storage.blob.options.PageBlobGetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; @@ -576,8 +581,10 @@ public Response clearPagesWithResponse(PageRange pageRange, * * @param blobRange {@link BlobRange} * @return The information of the cleared pages. + * @deprecated See {@link #getPageRangesPageable(BlobRange)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public PageList getPageRanges(BlobRange blobRange) { return getPageRangesWithResponse(blobRange, null, null, Context.NONE).getValue(); } @@ -609,14 +616,73 @@ public PageList getPageRanges(BlobRange blobRange) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the page ranges. + * @deprecated See {@link #getPageRangesPageable(PageBlobGetPageRangesOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Response getPageRangesWithResponse(BlobRange blobRange, BlobRequestConditions requestConditions, Duration timeout, Context context) { return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient .getPageRangesWithResponse(blobRange, requestConditions, context), timeout); } + /** + * Returns the list of valid page ranges for a page blob or snapshot of a page blob. For more information, see the + * Azure Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     *
+     * client.getPageRanges(blobRange).subscribe(response -> {
+     *     System.out.println("Valid Page Ranges are:");
+     *     for (PageRange pageRange : response.getPageRange()) {
+     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *     }
+     * });
+     * 
+ * + * + * @param blobRange {@link BlobRange} + * + * @return A reactive response containing the information of the cleared pages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedIterable getPageRangesPageable(BlobRange blobRange) { + return getPageRangesPageable(new PageBlobGetPageRangesOptions(blobRange)); + } + + /** + * Returns the list of valid page ranges for a page blob or snapshot of a page blob. For more information, see the + * Azure Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     *
+     * client.getPageRangesWithResponse(blobRange, blobRequestConditions)
+     *     .subscribe(response -> {
+     *         System.out.println("Valid Page Ranges are:");
+     *         for (PageRange pageRange : response.getValue().getPageRange()) {
+     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *         }
+     *     });
+     * 
+ * + * + * @param options {@link PageBlobGetPageRangesOptions} + * @return A reactive response emitting all the page ranges. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedIterable getPageRangesPageable(PageBlobGetPageRangesOptions options) { + return new PagedIterable<>(pageBlobAsyncClient.getPageRangesWithOptionalTimeout(options, options.getTimeout())); + } + /** * Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more * information, see the Azure @@ -642,8 +708,10 @@ public Response getPageRangesWithResponse(BlobRange blobRange, BlobReq * previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as * long as the snapshot specified by prevsnapshot is the older of the two. * @return All the different page ranges. + * @deprecated See {@link #getPageRangesDiffPageable(BlobRange, String)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return getPageRangesDiffWithResponse(blobRange, prevSnapshot, null, null, Context.NONE).getValue(); } @@ -681,8 +749,10 @@ public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the different page ranges. + * @deprecated See {@link #getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) + @Deprecated public Response getPageRangesDiffWithResponse(BlobRange blobRange, String prevSnapshot, BlobRequestConditions requestConditions, Duration timeout, Context context) { return StorageImplUtils.blockWithOptionalTimeout(pageBlobAsyncClient @@ -690,6 +760,73 @@ public Response getPageRangesDiffWithResponse(BlobRange blobRange, Str timeout); } + /** + * Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more + * information, see the Azure + * Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * final String prevSnapshot = "previous snapshot";
+     *
+     * client.getPageRangesDiff(blobRange, prevSnapshot).subscribe(response -> {
+     *     System.out.println("Valid Page Ranges are:");
+     *     for (PageRange pageRange : response.getPageRange()) {
+     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *     }
+     * });
+     * 
+ * + * + * @param blobRange {@link BlobRange} + * @param prevSnapshot Specifies that the response will contain only pages that were changed between target blob and + * previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as + * long as the snapshot specified by prevsnapshot is the older of the two. + * + * @return A reactive response emitting all the different page ranges. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedIterable getPageRangesDiffPageable(BlobRange blobRange, String prevSnapshot) { + return getPageRangesDiffPageable(new PageBlobGetPageRangesDiffOptions(blobRange, prevSnapshot)); + } + + /** + * Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more + * information, see the Azure + * Docs. + * + *

Code Samples

+ * + * + *
+     * BlobRange blobRange = new BlobRange(offset);
+     * final String prevSnapshot = "previous snapshot";
+     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     *
+     * client.getPageRangesDiffWithResponse(blobRange, prevSnapshot, blobRequestConditions)
+     *     .subscribe(response -> {
+     *         System.out.println("Valid Page Ranges are:");
+     *         for (PageRange pageRange : response.getValue().getPageRange()) {
+     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
+     *         }
+     *     });
+     * 
+ * + * + * @param options {@link PageBlobGetPageRangesDiffOptions}. + * @return A reactive response emitting all the different page ranges. + * + * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedIterable getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions options) { + return new PagedIterable<>(pageBlobAsyncClient + .getPageRangesDiffWithOptionalTimeout(options, options.getTimeout())); + } + /** * This API only works for managed disk accounts. *

Gets the collection of page ranges that differ between a specified snapshot and this page blob. For more diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index 58ed91777b852..0cdb5f7a7cb03 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -16,7 +16,7 @@ autorest --java --use:@autorest/java@4.0.x ### Code generation settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-04-10/blob.json +input-file: https://raw.githubusercontent.com/seanmcc-msft/azure-rest-api-specs/95d8b1a4c972eafa176dce585c45e7e0611fb04e/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-04-10/blob.json java: true output-folder: ../ namespace: com.azure.storage.blob From 46ac07368e3b8636533b1da6748df944e2f8f37a Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Wed, 13 Apr 2022 13:47:29 -0700 Subject: [PATCH 08/19] Changelog --- sdk/storage/azure-storage-blob/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/storage/azure-storage-blob/CHANGELOG.md b/sdk/storage/azure-storage-blob/CHANGELOG.md index 0ad9c7271b417..9b1f2ff37494d 100644 --- a/sdk/storage/azure-storage-blob/CHANGELOG.md +++ b/sdk/storage/azure-storage-blob/CHANGELOG.md @@ -3,6 +3,8 @@ ## 12.17.0-beta.1 (Unreleased) ### Features Added +- Added support for 2021-04-10 service version. +- Added the ability to list PageRanges and PageRangesDiff by page. ### Breaking Changes From 94e14387518406a1215a4f6af55fbcc8d21dedff Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Thu, 14 Apr 2022 11:34:34 -0700 Subject: [PATCH 09/19] Some apiview feedback --- .../storage/blob/models/BlobErrorCode.java | 5 +- .../storage/blob/models/PageBlobRange.java | 28 ----- .../storage/blob/models/PageRangeItem.java | 44 +++++++ .../options/GetPageRangesDiffOptions.java | 110 ++++++++++++++++++ .../blob/options/GetPageRangesOptions.java | 97 +++++++++++++++ .../PageBlobGetPageRangesDiffOptions.java | 60 ---------- .../options/PageBlobGetPageRangesOptions.java | 53 --------- .../blob/specialized/PageBlobAsyncClient.java | 68 +++++------ .../blob/specialized/PageBlobClient.java | 34 +++--- 9 files changed, 307 insertions(+), 192 deletions(-) delete mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageRangeItem.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java delete mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java delete mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java index e8a5852567fa4..2b7ab48afdd3e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java @@ -369,7 +369,10 @@ public final class BlobErrorCode extends ExpandableStringEnum { public static final BlobErrorCode AUTHORIZATION_RESOURCE_TYPE_MISMATCH = fromString("AuthorizationResourceTypeMismatch"); - /** Static value SnaphotOperationRateExceeded for BlobErrorCode. */ + /** Static value SnaphotOperationRateExceeded for BlobErrorCode. + * @deprecated Please use {@link BlobErrorCode#SNAPSHOT_OPERATION_RATE_EXCEEDED} + */ + @Deprecated public static final BlobErrorCode SNAPHOT_OPERATION_RATE_EXCEEDED = fromString("SnaphotOperationRateExceeded"); /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java deleted file mode 100644 index d315f9c1ce653..0000000000000 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageBlobRange.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.blob.models; - -public class PageBlobRange { - private final long start; - private final long end; - private final boolean isClear; - - public PageBlobRange(long start, long end, boolean isClear) { - this.start = start; - this.end = end; - this.isClear = isClear; - } - - public long getStart() { - return this.start; - } - - public long getEnd() { - return this.end; - } - - public boolean isClear() { - return this.isClear; - } -} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageRangeItem.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageRangeItem.java new file mode 100644 index 0000000000000..65dcf153716a9 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageRangeItem.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.models; + +import com.azure.core.http.HttpRange; +import com.azure.storage.blob.specialized.PageBlobClient; + +/** + * Represents a page range on a page blob returned by {@link PageBlobClient#listPageRanges(BlobRange)}. + */ +public final class PageRangeItem { + private final HttpRange range; + private final boolean isClear; + + /** + * Creates a new {@code PageRangeItem}. + * + * @param range The {@link HttpRange}. + * @param isClear Whether the bytes are cleared. + */ + public PageRangeItem(HttpRange range, boolean isClear) { + this.range = range; + this.isClear = isClear; + } + + /** + * Gets the range property. + * + * @return The range property. + */ + public HttpRange getRange() { + return range; + } + + /** + * Gets whether the range is cleared. + * + * @return Whether the range is cleared. + */ + public boolean isClear() { + return this.isClear; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java new file mode 100644 index 0000000000000..0b0804cb88823 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.storage.blob.options; + +import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; + +import java.time.Duration; +import java.util.Objects; + +/** + * Extended options that may be passed when getting the page ranges diff of a page blob. + */ +public class GetPageRangesDiffOptions { + private final BlobRange range; + private final String previousSnapshot; + private BlobRequestConditions requestConditions; + private Integer pageSize; + private Duration timeout; + + + /** + * @param range The range to diff. + * @param previousSnapshot The previous snapshot that will serve as the base of the diff. + */ + public GetPageRangesDiffOptions(BlobRange range, String previousSnapshot) { + Objects.requireNonNull(range); + Objects.requireNonNull(previousSnapshot); + this.range = new BlobRange(range.getOffset(), range.getCount()); + this.previousSnapshot = previousSnapshot; + } + + /** + * Gets the range property. + * + * @return The range property. + */ + public BlobRange getRange() { + return range; + } + + /** + * Gets the previousSnapshot property. + * + * @return The previousSnapshot property. + */ + public String getPreviousSnapshot() { + return previousSnapshot; + } + + /** + * Gets the requestConditions property. + * + * @return The requestConditions property. + */ + public BlobRequestConditions getRequestConditions() { + return requestConditions; + } + + /** + * Sets the requestConditions property. + * + * @param requestConditions The requestConditions value to set. + * @return The updated object + */ + public GetPageRangesDiffOptions setRequestConditions(BlobRequestConditions requestConditions) { + this.requestConditions = requestConditions; + return this; + } + + /** + * Gets the pageSize property. + * + * @return The pageSize property. + */ + public Integer getMaxResultsPerPage() { + return pageSize; + } + + /** + * Sets the pageSize property. + * + * @param pageSize The pageSize value to set. + * @return The updated object + */ + public GetPageRangesDiffOptions setMaxResultsPerPage(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Gets the timeout property. + * + * @return The timeout property. + */ + public Duration getTimeout() { + return timeout; + } + + /** + * Sets the timeout property. + * + * @param timeout The timeout value to set. + * @return The updated object + */ + public GetPageRangesDiffOptions setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java new file mode 100644 index 0000000000000..67ca212fce7b3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.storage.blob.options; + +import com.azure.storage.blob.models.BlobRange; +import com.azure.storage.blob.models.BlobRequestConditions; + +import java.time.Duration; +import java.util.Objects; + +/** + * Extended options that may be passed when getting the page ranges of a page blob. + */ +public class GetPageRangesOptions { + private final BlobRange range; + private BlobRequestConditions requestConditions; + private Integer pageSize; + private Duration timeout; + + + /** + * @param range The range to diff. + */ + public GetPageRangesOptions(BlobRange range) { + Objects.requireNonNull(range); + this.range = new BlobRange(range.getOffset(), range.getCount()); + } + + /** + * Gets the range property. + * + * @return The range property. + */ + public BlobRange getRange() { + return range; + } + + /** + * Gets the requestConditions property. + * + * @return The requestConditions property. + */ + public BlobRequestConditions getRequestConditions() { + return requestConditions; + } + + /** + * Sets the requestConditions property. + * + * @param requestConditions The requestConditions value to set. + * @return The updated object + */ + public GetPageRangesOptions setRequestConditions(BlobRequestConditions requestConditions) { + this.requestConditions = requestConditions; + return this; + } + + /** + * Gets the pageSize property. + * + * @return The pageSize property. + */ + public Integer getMaxResultsPerPage() { + return pageSize; + } + + /** + * Sets the pageSize property. + * + * @param pageSize The pageSize value to set. + * @return The updated object + */ + public GetPageRangesOptions setMaxResultsPerPage(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Gets the timeout property. + * + * @return The timeout property. + */ + public Duration getTimeout() { + return timeout; + } + + /** + * Sets the timeout property. + * + * @param timeout The timeout value to set. + * @return The updated object + */ + public GetPageRangesOptions setTimeout(Duration timeout) { + this.timeout = timeout; + return this; + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java deleted file mode 100644 index aabc0a715dba4..0000000000000 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesDiffOptions.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.blob.options; - -import com.azure.storage.blob.models.BlobRange; -import com.azure.storage.blob.models.BlobRequestConditions; - -import java.time.Duration; -import java.util.Objects; - -public class PageBlobGetPageRangesDiffOptions { - private final BlobRange range; - private final String previousSnapshot; - private BlobRequestConditions requestConditions; - private Integer pageSize; - private Duration timeout; - - - public PageBlobGetPageRangesDiffOptions(BlobRange range, String previousSnapshot) { - Objects.requireNonNull(range); - Objects.requireNonNull(previousSnapshot); - this.range = new BlobRange(range.getOffset(), range.getCount()); - this.previousSnapshot = previousSnapshot; - } - - public BlobRange getRange() { - return this.range; - } - - public String getPreviousSnapshot() { - return this.previousSnapshot; - } - - public PageBlobGetPageRangesDiffOptions setMaxResultsPerPage(Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - public Integer getMaxResultsPerPage() { - return this.pageSize; - } - - public BlobRequestConditions getRequestConditions() { - return this.requestConditions; - } - - public PageBlobGetPageRangesDiffOptions setRequestConditions(BlobRequestConditions requestConditions) { - this.requestConditions = requestConditions; - return this; - } - - public Duration getTimeout() { - return this.timeout; - } - - public PageBlobGetPageRangesDiffOptions setTimeout(Duration timeout) { - this.timeout = timeout; - return this; - } -} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java deleted file mode 100644 index d78c765493194..0000000000000 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/PageBlobGetPageRangesOptions.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -package com.azure.storage.blob.options; - -import com.azure.storage.blob.models.BlobRange; -import com.azure.storage.blob.models.BlobRequestConditions; - -import java.time.Duration; -import java.util.Objects; - -public class PageBlobGetPageRangesOptions { - private final BlobRange range; - private BlobRequestConditions requestConditions; - private Integer pageSize; - private Duration timeout; - - - public PageBlobGetPageRangesOptions(BlobRange range) { - Objects.requireNonNull(range); - this.range = new BlobRange(range.getOffset(), range.getCount()); - } - - public BlobRange getRange() { - return this.range; - } - - public PageBlobGetPageRangesOptions setMaxResultsPerPage(Integer pageSize) { - this.pageSize = pageSize; - return this; - } - - public Integer getMaxResultsPerPage() { - return this.pageSize; - } - - public BlobRequestConditions getRequestConditions() { - return this.requestConditions; - } - - public PageBlobGetPageRangesOptions setRequestConditions(BlobRequestConditions requestConditions) { - this.requestConditions = requestConditions; - return this; - } - - public Duration getTimeout() { - return this.timeout; - } - - public PageBlobGetPageRangesOptions setTimeout(Duration timeout) { - this.timeout = timeout; - return this; - } -} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index c0906446e14e2..e5008f8026415 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpRange; import com.azure.core.http.RequestConditions; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; @@ -39,15 +40,15 @@ import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; import com.azure.storage.blob.models.PageBlobItem; -import com.azure.storage.blob.models.PageBlobRange; +import com.azure.storage.blob.models.PageRangeItem; import com.azure.storage.blob.models.PageBlobRequestConditions; import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; -import com.azure.storage.blob.options.PageBlobGetPageRangesDiffOptions; -import com.azure.storage.blob.options.PageBlobGetPageRangesOptions; +import com.azure.storage.blob.options.GetPageRangesDiffOptions; +import com.azure.storage.blob.options.GetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; @@ -728,7 +729,7 @@ Mono> clearPagesWithResponse(PageRange pageRange, pageBlobRequestConditions.getIfUnmodifiedSince(), pageBlobRequestConditions.getIfMatch(), pageBlobRequestConditions.getIfNoneMatch(), pageBlobRequestConditions.getTagsConditions(), null, getCustomerProvidedKey(), encryptionScope, - context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) + context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)) .map(rb -> { PageBlobsClearPagesHeaders hd = rb.getDeserializedHeaders(); PageBlobItem item = new PageBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), @@ -760,7 +761,7 @@ Mono> clearPagesWithResponse(PageRange pageRange, * @param blobRange {@link BlobRange} * * @return A reactive response containing the information of the cleared pages. - * @deprecated Use {@link #getPageRangesPageable(BlobRange)} + * @deprecated Use {@link #listPageRanges(BlobRange)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -792,7 +793,7 @@ public Mono getPageRanges(BlobRange blobRange) { * @param blobRange {@link BlobRange} * @param requestConditions {@link BlobRequestConditions} * @return A reactive response emitting all the page ranges. - * @deprecated Use {@link #getPageRangesPageable(PageBlobGetPageRangesOptions)} + * @deprecated Use {@link #listPageRanges(GetPageRangesOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -845,8 +846,8 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ * @return A reactive response containing the information of the cleared pages. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux getPageRangesPageable(BlobRange blobRange) { - return getPageRangesPageable(new PageBlobGetPageRangesOptions(blobRange)); + public PagedFlux listPageRanges(BlobRange blobRange) { + return listPageRanges(new GetPageRangesOptions(blobRange)); } /** @@ -870,12 +871,12 @@ public PagedFlux getPageRangesPageable(BlobRange blobRange) { * * * - * @param options {@link PageBlobGetPageRangesOptions} + * @param options {@link GetPageRangesOptions} * @return A reactive response emitting all the page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux getPageRangesPageable(PageBlobGetPageRangesOptions options) { - return getPageRangesWithOptionalTimeout(options, null); + public PagedFlux listPageRanges(GetPageRangesOptions options) { + return listPageRangesWithOptionalTimeout(options, null); } /* @@ -888,23 +889,23 @@ public PagedFlux getPageRangesPageable(PageBlobGetPageRangesOptio * @param timeout An optional timeout to be applied to the network asynchronous operations. * @return A reactive response emitting the listed blobs, flattened. */ - PagedFlux getPageRangesWithOptionalTimeout(PageBlobGetPageRangesOptions options, + PagedFlux listPageRangesWithOptionalTimeout(GetPageRangesOptions options, Duration timeout) { - BiFunction>> func = + BiFunction>> func = (marker, pageSize) -> { - PageBlobGetPageRangesOptions finalOptions; + GetPageRangesOptions finalOptions; /* If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. Otherwise, prefer the new value. */ if (pageSize != null) { - finalOptions = new PageBlobGetPageRangesOptions(options.getRange()).setMaxResultsPerPage(pageSize); + finalOptions = new GetPageRangesOptions(options.getRange()).setMaxResultsPerPage(pageSize); } else { finalOptions = options; } return getPageRangesSegment(marker, finalOptions, timeout) .map(response -> { - List value = response.getValue() == null + List value = response.getValue() == null ? Collections.emptyList() : Stream.concat( response.getValue().getPageRange().stream().map(PageBlobAsyncClient::toPageBlobRange), @@ -924,7 +925,7 @@ PagedFlux getPageRangesWithOptionalTimeout(PageBlobGetPageRangesO } private Mono getPageRangesSegment(String marker, - PageBlobGetPageRangesOptions options, Duration timeout) { + GetPageRangesOptions options, Duration timeout) { return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, @@ -933,12 +934,12 @@ private Mono getPageRangesSegment(String marker, timeout); } - private static PageBlobRange toPageBlobRange(PageRange range) { - return new PageBlobRange(range.getStart(), range.getEnd(), false); + private static PageRangeItem toPageBlobRange(PageRange range) { + return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart()), false); } - private static PageBlobRange toPageBlobRange(ClearRange range) { - return new PageBlobRange(range.getStart(), range.getEnd(), true); + private static PageRangeItem toPageBlobRange(ClearRange range) { + return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart()), true); } /** @@ -968,7 +969,7 @@ private static PageBlobRange toPageBlobRange(ClearRange range) { * long as the snapshot specified by prevsnapshot is the older of the two. * * @return A reactive response emitting all the different page ranges. - * @deprecated See {@link #getPageRangesDiffPageable(BlobRange, String)} + * @deprecated See {@link #listPageRangesDiff(BlobRange, String)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -1007,7 +1008,7 @@ public Mono getPageRangesDiff(BlobRange blobRange, String prevSnapshot * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} - * @deprecated See {@link #getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions)} + * @deprecated See {@link #listPageRangesDiff(GetPageRangesDiffOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -1050,8 +1051,8 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang * @return A reactive response emitting all the different page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux getPageRangesDiffPageable(BlobRange blobRange, String prevSnapshot) { - return getPageRangesDiffPageable(new PageBlobGetPageRangesDiffOptions(blobRange, prevSnapshot)); + public PagedFlux listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { + return listPageRangesDiff(new GetPageRangesDiffOptions(blobRange, prevSnapshot)); } /** @@ -1077,14 +1078,14 @@ public PagedFlux getPageRangesDiffPageable(BlobRange blobRange, Stri * * * - * @param options {@link PageBlobGetPageRangesDiffOptions}. + * @param options {@link GetPageRangesDiffOptions}. * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions options) { - return getPageRangesDiffWithOptionalTimeout(options, null); + public PagedFlux listPageRangesDiff(GetPageRangesDiffOptions options) { + return listPageRangesDiffWithOptionalTimeout(options, null); } /** @@ -1204,18 +1205,18 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri * @param timeout An optional timeout to be applied to the network asynchronous operations. * @return A reactive response emitting the listed blobs, flattened. */ - PagedFlux getPageRangesDiffWithOptionalTimeout(PageBlobGetPageRangesDiffOptions options, + PagedFlux listPageRangesDiffWithOptionalTimeout(GetPageRangesDiffOptions options, Duration timeout) { BiFunction>> func = (marker, pageSize) -> { - PageBlobGetPageRangesDiffOptions finalOptions; + GetPageRangesDiffOptions finalOptions; /* If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. Otherwise, prefer the new value. */ if (pageSize != null) { finalOptions = - new PageBlobGetPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) + new GetPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) .setMaxResultsPerPage(pageSize); } else { finalOptions = options; @@ -1239,13 +1240,14 @@ PagedFlux getPageRangesDiffWithOptionalTimeout(PageBlobGetPageRanges } private Mono getPageRangesDiffSegment(String marker, - PageBlobGetPageRangesDiffOptions options, Duration timeout) { + GetPageRangesDiffOptions options, Duration timeout, Context context) { + context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponseAsync(containerName, blobName, null, null, null, null, null, null, null, null, null, null, null, null, marker, options.getMaxResultsPerPage(), - Context.NONE), + context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)), timeout); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index 216d6d7d90b16..ff75ccdea9f8b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -20,7 +20,7 @@ import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.CopyStatusType; import com.azure.storage.blob.models.CustomerProvidedKey; -import com.azure.storage.blob.models.PageBlobRange; +import com.azure.storage.blob.models.PageRangeItem; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.models.PageBlobItem; @@ -28,8 +28,8 @@ import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; -import com.azure.storage.blob.options.PageBlobGetPageRangesDiffOptions; -import com.azure.storage.blob.options.PageBlobGetPageRangesOptions; +import com.azure.storage.blob.options.GetPageRangesDiffOptions; +import com.azure.storage.blob.options.GetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; @@ -581,7 +581,7 @@ public Response clearPagesWithResponse(PageRange pageRange, * * @param blobRange {@link BlobRange} * @return The information of the cleared pages. - * @deprecated See {@link #getPageRangesPageable(BlobRange)} + * @deprecated See {@link #listPageRanges(BlobRange)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -616,7 +616,7 @@ public PageList getPageRanges(BlobRange blobRange) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the page ranges. - * @deprecated See {@link #getPageRangesPageable(PageBlobGetPageRangesOptions)} + * @deprecated See {@link #listPageRanges(GetPageRangesOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -650,8 +650,8 @@ public Response getPageRangesWithResponse(BlobRange blobRange, BlobReq * @return A reactive response containing the information of the cleared pages. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable getPageRangesPageable(BlobRange blobRange) { - return getPageRangesPageable(new PageBlobGetPageRangesOptions(blobRange)); + public PagedIterable listPageRanges(BlobRange blobRange) { + return listPageRanges(new GetPageRangesOptions(blobRange)); } /** @@ -675,12 +675,12 @@ public PagedIterable getPageRangesPageable(BlobRange blobRange) { * * * - * @param options {@link PageBlobGetPageRangesOptions} + * @param options {@link GetPageRangesOptions} * @return A reactive response emitting all the page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable getPageRangesPageable(PageBlobGetPageRangesOptions options) { - return new PagedIterable<>(pageBlobAsyncClient.getPageRangesWithOptionalTimeout(options, options.getTimeout())); + public PagedIterable listPageRanges(GetPageRangesOptions options) { + return new PagedIterable<>(pageBlobAsyncClient.listPageRangesWithOptionalTimeout(options, options.getTimeout())); } /** @@ -708,7 +708,7 @@ public PagedIterable getPageRangesPageable(PageBlobGetPageRangesO * previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as * long as the snapshot specified by prevsnapshot is the older of the two. * @return All the different page ranges. - * @deprecated See {@link #getPageRangesDiffPageable(BlobRange, String)} + * @deprecated See {@link #listPageRangesDiff(BlobRange, String)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -749,7 +749,7 @@ public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the different page ranges. - * @deprecated See {@link #getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions)} + * @deprecated See {@link #listPageRangesDiff(GetPageRangesDiffOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -789,8 +789,8 @@ public Response getPageRangesDiffWithResponse(BlobRange blobRange, Str * @return A reactive response emitting all the different page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable getPageRangesDiffPageable(BlobRange blobRange, String prevSnapshot) { - return getPageRangesDiffPageable(new PageBlobGetPageRangesDiffOptions(blobRange, prevSnapshot)); + public PagedIterable listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { + return listPageRangesDiff(new GetPageRangesDiffOptions(blobRange, prevSnapshot)); } /** @@ -816,15 +816,15 @@ public PagedIterable getPageRangesDiffPageable(BlobRange blobRange, * * * - * @param options {@link PageBlobGetPageRangesDiffOptions}. + * @param options {@link GetPageRangesDiffOptions}. * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable getPageRangesDiffPageable(PageBlobGetPageRangesDiffOptions options) { + public PagedIterable listPageRangesDiff(GetPageRangesDiffOptions options) { return new PagedIterable<>(pageBlobAsyncClient - .getPageRangesDiffWithOptionalTimeout(options, options.getTimeout())); + .listPageRangesDiffWithOptionalTimeout(options, options.getTimeout())); } /** From a2a2dff77a8d58d6b5bf2e0261acb1b7eb89bace Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Sun, 17 Apr 2022 16:05:27 -0700 Subject: [PATCH 10/19] Starting an attempt to pass context to method --- .../storage/blob/specialized/PageBlobAsyncClient.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index e5008f8026415..d2d64abc7ed57 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -1085,7 +1085,16 @@ public PagedFlux listPageRangesDiff(BlobRange blobRange, String prev */ @ServiceMethod(returns = ReturnType.SINGLE) public PagedFlux listPageRangesDiff(GetPageRangesDiffOptions options) { - return listPageRangesDiffWithOptionalTimeout(options, null); + return new PagedFlux(); + } + + Mono> listFirstPageDiff(GetPageRangesDiffOptions options, Context context) { + + } + + Mono> listNextPageDiff(GetPageRangesDiffOptions options, String continuationToken, + Context context) { + } /** From a0648a6e2b20946748c8b29613f10386b4037b20 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Mon, 18 Apr 2022 11:08:22 -0700 Subject: [PATCH 11/19] Sorted out adding context to sync method --- ...ns.java => ListPageRangesDiffOptions.java} | 30 ++------------ .../blob/specialized/PageBlobAsyncClient.java | 40 ++++++++----------- .../blob/specialized/PageBlobClient.java | 23 +++++++---- 3 files changed, 37 insertions(+), 56 deletions(-) rename sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/{GetPageRangesDiffOptions.java => ListPageRangesDiffOptions.java} (72%) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java similarity index 72% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java index 0b0804cb88823..57aa4e9775f00 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesDiffOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesDiffOptions.java @@ -5,25 +5,23 @@ import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; -import java.time.Duration; import java.util.Objects; /** * Extended options that may be passed when getting the page ranges diff of a page blob. */ -public class GetPageRangesDiffOptions { +public class ListPageRangesDiffOptions { private final BlobRange range; private final String previousSnapshot; private BlobRequestConditions requestConditions; private Integer pageSize; - private Duration timeout; /** * @param range The range to diff. * @param previousSnapshot The previous snapshot that will serve as the base of the diff. */ - public GetPageRangesDiffOptions(BlobRange range, String previousSnapshot) { + public ListPageRangesDiffOptions(BlobRange range, String previousSnapshot) { Objects.requireNonNull(range); Objects.requireNonNull(previousSnapshot); this.range = new BlobRange(range.getOffset(), range.getCount()); @@ -63,7 +61,7 @@ public BlobRequestConditions getRequestConditions() { * @param requestConditions The requestConditions value to set. * @return The updated object */ - public GetPageRangesDiffOptions setRequestConditions(BlobRequestConditions requestConditions) { + public ListPageRangesDiffOptions setRequestConditions(BlobRequestConditions requestConditions) { this.requestConditions = requestConditions; return this; } @@ -83,28 +81,8 @@ public Integer getMaxResultsPerPage() { * @param pageSize The pageSize value to set. * @return The updated object */ - public GetPageRangesDiffOptions setMaxResultsPerPage(Integer pageSize) { + public ListPageRangesDiffOptions setMaxResultsPerPage(Integer pageSize) { this.pageSize = pageSize; return this; } - - /** - * Gets the timeout property. - * - * @return The timeout property. - */ - public Duration getTimeout() { - return timeout; - } - - /** - * Sets the timeout property. - * - * @param timeout The timeout value to set. - * @return The updated object - */ - public GetPageRangesDiffOptions setTimeout(Duration timeout) { - this.timeout = timeout; - return this; - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index d2d64abc7ed57..db13d49d0026f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -47,7 +47,7 @@ import com.azure.storage.blob.models.SequenceNumberActionType; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; -import com.azure.storage.blob.options.GetPageRangesDiffOptions; +import com.azure.storage.blob.options.ListPageRangesDiffOptions; import com.azure.storage.blob.options.GetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.implementation.Constants; @@ -1008,7 +1008,7 @@ public Mono getPageRangesDiff(BlobRange blobRange, String prevSnapshot * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} - * @deprecated See {@link #listPageRangesDiff(GetPageRangesDiffOptions)} + * @deprecated See {@link #listPageRangesDiff(ListPageRangesDiffOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -1052,7 +1052,7 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang */ @ServiceMethod(returns = ReturnType.SINGLE) public PagedFlux listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { - return listPageRangesDiff(new GetPageRangesDiffOptions(blobRange, prevSnapshot)); + return listPageRangesDiff(new ListPageRangesDiffOptions(blobRange, prevSnapshot)); } /** @@ -1078,23 +1078,18 @@ public PagedFlux listPageRangesDiff(BlobRange blobRange, String prev * * * - * @param options {@link GetPageRangesDiffOptions}. + * @param options {@link ListPageRangesDiffOptions}. * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux listPageRangesDiff(GetPageRangesDiffOptions options) { - return new PagedFlux(); - } - - Mono> listFirstPageDiff(GetPageRangesDiffOptions options, Context context) { - - } - - Mono> listNextPageDiff(GetPageRangesDiffOptions options, String continuationToken, - Context context) { - + public PagedFlux listPageRangesDiff(ListPageRangesDiffOptions options) { + return new PagedFlux<>( + pageSize -> withContext(context -> + listPageRangesDiffWithOptionalTimeout(options, null, context).apply(null, pageSize)), + (continuationToken, pageSize) -> withContext(context -> + listPageRangesDiffWithOptionalTimeout(options, null, context).apply(continuationToken, pageSize))); } /** @@ -1214,23 +1209,23 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri * @param timeout An optional timeout to be applied to the network asynchronous operations. * @return A reactive response emitting the listed blobs, flattened. */ - PagedFlux listPageRangesDiffWithOptionalTimeout(GetPageRangesDiffOptions options, - Duration timeout) { - BiFunction>> func = + BiFunction>> listPageRangesDiffWithOptionalTimeout(ListPageRangesDiffOptions options, + Duration timeout, Context context) { + return (marker, pageSize) -> { - GetPageRangesDiffOptions finalOptions; + ListPageRangesDiffOptions finalOptions; /* If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. Otherwise, prefer the new value. */ if (pageSize != null) { finalOptions = - new GetPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) + new ListPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) .setMaxResultsPerPage(pageSize); } else { finalOptions = options; } - return getPageRangesDiffSegment(marker, finalOptions, timeout) + return getPageRangesDiffSegment(marker, finalOptions, timeout, context) .map(response -> { List value = response.getValue() == null ? Collections.emptyList() @@ -1245,11 +1240,10 @@ PagedFlux listPageRangesDiffWithOptionalTimeout(GetPageRangesDiffOpt response.getDeserializedHeaders()); }); }; - return new PagedFlux<>(pageSize -> func.apply(null, pageSize), func); } private Mono getPageRangesDiffSegment(String marker, - GetPageRangesDiffOptions options, Duration timeout, Context context) { + ListPageRangesDiffOptions options, Duration timeout, Context context) { context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index ff75ccdea9f8b..dbbb2d3d8a60e 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -8,6 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.UnexpectedLengthException; import com.azure.core.http.RequestConditions; +import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -28,7 +29,7 @@ import com.azure.storage.blob.models.PageList; import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; -import com.azure.storage.blob.options.GetPageRangesDiffOptions; +import com.azure.storage.blob.options.ListPageRangesDiffOptions; import com.azure.storage.blob.options.GetPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.Utility; @@ -45,6 +46,8 @@ import java.util.Map; import java.util.Objects; +import static com.azure.core.util.FluxUtil.withContext; + /** * Client to a page blob. It may only be instantiated through a {@link SpecializedBlobClientBuilder} or via the method * {@link BlobClient#getPageBlobClient()}. This class does not hold any state about a particular blob, but is instead a @@ -749,7 +752,7 @@ public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the different page ranges. - * @deprecated See {@link #listPageRangesDiff(GetPageRangesDiffOptions)} + * @deprecated See {@link #listPageRanges(GetPageRangesOptions)} )} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -790,7 +793,7 @@ public Response getPageRangesDiffWithResponse(BlobRange blobRange, Str */ @ServiceMethod(returns = ReturnType.SINGLE) public PagedIterable listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { - return listPageRangesDiff(new GetPageRangesDiffOptions(blobRange, prevSnapshot)); + return listPageRangesDiff(new ListPageRangesDiffOptions(blobRange, prevSnapshot), null, null); } /** @@ -816,15 +819,21 @@ public PagedIterable listPageRangesDiff(BlobRange blobRange, String * * * - * @param options {@link GetPageRangesDiffOptions}. + * @param options {@link ListPageRangesDiffOptions}. * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable listPageRangesDiff(GetPageRangesDiffOptions options) { - return new PagedIterable<>(pageBlobAsyncClient - .listPageRangesDiffWithOptionalTimeout(options, options.getTimeout())); + public PagedIterable listPageRangesDiff(ListPageRangesDiffOptions options, Duration timeout, + Context context) { + return new PagedIterable<>( + // pull timeout out of options + new PagedFlux<>( + pageSize -> pageBlobAsyncClient.listPageRangesDiffWithOptionalTimeout( + options, timeout, context).apply(null, pageSize), + (continuationToken, pageSize) -> pageBlobAsyncClient.listPageRangesDiffWithOptionalTimeout( + options, timeout, context).apply(continuationToken, pageSize))); } /** From ba3e833cca674c37db724d35432a9a17c5ad4f67 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Mon, 18 Apr 2022 13:52:29 -0700 Subject: [PATCH 12/19] Wrote some tests --- ...ptions.java => ListPageRangesOptions.java} | 29 +-- .../blob/specialized/PageBlobAsyncClient.java | 156 ++++++++-------- .../blob/specialized/PageBlobClient.java | 25 ++- .../blob/specialized/PageBlobAPITest.groovy | 173 ++++++++++++++++++ .../common/test/shared/TestEnvironment.java | 14 +- 5 files changed, 281 insertions(+), 116 deletions(-) rename sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/{GetPageRangesOptions.java => ListPageRangesOptions.java} (70%) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java similarity index 70% rename from sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java rename to sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java index 67ca212fce7b3..1c6d4fc9eef60 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/GetPageRangesOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java @@ -11,17 +11,16 @@ /** * Extended options that may be passed when getting the page ranges of a page blob. */ -public class GetPageRangesOptions { +public class ListPageRangesOptions { private final BlobRange range; private BlobRequestConditions requestConditions; private Integer pageSize; - private Duration timeout; /** * @param range The range to diff. */ - public GetPageRangesOptions(BlobRange range) { + public ListPageRangesOptions(BlobRange range) { Objects.requireNonNull(range); this.range = new BlobRange(range.getOffset(), range.getCount()); } @@ -50,7 +49,7 @@ public BlobRequestConditions getRequestConditions() { * @param requestConditions The requestConditions value to set. * @return The updated object */ - public GetPageRangesOptions setRequestConditions(BlobRequestConditions requestConditions) { + public ListPageRangesOptions setRequestConditions(BlobRequestConditions requestConditions) { this.requestConditions = requestConditions; return this; } @@ -70,28 +69,8 @@ public Integer getMaxResultsPerPage() { * @param pageSize The pageSize value to set. * @return The updated object */ - public GetPageRangesOptions setMaxResultsPerPage(Integer pageSize) { + public ListPageRangesOptions setMaxResultsPerPage(Integer pageSize) { this.pageSize = pageSize; return this; } - - /** - * Gets the timeout property. - * - * @return The timeout property. - */ - public Duration getTimeout() { - return timeout; - } - - /** - * Sets the timeout property. - * - * @param timeout The timeout value to set. - * @return The updated object - */ - public GetPageRangesOptions setTimeout(Duration timeout) { - this.timeout = timeout; - return this; - } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index db13d49d0026f..6c2c2624a278d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -48,7 +48,7 @@ import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.options.ListPageRangesDiffOptions; -import com.azure.storage.blob.options.GetPageRangesOptions; +import com.azure.storage.blob.options.ListPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.implementation.Constants; import com.azure.storage.common.implementation.StorageImplUtils; @@ -793,7 +793,7 @@ public Mono getPageRanges(BlobRange blobRange) { * @param blobRange {@link BlobRange} * @param requestConditions {@link BlobRequestConditions} * @return A reactive response emitting all the page ranges. - * @deprecated Use {@link #listPageRanges(GetPageRangesOptions)} + * @deprecated Use {@link #listPageRanges(ListPageRangesOptions)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -847,7 +847,7 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ */ @ServiceMethod(returns = ReturnType.SINGLE) public PagedFlux listPageRanges(BlobRange blobRange) { - return listPageRanges(new GetPageRangesOptions(blobRange)); + return listPageRanges(new ListPageRangesOptions(blobRange)); } /** @@ -871,12 +871,16 @@ public PagedFlux listPageRanges(BlobRange blobRange) { * * * - * @param options {@link GetPageRangesOptions} + * @param options {@link ListPageRangesOptions} * @return A reactive response emitting all the page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux listPageRanges(GetPageRangesOptions options) { - return listPageRangesWithOptionalTimeout(options, null); + public PagedFlux listPageRanges(ListPageRangesOptions options) { + return new PagedFlux<>( + pageSize -> withContext(context -> + listPageRangesWithOptionalTimeout(options, null, context).apply(null, pageSize)), + (continuationToken, pageSize) -> withContext(context -> + listPageRangesWithOptionalTimeout(options, null, context).apply(continuationToken, pageSize))); } /* @@ -889,57 +893,56 @@ public PagedFlux listPageRanges(GetPageRangesOptions options) { * @param timeout An optional timeout to be applied to the network asynchronous operations. * @return A reactive response emitting the listed blobs, flattened. */ - PagedFlux listPageRangesWithOptionalTimeout(GetPageRangesOptions options, - Duration timeout) { - BiFunction>> func = - (marker, pageSize) -> { - GetPageRangesOptions finalOptions; - /* - If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. - Otherwise, prefer the new value. - */ - if (pageSize != null) { - finalOptions = new GetPageRangesOptions(options.getRange()).setMaxResultsPerPage(pageSize); - } else { - finalOptions = options; - } - return getPageRangesSegment(marker, finalOptions, timeout) - .map(response -> { - List value = response.getValue() == null - ? Collections.emptyList() - : Stream.concat( - response.getValue().getPageRange().stream().map(PageBlobAsyncClient::toPageBlobRange), - response.getValue().getClearRange().stream().map(PageBlobAsyncClient::toPageBlobRange) - ).collect(Collectors.toList()); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - response.getValue().getNextMarker(), - response.getDeserializedHeaders()); - }); - }; - return new PagedFlux<>(pageSize -> func.apply(null, pageSize), func); + BiFunction>> listPageRangesWithOptionalTimeout( + ListPageRangesOptions options, Duration timeout, Context context) { + return (marker, pageSize) -> { + ListPageRangesOptions finalOptions; + /* + If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. + Otherwise, prefer the new value. + */ + if (pageSize != null) { + finalOptions = new ListPageRangesOptions(options.getRange()).setMaxResultsPerPage(pageSize); + } else { + finalOptions = options; + } + return getPageRangesSegment(marker, finalOptions, timeout, context) + .map(response -> { + List value = response.getValue() == null + ? Collections.emptyList() + : Stream.concat( + response.getValue().getPageRange().stream().map(PageBlobAsyncClient::toPageBlobRange), + response.getValue().getClearRange().stream().map(PageBlobAsyncClient::toPageBlobRange) + ).collect(Collectors.toList()); + + return new PagedResponseBase<>( + response.getRequest(), + response.getStatusCode(), + response.getHeaders(), + value, + response.getValue().getNextMarker(), + response.getDeserializedHeaders()); + }); + }; } private Mono getPageRangesSegment(String marker, - GetPageRangesOptions options, Duration timeout) { + ListPageRangesOptions options, Duration timeout, Context context) { + context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, null, null, null, null, null, null, null, null, null, null, marker, options.getMaxResultsPerPage(), - Context.NONE), + context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)), timeout); } private static PageRangeItem toPageBlobRange(PageRange range) { - return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart()), false); + return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart() + 1), false); } private static PageRangeItem toPageBlobRange(ClearRange range) { - return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart()), true); + return new PageRangeItem(new HttpRange(range.getStart(), range.getEnd() - range.getStart() + 1), true); } /** @@ -1051,7 +1054,7 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang * @return A reactive response emitting all the different page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { + public PagedFlux listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return listPageRangesDiff(new ListPageRangesDiffOptions(blobRange, prevSnapshot)); } @@ -1084,7 +1087,7 @@ public PagedFlux listPageRangesDiff(BlobRange blobRange, String prev * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedFlux listPageRangesDiff(ListPageRangesDiffOptions options) { + public PagedFlux listPageRangesDiff(ListPageRangesDiffOptions options) { return new PagedFlux<>( pageSize -> withContext(context -> listPageRangesDiffWithOptionalTimeout(options, null, context).apply(null, pageSize)), @@ -1209,37 +1212,40 @@ Mono> getPageRangesDiffWithResponse(BlobRange blobRange, Stri * @param timeout An optional timeout to be applied to the network asynchronous operations. * @return A reactive response emitting the listed blobs, flattened. */ - BiFunction>> listPageRangesDiffWithOptionalTimeout(ListPageRangesDiffOptions options, + BiFunction>> listPageRangesDiffWithOptionalTimeout(ListPageRangesDiffOptions options, Duration timeout, Context context) { - return - (marker, pageSize) -> { - ListPageRangesDiffOptions finalOptions; - /* - If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. - Otherwise, prefer the new value. - */ - if (pageSize != null) { - finalOptions = - new ListPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) - .setMaxResultsPerPage(pageSize); - } else { - finalOptions = options; - } - return getPageRangesDiffSegment(marker, finalOptions, timeout, context) - .map(response -> { - List value = response.getValue() == null - ? Collections.emptyList() - : response.getValue().getClearRange(); - - return new PagedResponseBase<>( - response.getRequest(), - response.getStatusCode(), - response.getHeaders(), - value, - response.getValue().getNextMarker(), - response.getDeserializedHeaders()); - }); - }; + return (marker, pageSize) -> { + ListPageRangesDiffOptions finalOptions; + /* + If pageSize was not set in a .byPage(int) method, the page size from options will be preserved. + Otherwise, prefer the new value. + */ + if (pageSize != null) { + finalOptions = + new ListPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) + .setMaxResultsPerPage(pageSize); + } else { + finalOptions = options; + } + + return getPageRangesDiffSegment(marker, finalOptions, timeout, context) + .map(response -> { + List value = response.getValue() == null + ? Collections.emptyList() + : Stream.concat( + response.getValue().getPageRange().stream().map(PageBlobAsyncClient::toPageBlobRange), + response.getValue().getClearRange().stream().map(PageBlobAsyncClient::toPageBlobRange)) + .collect(Collectors.toList()); + + return new PagedResponseBase<>( + response.getRequest(), + response.getStatusCode(), + response.getHeaders(), + value, + response.getValue().getNextMarker(), + response.getDeserializedHeaders()); + }); + }; } private Mono getPageRangesDiffSegment(String marker, diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index dbbb2d3d8a60e..49b311917c356 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -30,7 +30,7 @@ import com.azure.storage.blob.models.PageRange; import com.azure.storage.blob.models.SequenceNumberActionType; import com.azure.storage.blob.options.ListPageRangesDiffOptions; -import com.azure.storage.blob.options.GetPageRangesOptions; +import com.azure.storage.blob.options.ListPageRangesOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; @@ -619,7 +619,7 @@ public PageList getPageRanges(BlobRange blobRange) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the page ranges. - * @deprecated See {@link #listPageRanges(GetPageRangesOptions)} + * @deprecated See {@link #listPageRanges(ListPageRangesOptions,Duration,Context)} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -654,7 +654,7 @@ public Response getPageRangesWithResponse(BlobRange blobRange, BlobReq */ @ServiceMethod(returns = ReturnType.SINGLE) public PagedIterable listPageRanges(BlobRange blobRange) { - return listPageRanges(new GetPageRangesOptions(blobRange)); + return listPageRanges(new ListPageRangesOptions(blobRange), null, null); } /** @@ -678,12 +678,19 @@ public PagedIterable listPageRanges(BlobRange blobRange) { * * * - * @param options {@link GetPageRangesOptions} + * @param options {@link ListPageRangesOptions} * @return A reactive response emitting all the page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable listPageRanges(GetPageRangesOptions options) { - return new PagedIterable<>(pageBlobAsyncClient.listPageRangesWithOptionalTimeout(options, options.getTimeout())); + public PagedIterable listPageRanges(ListPageRangesOptions options, Duration timeout, + Context context) { + return new PagedIterable<>( + // pull timeout out of options + new PagedFlux<>( + pageSize -> pageBlobAsyncClient.listPageRangesWithOptionalTimeout( + options, timeout, context).apply(null, pageSize), + (continuationToken, pageSize) -> pageBlobAsyncClient.listPageRangesWithOptionalTimeout( + options, timeout, context).apply(continuationToken, pageSize))); } /** @@ -752,7 +759,7 @@ public PageList getPageRangesDiff(BlobRange blobRange, String prevSnapshot) { * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. * @param context Additional context that is passed through the Http pipeline during the service call. * @return All the different page ranges. - * @deprecated See {@link #listPageRanges(GetPageRangesOptions)} )} + * @deprecated See {@link #listPageRanges(ListPageRangesOptions,Duration,Context)} )} */ @ServiceMethod(returns = ReturnType.SINGLE) @Deprecated @@ -792,7 +799,7 @@ public Response getPageRangesDiffWithResponse(BlobRange blobRange, Str * @return A reactive response emitting all the different page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { + public PagedIterable listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return listPageRangesDiff(new ListPageRangesDiffOptions(blobRange, prevSnapshot), null, null); } @@ -825,7 +832,7 @@ public PagedIterable listPageRangesDiff(BlobRange blobRange, String * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedIterable listPageRangesDiff(ListPageRangesDiffOptions options, Duration timeout, + public PagedIterable listPageRangesDiff(ListPageRangesDiffOptions options, Duration timeout, Context context) { return new PagedIterable<>( // pull timeout out of options diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy index b53dd3a410ede..c0f45358c3248 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy @@ -4,6 +4,7 @@ package com.azure.storage.blob.specialized import com.azure.core.exception.UnexpectedLengthException +import com.azure.core.http.HttpRange import com.azure.core.util.CoreUtils import com.azure.storage.blob.APISpec import com.azure.storage.blob.BlobContainerClient @@ -22,6 +23,7 @@ import com.azure.storage.blob.models.PageRange import com.azure.storage.blob.models.PublicAccessType import com.azure.storage.blob.models.SequenceNumberActionType import com.azure.storage.blob.options.BlobGetTagsOptions +import com.azure.storage.blob.options.ListPageRangesOptions import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions import com.azure.storage.blob.options.PageBlobCreateOptions import com.azure.storage.common.implementation.Constants @@ -802,6 +804,177 @@ class PageBlobAPITest extends APISpec { thrown(BlobStorageException) } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + def "List page ranges"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: + def iterable = bc.listPageRanges(new BlobRange(0, 4 * Constants.KB)).iterator() + def item = iterable.next() + + then: + item.getRange().equals(new HttpRange(0, Constants.KB)) + !item.isClear() + + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(2 * Constants.KB, Constants.KB)) + !item.isClear() + + !iterable.hasNext() + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + def "List page ranges pageSize"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: "max results on options" + def iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) + .setMaxResultsPerPage(1), null, null).iterableByPage().iterator() + def page = iterable.next() + + then: + page.getValue().size() == 1 + + when: + page = iterable.next() + + then: + page.getValue().size() == 1 + !iterable.hasNext() + + when: "max results on iterableByPage" + iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) + .iterableByPage(1).iterator() + page = iterable.next() + + then: + page.getValue().size() == 1 + + when: + page = iterable.next() + + then: + page.getValue().size() == 1 + !iterable.hasNext() + } + + def "List pages continuation token"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: "max results on options" + def iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) + .setMaxResultsPerPage(1), null, null).iterableByPage().iterator() + def token = iterable.next().getContinuationToken() + + iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) + .iterableByPage(token).iterator() + def page = iterable.next() + + then: + page.getValue().size() == 1 + !iterable.hasNext() + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + @Unroll + def "List page ranges AC"() { + setup: + def t = new HashMap() + t.put("foo", "bar") + bc.setTags(t) + match = setupBlobMatchCondition(bc, match) + leaseID = setupBlobLeaseCondition(bc, leaseID) + def bac = new BlobRequestConditions() + .setLeaseId(leaseID) + .setIfMatch(match) + .setIfNoneMatch(noneMatch) + .setIfModifiedSince(modified) + .setIfUnmodifiedSince(unmodified) + .setTagsConditions(tags) + + when: + bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES)) + .setRequestConditions(bac), null, null) + + then: + notThrown(BlobStorageException) + + where: + modified | unmodified | match | noneMatch | leaseID | tags + null | null | null | null | null | null + oldDate | null | null | null | null | null + null | newDate | null | null | null | null + null | null | receivedEtag | null | null | null + null | null | null | garbageEtag | null | null + null | null | null | null | receivedLeaseID | null + null | null | null | null | null | "\"foo\" = 'bar'" + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + @Unroll + def "List page ranges AC fail"() { + setup: + def bac = new BlobRequestConditions() + .setLeaseId(setupBlobLeaseCondition(bc, leaseID)) + .setIfMatch(match) + .setIfNoneMatch(setupBlobMatchCondition(bc, noneMatch)) + .setIfModifiedSince(modified) + .setIfUnmodifiedSince(unmodified) + .setTagsConditions(tags) + + when: + bc.getPageRangesWithResponse(new BlobRange(0, PageBlobClient.PAGE_BYTES), bac, null, null) + + then: + thrown(BlobStorageException) + + where: + modified | unmodified | match | noneMatch | leaseID | tags + newDate | null | null | null | null | null + null | oldDate | null | null | null | null + null | null | garbageEtag | null | null | null + null | null | null | receivedEtag | null | null + null | null | null | null | garbageLeaseID | null + null | null | null | null | null | "\"notfoo\" = 'notbar'" + } + + /* + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(Constants.KB, Constants.KB)) + item.isClear() + + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(3 * Constants.KB, Constants.KB)) + item.isClear() + */ + @Unroll def "Get page ranges diff"() { setup: diff --git a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java index d63619a4533e8..8d071d3814cef 100644 --- a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java +++ b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java @@ -88,22 +88,22 @@ private String readServiceVersionFromEnvironment() { private static TestAccount readTestAccountFromEnvironment(String prefix, TestMode testMode) { String name = "azstoragesdkaccount"; String key = "astorageaccountkey"; - String connectionString = "DefaultEndpointsProtocol=https;AccountName=teststorage;" + String connectionString = "DefaultEndpointsProtocol=http;AccountName=teststorage;" + "AccountKey=atestaccountkey;EndpointSuffix=core.windows.net"; if (testMode != TestMode.PLAYBACK) { name = Configuration.getGlobalConfiguration().get(prefix + "ACCOUNT_NAME"); key = Configuration.getGlobalConfiguration().get(prefix + "ACCOUNT_KEY"); connectionString = Configuration.getGlobalConfiguration().get(prefix + "CONNECTION_STRING"); if (connectionString == null || connectionString.trim().isEmpty()) { - connectionString = String.format("DefaultEndpointsProtocol=https;AccountName=%s;" + connectionString = String.format("DefaultEndpointsProtocol=http;AccountName=%s;" + "AccountKey=%s;EndpointSuffix=core.windows.net", name, key); } } - String blobEndpoint = String.format("https://%s.blob.core.windows.net", name); - String blobEndpointSecondary = String.format("https://%s-secondary.blob.core.windows.net", name); - String dataLakeEndpoint = String.format("https://%s.dfs.core.windows.net", name); - String queueEndpoint = String.format("https://%s.queue.core.windows.net", name); - String fileEndpoint = String.format("https://%s.file.core.windows.net", name); + String blobEndpoint = String.format("http://%s.blob.core.windows.net", name); + String blobEndpointSecondary = String.format("http://%s-secondary.blob.core.windows.net", name); + String dataLakeEndpoint = String.format("http://%s.dfs.core.windows.net", name); + String queueEndpoint = String.format("http://%s.queue.core.windows.net", name); + String fileEndpoint = String.format("http://%s.file.core.windows.net", name); return new TestAccount(name, key, connectionString, blobEndpoint, blobEndpointSecondary, dataLakeEndpoint, queueEndpoint, fileEndpoint); From 610dab326730a540a1972dd67ff6c07d52d715f1 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 19 Apr 2022 11:48:29 -0700 Subject: [PATCH 13/19] Wrote tests --- .../blob/models/PageListDeserializer.java | 2 +- .../blob/specialized/PageBlobAsyncClient.java | 16 +- .../blob/specialized/PageBlobAPITest.groovy | 280 ++++++++++++++++-- 3 files changed, 262 insertions(+), 36 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java index 7e089ec2865d3..a65164364ae6b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java @@ -76,7 +76,7 @@ public PageList deserialize(JsonParser p, DeserializationContext ctxt) throws IO clearRanges.add((ClearRange) clearRangeDeserializer.deserialize(p, ctxt)); } else if (p.getCurrentName().equals("NextMarker")) { // Current token is the next marker - nextMarker = p.getText(); + nextMarker = "null".equals(p.getText()) ? null : p.getText(); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 59e7a263dda40..54152ec1872b8 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -1012,11 +1012,16 @@ BiFunction>> listPageRangesWi private Mono getPageRangesSegment(String marker, ListPageRangesOptions options, Duration timeout, Context context) { + BlobRequestConditions requestConditions = options.getRequestConditions() == null ? new BlobRequestConditions() + : options.getRequestConditions(); context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getPageBlobs().getPageRangesWithResponseAsync(containerName, blobName, - null, null, null, null, null, null, null, null, null, null, marker, options.getMaxResultsPerPage(), + getSnapshotId(), null, options.getRange().toHeaderValue(), requestConditions.getLeaseId(), + requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), + requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), + requestConditions.getTagsConditions(), null, marker, options.getMaxResultsPerPage(), context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)), timeout); } @@ -1334,12 +1339,17 @@ BiFunction>> listPageRangesDi private Mono getPageRangesDiffSegment(String marker, ListPageRangesDiffOptions options, Duration timeout, Context context) { + BlobRequestConditions requestConditions = options.getRequestConditions() == null ? new BlobRequestConditions() + : options.getRequestConditions(); context = context == null ? Context.NONE : context; return StorageImplUtils.applyOptionalTimeout( this.azureBlobStorage.getPageBlobs().getPageRangesDiffWithResponseAsync(containerName, blobName, - null, null, null, null, null, null, null, null, null, null, null, null, marker, - options.getMaxResultsPerPage(), + getSnapshotId(), null, options.getPreviousSnapshot(), null, + options.getRange().toHeaderValue(), requestConditions.getLeaseId(), + requestConditions.getIfModifiedSince(), requestConditions.getIfUnmodifiedSince(), + requestConditions.getIfMatch(), requestConditions.getIfNoneMatch(), + requestConditions.getTagsConditions(), null, marker, options.getMaxResultsPerPage(), context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)), timeout); } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy index e3410590a9c5d..4a48b45213770 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy @@ -24,6 +24,7 @@ import com.azure.storage.blob.models.PublicAccessType import com.azure.storage.blob.models.SequenceNumberActionType import com.azure.storage.blob.options.AppendBlobCreateOptions import com.azure.storage.blob.options.BlobGetTagsOptions +import com.azure.storage.blob.options.ListPageRangesDiffOptions import com.azure.storage.blob.options.ListPageRangesOptions import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions import com.azure.storage.blob.options.PageBlobCreateOptions @@ -951,7 +952,6 @@ class PageBlobAPITest extends APISpec { setup: bc.create(4 * Constants.KB, true) def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) - data.mark(Integer.MAX_VALUE) bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) @@ -985,36 +985,37 @@ class PageBlobAPITest extends APISpec { bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) when: "max results on options" - def iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) + def iterator = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) .setMaxResultsPerPage(1), null, null).iterableByPage().iterator() - def page = iterable.next() + def page = iterator.next() then: page.getValue().size() == 1 when: - page = iterable.next() + page = iterator.next() then: page.getValue().size() == 1 - !iterable.hasNext() + !iterator.hasNext() when: "max results on iterableByPage" - iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) + iterator = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) .iterableByPage(1).iterator() - page = iterable.next() + page = iterator.next() then: page.getValue().size() == 1 when: - page = iterable.next() + page = iterator.next() then: page.getValue().size() == 1 - !iterable.hasNext() + !iterator.hasNext() } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") def "List pages continuation token"() { setup: bc.create(4 * Constants.KB, true) @@ -1024,18 +1025,35 @@ class PageBlobAPITest extends APISpec { bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) - when: "max results on options" - def iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) + when: + def iterator = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)) .setMaxResultsPerPage(1), null, null).iterableByPage().iterator() - def token = iterable.next().getContinuationToken() + def token = iterator.next().getContinuationToken() - iterable = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) + iterator = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, 4 * Constants.KB)), null, null) .iterableByPage(token).iterator() - def page = iterable.next() + def page = iterator.next() then: page.getValue().size() == 1 - !iterable.hasNext() + !iterator.hasNext() + } + + def "List pages range"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: + def iterator = bc.listPageRanges(new ListPageRangesOptions(new BlobRange(2 * Constants.KB + 1, 2 * Constants.KB)), + null, null).iterator() + + then: + iterator.size() == 1 } @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") @@ -1086,7 +1104,8 @@ class PageBlobAPITest extends APISpec { .setTagsConditions(tags) when: - bc.getPageRangesWithResponse(new BlobRange(0, PageBlobClient.PAGE_BYTES), bac, null, null) + bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES)) + .setRequestConditions(bac), null, null) then: thrown(BlobStorageException) @@ -1101,22 +1120,6 @@ class PageBlobAPITest extends APISpec { null | null | null | null | null | "\"notfoo\" = 'notbar'" } - /* - when: - item = iterable.next() - - then: - item.getRange().equals(new HttpRange(Constants.KB, Constants.KB)) - item.isClear() - - when: - item = iterable.next() - - then: - item.getRange().equals(new HttpRange(3 * Constants.KB, Constants.KB)) - item.isClear() - */ - @Unroll def "Get page ranges diff"() { setup: @@ -1314,6 +1317,219 @@ class PageBlobAPITest extends APISpec { Integer.parseInt(response.getHeaders().getValue("x-ms-blob-content-length")) == PageBlobClient.PAGE_BYTES * 2 } + def "List page ranges diff"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + def snapshot = bc.createSnapshot().getSnapshotId() + data = new ByteArrayInputStream(getRandomByteArray(1 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(Constants.KB - 1), data) + data.reset() + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.uploadPages(new PageRange().setStart(2 * Constants.KB).setEnd(3 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: + def iterable = bc.listPageRangesDiff(new BlobRange(0, 4 * Constants.KB), snapshot).iterator() + def item = iterable.next() + + then: + item.getRange().equals(new HttpRange(0, Constants.KB)) + !item.isClear() + + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(2 * Constants.KB, Constants.KB)) + !item.isClear() + + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(Constants.KB, Constants.KB)) + item.isClear() + + when: + item = iterable.next() + + then: + item.getRange().equals(new HttpRange(3 * Constants.KB, Constants.KB)) + item.isClear() + + !iterable.hasNext() + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + def "List page ranges diff pageSize"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + def snapshot = bc.createSnapshot().getSnapshotId() + data = new ByteArrayInputStream(getRandomByteArray(1 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(Constants.KB - 1), data) + data.reset() + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.uploadPages(new PageRange().setStart(2 * Constants.KB).setEnd(3 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: "max results on options" + def iterator = bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, 4 * Constants.KB), snapshot) + .setMaxResultsPerPage(2), null, null).iterableByPage().iterator() + def page = iterator.next() + + then: + page.getValue().size() == 2 + + when: + page = iterator.next() + + then: + page.getValue().size() == 2 + !iterator.hasNext() + + when: "max results on iterableByPage" + iterator = bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, 4 * Constants.KB), snapshot), + null, null).iterableByPage(2).iterator() + page = iterator.next() + + then: + page.getValue().size() == 2 + + when: + page = iterator.next() + + then: + page.getValue().size() == 2 + !iterator.hasNext() + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + def "List pages diff continuation token"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + def snapshot = bc.createSnapshot().getSnapshotId() + data = new ByteArrayInputStream(getRandomByteArray(1 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(Constants.KB - 1), data) + data.reset() + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.uploadPages(new PageRange().setStart(2 * Constants.KB).setEnd(3 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: + def iterator = bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, 4 * Constants.KB), snapshot) + .setMaxResultsPerPage(2), null, null).iterableByPage().iterator() + def token = iterator.next().getContinuationToken() + + iterator = bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, 4 * Constants.KB), snapshot), + null, null).iterableByPage(token).iterator() + def page = iterator.next() + + then: + page.getValue().size() == 2 + !iterator.hasNext() + } + + def "List pages diff range"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + def snapshot = bc.createSnapshot().getSnapshotId() + data = new ByteArrayInputStream(getRandomByteArray(1 * Constants.KB)) + data.mark(Integer.MAX_VALUE) + bc.uploadPages(new PageRange().setStart(0).setEnd(Constants.KB - 1), data) + data.reset() + bc.clearPages(new PageRange().setStart(Constants.KB).setEnd(2 * Constants.KB - 1)) + bc.uploadPages(new PageRange().setStart(2 * Constants.KB).setEnd(3 * Constants.KB - 1), data) + bc.clearPages(new PageRange().setStart(3 * Constants.KB).setEnd(4 * Constants.KB - 1)) + + when: + def iterator = bc.listPageRangesDiff(new ListPageRangesDiffOptions( + new BlobRange(2 * Constants.KB + 1, 2 * Constants.KB), snapshot), null, null).iterator() + + then: + iterator.size() == 2 + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + @Unroll + def "List page ranges diff AC"() { + setup: + bc.create(4 * Constants.KB, true) + def data = new ByteArrayInputStream(getRandomByteArray(4 * Constants.KB)) + bc.uploadPages(new PageRange().setStart(0).setEnd(4 * Constants.KB - 1), data) + def snapshot = bc.createSnapshot().getSnapshotId() + + def t = new HashMap() + t.put("foo", "bar") + bc.setTags(t) + match = setupBlobMatchCondition(bc, match) + leaseID = setupBlobLeaseCondition(bc, leaseID) + def bac = new BlobRequestConditions() + .setLeaseId(leaseID) + .setIfMatch(match) + .setIfNoneMatch(noneMatch) + .setIfModifiedSince(modified) + .setIfUnmodifiedSince(unmodified) + .setTagsConditions(tags) + + when: + bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES), snapshot) + .setRequestConditions(bac), null, null) + + then: + notThrown(BlobStorageException) + + where: + modified | unmodified | match | noneMatch | leaseID | tags + null | null | null | null | null | null + oldDate | null | null | null | null | null + null | newDate | null | null | null | null + null | null | receivedEtag | null | null | null + null | null | null | garbageEtag | null | null + null | null | null | null | receivedLeaseID | null + null | null | null | null | null | "\"foo\" = 'bar'" + } + + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") + @Unroll + def "List page ranges diff AC fail"() { + setup: + def snapshot = bc.createSnapshot().getSnapshotId() + def bac = new BlobRequestConditions() + .setLeaseId(setupBlobLeaseCondition(bc, leaseID)) + .setIfMatch(match) + .setIfNoneMatch(setupBlobMatchCondition(bc, noneMatch)) + .setIfModifiedSince(modified) + .setIfUnmodifiedSince(unmodified) + .setTagsConditions(tags) + + when: + bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES), snapshot) + .setRequestConditions(bac), null, null) + + then: + thrown(BlobStorageException) + + where: + modified | unmodified | match | noneMatch | leaseID | tags + newDate | null | null | null | null | null + null | oldDate | null | null | null | null + null | null | garbageEtag | null | null | null + null | null | null | receivedEtag | null | null + null | null | null | null | garbageLeaseID | null + null | null | null | null | null | "\"notfoo\" = 'notbar'" + } + @Unroll def "PageRange IA"() { setup: From 0dd66032977cb8e666529be293879c09d5055712 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Tue, 19 Apr 2022 12:11:27 -0700 Subject: [PATCH 14/19] Test fixes and recordings --- .../blob/specialized/PageBlobAsyncClient.java | 2 +- .../blob/specialized/PageBlobAPITest.groovy | 11 +- .../PageBlobAPITestListPageRanges.json | 162 +++++++++ ...ageBlobAPITestListPageRangesACFail[0].json | 67 ++++ ...ageBlobAPITestListPageRangesACFail[1].json | 70 ++++ ...ageBlobAPITestListPageRangesACFail[2].json | 70 ++++ ...ageBlobAPITestListPageRangesACFail[3].json | 98 ++++++ ...ageBlobAPITestListPageRangesACFail[4].json | 92 ++++++ ...ageBlobAPITestListPageRangesACFail[5].json | 70 ++++ .../PageBlobAPITestListPageRangesAC[0].json | 91 ++++++ .../PageBlobAPITestListPageRangesAC[1].json | 91 ++++++ .../PageBlobAPITestListPageRangesAC[2].json | 91 ++++++ .../PageBlobAPITestListPageRangesAC[3].json | 123 +++++++ .../PageBlobAPITestListPageRangesAC[4].json | 91 ++++++ .../PageBlobAPITestListPageRangesAC[5].json | 113 +++++++ .../PageBlobAPITestListPageRangesAC[6].json | 91 ++++++ .../PageBlobAPITestListPageRangesDiff.json | 235 ++++++++++++++ ...lobAPITestListPageRangesDiffACFail[0].json | 91 ++++++ ...lobAPITestListPageRangesDiffACFail[1].json | 94 ++++++ ...lobAPITestListPageRangesDiffACFail[2].json | 94 ++++++ ...lobAPITestListPageRangesDiffACFail[3].json | 122 +++++++ ...lobAPITestListPageRangesDiffACFail[4].json | 116 +++++++ ...lobAPITestListPageRangesDiffACFail[5].json | 94 ++++++ ...ageBlobAPITestListPageRangesDiffAC[0].json | 163 ++++++++++ ...ageBlobAPITestListPageRangesDiffAC[1].json | 163 ++++++++++ ...ageBlobAPITestListPageRangesDiffAC[2].json | 163 ++++++++++ ...ageBlobAPITestListPageRangesDiffAC[3].json | 195 +++++++++++ ...ageBlobAPITestListPageRangesDiffAC[4].json | 163 ++++++++++ ...ageBlobAPITestListPageRangesDiffAC[5].json | 185 +++++++++++ ...ageBlobAPITestListPageRangesDiffAC[6].json | 163 ++++++++++ ...BlobAPITestListPageRangesDiffPageSize.json | 307 ++++++++++++++++++ ...PageBlobAPITestListPageRangesPageSize.json | 234 +++++++++++++ ...BlobAPITestListPagesContinuationToken.json | 186 +++++++++++ ...APITestListPagesDiffContinuationToken.json | 259 +++++++++++++++ .../PageBlobAPITestListPagesDiffRange.json | 235 ++++++++++++++ .../PageBlobAPITestListPagesRange.json | 162 +++++++++ 36 files changed, 4752 insertions(+), 5 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRanges.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[0].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[1].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[2].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[3].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[4].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[5].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[0].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[1].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[2].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[3].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[4].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[5].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[6].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiff.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[0].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[1].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[2].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[3].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[4].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[5].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[0].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[1].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[2].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[3].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[4].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[5].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[6].json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffPageSize.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesPageSize.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesContinuationToken.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffContinuationToken.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffRange.json create mode 100644 sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesRange.json diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 54152ec1872b8..b366b1501aaca 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -1312,7 +1312,7 @@ BiFunction>> listPageRangesDi if (pageSize != null) { finalOptions = new ListPageRangesDiffOptions(options.getRange(), options.getPreviousSnapshot()) - .setMaxResultsPerPage(pageSize); + .setRequestConditions(options.getRequestConditions()).setMaxResultsPerPage(pageSize); } else { finalOptions = options; } diff --git a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy index 4a48b45213770..8b52539fb4194 100644 --- a/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy +++ b/sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/PageBlobAPITest.groovy @@ -1039,6 +1039,7 @@ class PageBlobAPITest extends APISpec { !iterator.hasNext() } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") def "List pages range"() { setup: bc.create(4 * Constants.KB, true) @@ -1075,7 +1076,7 @@ class PageBlobAPITest extends APISpec { when: bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES)) - .setRequestConditions(bac), null, null) + .setRequestConditions(bac), null, null).size() then: notThrown(BlobStorageException) @@ -1105,7 +1106,7 @@ class PageBlobAPITest extends APISpec { when: bc.listPageRanges(new ListPageRangesOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES)) - .setRequestConditions(bac), null, null) + .setRequestConditions(bac), null, null).size() then: thrown(BlobStorageException) @@ -1317,6 +1318,7 @@ class PageBlobAPITest extends APISpec { Integer.parseInt(response.getHeaders().getValue("x-ms-blob-content-length")) == PageBlobClient.PAGE_BYTES * 2 } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") def "List page ranges diff"() { setup: bc.create(4 * Constants.KB, true) @@ -1438,6 +1440,7 @@ class PageBlobAPITest extends APISpec { !iterator.hasNext() } + @RequiredServiceVersion(clazz = BlobServiceVersion.class, min = "V2021_06_08") def "List pages diff range"() { setup: bc.create(4 * Constants.KB, true) @@ -1484,7 +1487,7 @@ class PageBlobAPITest extends APISpec { when: bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES), snapshot) - .setRequestConditions(bac), null, null) + .setRequestConditions(bac), null, null).size() then: notThrown(BlobStorageException) @@ -1515,7 +1518,7 @@ class PageBlobAPITest extends APISpec { when: bc.listPageRangesDiff(new ListPageRangesDiffOptions(new BlobRange(0, PageBlobClient.PAGE_BYTES), snapshot) - .setRequestConditions(bac), null, null) + .setRequestConditions(bac), null, null).size() then: thrown(BlobStorageException) diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRanges.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRanges.json new file mode 100644 index 0000000000000..001dc45e1f90c --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRanges.json @@ -0,0 +1,162 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "23d929df-3e31-483e-8826-00ef0af78328" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A892F6F0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7877e490-801e-0044-391e-5498c7000000", + "x-ms-client-request-id" : "23d929df-3e31-483e-8826-00ef0af78328", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "fa263e3c-497c-4e38-a8ad-705dfcdf067a" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8A0A709", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "913c1620-e01e-007d-161e-5463db000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "fa263e3c-497c-4e38-a8ad-705dfcdf067a", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "739b44a6-bc1f-44e4-bc4c-3a674876f1cb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8AE60A6", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "455cfad5-901e-0067-3a1e-540204000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "739b44a6-bc1f-44e4-bc4c-3a674876f1cb", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "588c6436-a8b6-438d-b9ae-9d73012466ff", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "ZNn1ZBUOUfU=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8BBA526", + "x-ms-request-id" : "7877e4bf-801e-0044-5d1e-5498c7000000", + "x-ms-client-request-id" : "588c6436-a8b6-438d-b9ae-9d73012466ff" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "abed56ff-f80a-4d8d-a3b5-5b4f4a623454" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8C8E9AF", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f221062-501e-0078-041e-54b100000000", + "x-ms-client-request-id" : "abed56ff-f80a-4d8d-a3b5-5b4f4a623454", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d1703d8f-db7b-4618-aa04-8a8a6254e4ae" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8E67F7B", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "16b68985-601e-003e-601e-548587000000", + "x-ms-client-request-id" : "d1703d8f-db7b-4618-aa04-8a8a6254e4ae", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/5df2da1405df2da14b2733248ee3c1ea082574006b72/5df2da1415df2da14b2799419152721f77a6143f4849?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "ae3388c2-f4dd-4510-8370-a2ae2372ef51" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8E67F7B", + "x-ms-request-id" : "5a09fe7d-101e-0046-601e-54267f000000", + "Body" : "\n0102320483071", + "x-ms-client-request-id" : "ae3388c2-f4dd-4510-8370-a2ae2372ef51", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "5df2da1405df2da14b2733248ee3c1ea082574006b72", "5df2da1415df2da14b2799419152721f77a6143f4849", "b4994cd1-b34a-4717-8da3-ff49589e25a8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[0].json new file mode 100644 index 0000000000000..4cfa9ebfdefc8 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[0].json @@ -0,0 +1,67 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/062694440062694444d63864466afedb2cbe94d40ba2?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "adc84dfc-316d-4de8-9e75-87e60bd12e0b" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D06AA757", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a2e3b09b-e01e-005e-3d20-543122000000", + "x-ms-client-request-id" : "adc84dfc-316d-4de8-9e75-87e60bd12e0b", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/062694440062694444d63864466afedb2cbe94d40ba2/062694441062694444d6814154e6c5d5d25014fbcacd", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "945604d4-5f0e-4c64-b8fe-5652b5ec7859" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CBFE49", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7921993Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6b23a941-101e-0028-5e20-54bb6a000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "945604d4-5f0e-4c64-b8fe-5652b5ec7859", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/062694440062694444d63864466afedb2cbe94d40ba2/062694441062694444d6814154e6c5d5d25014fbcacd?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "54a5cdb1-8fa2-4b82-9a1c-4d780578acff" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "304", + "x-ms-request-id" : "f99ac06e-e01e-0003-7320-543ba6000000", + "x-ms-client-request-id" : "54a5cdb1-8fa2-4b82-9a1c-4d780578acff", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + } ], + "variables" : [ "062694440062694444d63864466afedb2cbe94d40ba2", "062694441062694444d6814154e6c5d5d25014fbcacd" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[1].json new file mode 100644 index 0000000000000..d94b96deb7a47 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[1].json @@ -0,0 +1,70 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/1f3da50501f3da505c31710686edce707feb144888c1?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "85087758-d243-4578-a549-40b947229736" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D06C6362", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ef8f5705-301e-0010-0120-541faa000000", + "x-ms-client-request-id" : "85087758-d243-4578-a549-40b947229736", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/1f3da50501f3da505c31710686edce707feb144888c1/1f3da50511f3da505c31359332935fb0bc7534beca3f", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "8ba24409-b755-4135-a254-12faac657fea" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CBFE49", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7921993Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bf5557f7-201e-008a-0620-548173000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "8ba24409-b755-4135-a254-12faac657fea", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/1f3da50501f3da505c31710686edce707feb144888c1/1f3da50511f3da505c31359332935fb0bc7534beca3f?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6ae05e47-79fc-4d95-b30a-04332886daf3" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "6b23a9d6-101e-0028-5e20-54bb6a000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:6b23a9d6-101e-0028-5e20-54bb6a000000\nTime:2022-04-19T19:07:15.0486644Z", + "x-ms-client-request-id" : "6ae05e47-79fc-4d95-b30a-04332886daf3", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "1f3da50501f3da505c31710686edce707feb144888c1", "1f3da50511f3da505c31359332935fb0bc7534beca3f" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[2].json new file mode 100644 index 0000000000000..cb57d6112a624 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[2].json @@ -0,0 +1,70 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/3410f6c603410f6c6da711932c307e0837d27452ca2a?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bee66e9f-f102-4a73-b210-79ae9ef7ac95" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0687ADB", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9ff27a8f-e01e-0061-6a20-54f981000000", + "x-ms-client-request-id" : "bee66e9f-f102-4a73-b210-79ae9ef7ac95", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/3410f6c603410f6c6da711932c307e0837d27452ca2a/3410f6c613410f6c6da70738193f639642ff5446f858", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bae726d8-bfdd-4609-97f7-dfe178f7b696" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CC2553", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7931987Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a2e3b1b6-e01e-005e-2420-543122000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "bae726d8-bfdd-4609-97f7-dfe178f7b696", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/3410f6c603410f6c6da711932c307e0837d27452ca2a/3410f6c613410f6c6da70738193f639642ff5446f858?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a41986b3-b090-491c-ab92-22475c1d05e2" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "9ff27bee-e01e-0061-1d20-54f981000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:9ff27bee-e01e-0061-1d20-54f981000000\nTime:2022-04-19T19:07:15.0475075Z", + "x-ms-client-request-id" : "a41986b3-b090-491c-ab92-22475c1d05e2", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "3410f6c603410f6c6da711932c307e0837d27452ca2a", "3410f6c613410f6c6da70738193f639642ff5446f858" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[3].json new file mode 100644 index 0000000000000..0d035ff21fab7 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[3].json @@ -0,0 +1,98 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/2d0bc78702d0bc787d07185617f4de19b50bd4448bbe?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7feeb23a-c25c-4d2b-868f-5fb39e899db6" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D069F229", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bf555683-201e-008a-4020-548173000000", + "x-ms-client-request-id" : "7feeb23a-c25c-4d2b-868f-5fb39e899db6", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/2d0bc78702d0bc787d07185617f4de19b50bd4448bbe/2d0bc78712d0bc787d0739818a8d1a0d3f72e429e9eb", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "72544003-ed96-438d-a693-c61fda4abd54" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CBD740", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7921993Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f99ac00b-e01e-0003-2920-543ba6000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "72544003-ed96-438d-a693-c61fda4abd54", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://REDACTED.blob.core.windows.net/2d0bc78702d0bc787d07185617f4de19b50bd4448bbe/2d0bc78712d0bc787d0739818a8d1a0d3f72e429e9eb", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "15424d9a-e15d-4bbb-a498-f3cb59632e2d" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "content-length" : "512", + "x-ms-version" : "2021-04-10", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7921993Z", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-blob-type" : "PageBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-creation-time" : "Tue, 19 Apr 2022 19:07:14 GMT", + "eTag" : "0x8DA2237D0CBD740", + "x-ms-request-id" : "a2e3b222-e01e-005e-0720-543122000000", + "x-ms-client-request-id" : "15424d9a-e15d-4bbb-a498-f3cb59632e2d", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/2d0bc78702d0bc787d07185617f4de19b50bd4448bbe/2d0bc78712d0bc787d0739818a8d1a0d3f72e429e9eb?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "ec9634cb-ec0b-49ec-8966-9e1ba8bb9141" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "304", + "x-ms-request-id" : "6b23aa78-101e-0028-5b20-54bb6a000000", + "x-ms-client-request-id" : "ec9634cb-ec0b-49ec-8966-9e1ba8bb9141", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + } ], + "variables" : [ "2d0bc78702d0bc787d07185617f4de19b50bd4448bbe", "2d0bc78712d0bc787d0739818a8d1a0d3f72e429e9eb" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[4].json new file mode 100644 index 0000000000000..01485cecef2d7 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[4].json @@ -0,0 +1,92 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/624a51400624a5140dda1216296eb996be861475483d?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "43e008da-d060-4ca0-a89e-bdbd9cb06d82" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D06A8601", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f99abf04-e01e-0003-4720-543ba6000000", + "x-ms-client-request-id" : "43e008da-d060-4ca0-a89e-bdbd9cb06d82", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/624a51400624a5140dda1216296eb996be861475483d/624a51401624a5140dda84719f00748370112459fa94", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f47d0b8a-1e6e-41ed-b491-e1a29ef347d9" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CBFE49", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7921993Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9ff27b95-e01e-0061-5020-54f981000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "f47d0b8a-1e6e-41ed-b491-e1a29ef347d9", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/624a51400624a5140dda1216296eb996be861475483d/624a51401624a5140dda84719f00748370112459fa94?comp=lease", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "92bcd9cd-8674-48d3-89ea-cb0ee22e48e2" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-id" : "20d06575-9017-4867-9f9a-9e3ca832e913", + "eTag" : "0x8DA2237D0CBFE49", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ef8f58d1-301e-0010-0c20-541faa000000", + "x-ms-client-request-id" : "92bcd9cd-8674-48d3-89ea-cb0ee22e48e2", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/624a51400624a5140dda1216296eb996be861475483d/624a51401624a5140dda84719f00748370112459fa94?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "fc0036db-181b-4626-8a16-87bc0fb36347" + }, + "Response" : { + "content-length" : "265", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "LeaseIdMismatchWithBlobOperation", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "ef8f5941-301e-0010-6d20-541faa000000", + "Body" : "\nLeaseIdMismatchWithBlobOperationThe lease ID specified did not match the lease ID for the blob.\nRequestId:ef8f5941-301e-0010-6d20-541faa000000\nTime:2022-04-19T19:07:15.1780669Z", + "x-ms-client-request-id" : "fc0036db-181b-4626-8a16-87bc0fb36347", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "624a51400624a5140dda1216296eb996be861475483d", "624a51401624a5140dda84719f00748370112459fa94" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[5].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[5].json new file mode 100644 index 0000000000000..c2546de8691ba --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesACFail[5].json @@ -0,0 +1,70 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/7b51600107b516001b272112012061e13c7cc4c5183a?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3066c4bf-f8d0-4132-85b6-85fc66ca9f69" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D06CED1C", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6b23a7aa-101e-0028-6d20-54bb6a000000", + "x-ms-client-request-id" : "3066c4bf-f8d0-4132-85b6-85fc66ca9f69", + "Date" : "Tue, 19 Apr 2022 19:07:13 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/7b51600107b516001b272112012061e13c7cc4c5183a/7b51600117b516001b2719827ef1b59b858e1492ea6c", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "779e9b61-75a6-4ec6-b4ad-f985d7ea6505" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237D0CAC5F6", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:14 GMT", + "x-ms-version-id" : "2022-04-19T19:07:14.7842038Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "ef8f5851-301e-0010-2220-541faa000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "779e9b61-75a6-4ec6-b4ad-f985d7ea6505", + "Date" : "Tue, 19 Apr 2022 19:07:14 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/7b51600107b516001b272112012061e13c7cc4c5183a/7b51600117b516001b2719827ef1b59b858e1492ea6c?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "8c127180-7022-4c63-a393-d079f58f4944" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "bf55588e-201e-008a-7d20-548173000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:bf55588e-201e-008a-7d20-548173000000\nTime:2022-04-19T19:07:15.2040298Z", + "x-ms-client-request-id" : "8c127180-7022-4c63-a393-d079f58f4944", + "Date" : "Tue, 19 Apr 2022 19:07:15 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "7b51600107b516001b272112012061e13c7cc4c5183a", "7b51600117b516001b2719827ef1b59b858e1492ea6c" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[0].json new file mode 100644 index 0000000000000..2aa638ae9be8f --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[0].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e5b947c40e5b947c410374920fef3acd65e6947f98fe?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "339ce82d-5185-41e0-9558-ccd97857e758" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB4A4913", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "43c16b69-c01e-002b-4620-545a0e000000", + "x-ms-client-request-id" : "339ce82d-5185-41e0-9558-ccd97857e758", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e5b947c40e5b947c410374920fef3acd65e6947f98fe/e5b947c41e5b947c4103348991620e7aaf57c415e958", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bf189c77-3a21-4853-ae14-1f89c47e8261" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB94929C", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7274780Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "70c329c6-a01e-002d-1220-5469b1000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "bf189c77-3a21-4853-ae14-1f89c47e8261", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e5b947c40e5b947c410374920fef3acd65e6947f98fe/e5b947c41e5b947c4103348991620e7aaf57c415e958?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b82f7360-4bb3-4cea-9f70-e3f339e5888a", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a03a7844-301e-002f-2d20-54d709000000", + "x-ms-client-request-id" : "b82f7360-4bb3-4cea-9f70-e3f339e5888a", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/e5b947c40e5b947c410374920fef3acd65e6947f98fe/e5b947c41e5b947c4103348991620e7aaf57c415e958?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "66f6d238-95da-4268-ad7b-99570f5722b9" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT", + "eTag" : "0x8DA2237EB94929C", + "x-ms-request-id" : "70c32a8b-a01e-002d-4220-5469b1000000", + "Body" : "\n", + "x-ms-client-request-id" : "66f6d238-95da-4268-ad7b-99570f5722b9", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "e5b947c40e5b947c410374920fef3acd65e6947f98fe", "e5b947c41e5b947c4103348991620e7aaf57c415e958" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[1].json new file mode 100644 index 0000000000000..570616b5dfecc --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[1].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/fca276850fca27685e9505054a23a2eb83fae4952b47?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "fab506e4-a09c-4ffe-ae46-edb8079d29c5" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB4A577E", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a03a7789-301e-002f-1520-54d709000000", + "x-ms-client-request-id" : "fab506e4-a09c-4ffe-ae46-edb8079d29c5", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/fca276850fca27685e9505054a23a2eb83fae4952b47/fca276851fca27685e95277587102686c7b5f424cae6", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "167fc256-8ba4-49e7-842c-0e9469e021f5" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB94B9AA", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7284778Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "43c16bb4-c01e-002b-0220-545a0e000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "167fc256-8ba4-49e7-842c-0e9469e021f5", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/fca276850fca27685e9505054a23a2eb83fae4952b47/fca276851fca27685e95277587102686c7b5f424cae6?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c926f7e6-9479-4da2-ba22-cc04dffb320c", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "3ecfe4b8-b01e-0031-0120-543bd1000000", + "x-ms-client-request-id" : "c926f7e6-9479-4da2-ba22-cc04dffb320c", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/fca276850fca27685e9505054a23a2eb83fae4952b47/fca276851fca27685e95277587102686c7b5f424cae6?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b2120f9d-c56e-482a-9aea-6349df4ed6ae" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT", + "eTag" : "0x8DA2237EB94B9AA", + "x-ms-request-id" : "801cb8e7-b01e-001e-6f20-54361a000000", + "Body" : "\n", + "x-ms-client-request-id" : "b2120f9d-c56e-482a-9aea-6349df4ed6ae", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "fca276850fca27685e9505054a23a2eb83fae4952b47", "fca276851fca27685e95277587102686c7b5f424cae6" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[2].json new file mode 100644 index 0000000000000..fa761fe8ec7c8 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[2].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d78f25460d78f25461ef61049da3579db1ea84ee3a6b?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7a0237db-a3d9-4f0f-a7f2-3f49c806252b" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB4B5E3A", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "801cb7b0-b01e-001e-6620-54361a000000", + "x-ms-client-request-id" : "7a0237db-a3d9-4f0f-a7f2-3f49c806252b", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d78f25460d78f25461ef61049da3579db1ea84ee3a6b/d78f25461d78f25461ef5127800a372c6671a4603834", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "94115b3f-6f71-41ce-928d-ac7b25ac62cb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB93A860", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7214816Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "3ecfe465-b01e-0031-3620-543bd1000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "94115b3f-6f71-41ce-928d-ac7b25ac62cb", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d78f25460d78f25461ef61049da3579db1ea84ee3a6b/d78f25461d78f25461ef5127800a372c6671a4603834?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "74219736-8bcf-4b23-a0c0-579b072f54c1", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "70c32a2d-a01e-002d-6a20-5469b1000000", + "x-ms-client-request-id" : "74219736-8bcf-4b23-a0c0-579b072f54c1", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/d78f25460d78f25461ef61049da3579db1ea84ee3a6b/d78f25461d78f25461ef5127800a372c6671a4603834?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "31d5dc6a-e3df-45cf-b1ac-360299b4f221" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT", + "eTag" : "0x8DA2237EB93A860", + "x-ms-request-id" : "a03a7885-301e-002f-6320-54d709000000", + "Body" : "\n", + "x-ms-client-request-id" : "31d5dc6a-e3df-45cf-b1ac-360299b4f221", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "d78f25460d78f25461ef61049da3579db1ea84ee3a6b", "d78f25461d78f25461ef5127800a372c6671a4603834" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[3].json new file mode 100644 index 0000000000000..6b7a1cf7f3238 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[3].json @@ -0,0 +1,123 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ce9414070ce94140782001730aa3997cc2f4d447bb64?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "cd730b44-f9c6-4371-9f11-94c74a6b48c5" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB498532", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "70c328d1-a01e-002d-4e20-5469b1000000", + "x-ms-client-request-id" : "cd730b44-f9c6-4371-9f11-94c74a6b48c5", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ce9414070ce94140782001730aa3997cc2f4d447bb64/ce9414071ce94140782054399085621ff5b664ea08e3", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "4b6e3719-b15a-4c78-bb5d-791ae61119c1" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB95CAF0", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7354736Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "801cb856-b01e-001e-7420-54361a000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "4b6e3719-b15a-4c78-bb5d-791ae61119c1", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ce9414070ce94140782001730aa3997cc2f4d447bb64/ce9414071ce94140782054399085621ff5b664ea08e3?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "14dd7106-64bf-4de0-9d55-763540725c2f", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "801cb89b-b01e-001e-2e20-54361a000000", + "x-ms-client-request-id" : "14dd7106-64bf-4de0-9d55-763540725c2f", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://REDACTED.blob.core.windows.net/ce9414070ce94140782001730aa3997cc2f4d447bb64/ce9414071ce94140782054399085621ff5b664ea08e3", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "0d0d9847-121f-4c89-baf6-927a2e3d31fe" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "content-length" : "512", + "x-ms-version" : "2021-04-10", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-tag-count" : "1", + "x-ms-lease-state" : "available", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7354736Z", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:00 GMT", + "x-ms-blob-type" : "PageBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-creation-time" : "Tue, 19 Apr 2022 19:07:59 GMT", + "eTag" : "0x8DA2237EB95CAF0", + "x-ms-request-id" : "3ecfe52c-b01e-0031-6820-543bd1000000", + "x-ms-client-request-id" : "0d0d9847-121f-4c89-baf6-927a2e3d31fe", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/ce9414070ce94140782001730aa3997cc2f4d447bb64/ce9414071ce94140782054399085621ff5b664ea08e3?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "0d0a691d-bddf-4575-baa0-2f86bc6009fc" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:00 GMT", + "eTag" : "0x8DA2237EB95CAF0", + "x-ms-request-id" : "3ecfe5a2-b01e-0031-5120-543bd1000000", + "Body" : "\n", + "x-ms-client-request-id" : "0d0a691d-bddf-4575-baa0-2f86bc6009fc", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "ce9414070ce94140782001730aa3997cc2f4d447bb64", "ce9414071ce94140782054399085621ff5b664ea08e3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[4].json new file mode 100644 index 0000000000000..d86cd31af4f10 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[4].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/81d582c0081d582c01c8458413ae6382764834a65988?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "61ea2074-0b2e-49c7-9523-d86444362c55" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB4A1964", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "830e3593-801e-0067-3320-54ca3e000000", + "x-ms-client-request-id" : "61ea2074-0b2e-49c7-9523-d86444362c55", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/81d582c0081d582c01c8458413ae6382764834a65988/81d582c0181d582c01c8522319cbfbd32112c4a2a9c8", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "8cb3eeb8-0fc1-43d7-ac68-1e6c57ff4e36" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB94929C", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7284778Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a03a780b-301e-002f-7c20-54d709000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "8cb3eeb8-0fc1-43d7-ac68-1e6c57ff4e36", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/81d582c0081d582c01c8458413ae6382764834a65988/81d582c0181d582c01c8522319cbfbd32112c4a2a9c8?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "af754ec0-143d-4703-9454-c7f21ddd5c0d", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "830e362e-801e-0067-3020-54ca3e000000", + "x-ms-client-request-id" : "af754ec0-143d-4703-9454-c7f21ddd5c0d", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/81d582c0081d582c01c8458413ae6382764834a65988/81d582c0181d582c01c8522319cbfbd32112c4a2a9c8?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "44019831-ac32-4133-8303-611e3d7a136b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT", + "eTag" : "0x8DA2237EB94929C", + "x-ms-request-id" : "5b532fd2-101e-0065-7320-547486000000", + "Body" : "\n", + "x-ms-client-request-id" : "44019831-ac32-4133-8303-611e3d7a136b", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "81d582c0081d582c01c8458413ae6382764834a65988", "81d582c0181d582c01c8522319cbfbd32112c4a2a9c8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[5].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[5].json new file mode 100644 index 0000000000000..552669ceb11b6 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[5].json @@ -0,0 +1,113 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/98ceb381098ceb3817bb96215346c56d476ad473fae0?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3ae808d2-0405-493d-9e92-db25c7dd30ed" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB4B5ED9", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "3ecfe37a-b01e-0031-6220-543bd1000000", + "x-ms-client-request-id" : "3ae808d2-0405-493d-9e92-db25c7dd30ed", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/98ceb381098ceb3817bb96215346c56d476ad473fae0/98ceb381198ceb3817bb1374508a0fe72b1d34d788b0", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "830205b1-6af8-40c8-8e6d-740d6c9c62e9" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB94929C", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7274780Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "830e360a-801e-0067-1220-54ca3e000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "830205b1-6af8-40c8-8e6d-740d6c9c62e9", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/98ceb381098ceb3817bb96215346c56d476ad473fae0/98ceb381198ceb3817bb1374508a0fe72b1d34d788b0?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "dda06a91-e830-4afc-8ddf-4e4ef10c0985", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "43c16be3-c01e-002b-2820-545a0e000000", + "x-ms-client-request-id" : "dda06a91-e830-4afc-8ddf-4e4ef10c0985", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/98ceb381098ceb3817bb96215346c56d476ad473fae0/98ceb381198ceb3817bb1374508a0fe72b1d34d788b0?comp=lease", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "367983b6-5955-4304-8a92-54801a82fffd" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-id" : "427dfc94-7d24-4a36-bcdd-795c16d1abbe", + "eTag" : "0x8DA2237EB94929C", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "43c16c1b-c01e-002b-5620-545a0e000000", + "x-ms-client-request-id" : "367983b6-5955-4304-8a92-54801a82fffd", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/98ceb381098ceb3817bb96215346c56d476ad473fae0/98ceb381198ceb3817bb1374508a0fe72b1d34d788b0?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "342c5ec4-2884-4701-8f57-8da2aae5c2b0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:02 GMT", + "eTag" : "0x8DA2237EB94929C", + "x-ms-request-id" : "43c16c38-c01e-002b-6e20-545a0e000000", + "Body" : "\n", + "x-ms-client-request-id" : "342c5ec4-2884-4701-8f57-8da2aae5c2b0", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "98ceb381098ceb3817bb96215346c56d476ad473fae0", "98ceb381198ceb3817bb1374508a0fe72b1d34d788b0" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[6].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[6].json new file mode 100644 index 0000000000000..511e4bb701cfe --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesAC[6].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b3e3e0420b3e3e042f2995132d65f5780bbab4551a4b?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bf5a93a6-3bd9-4e7e-82cf-1c50e9582f86" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB8AA2AF", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5b532e63-101e-0065-4e20-547486000000", + "x-ms-client-request-id" : "bf5a93a6-3bd9-4e7e-82cf-1c50e9582f86", + "Date" : "Tue, 19 Apr 2022 19:07:58 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b3e3e0420b3e3e042f2995132d65f5780bbab4551a4b/b3e3e0421b3e3e042f29092180d06807680f94c17a26", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3216f678-2281-4e74-9b4e-2fdb633b4cb8" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237EB9DE016", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "x-ms-version-id" : "2022-04-19T19:07:59.7884438Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5b532f25-101e-0065-5720-547486000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "3216f678-2281-4e74-9b4e-2fdb633b4cb8", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b3e3e0420b3e3e042f2995132d65f5780bbab4551a4b/b3e3e0421b3e3e042f29092180d06807680f94c17a26?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "aee794e2-9a36-4c4b-8b38-a598f858c0ce", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "5b532f6a-101e-0065-1620-547486000000", + "x-ms-client-request-id" : "aee794e2-9a36-4c4b-8b38-a598f858c0ce", + "Date" : "Tue, 19 Apr 2022 19:07:59 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/b3e3e0420b3e3e042f2995132d65f5780bbab4551a4b/b3e3e0421b3e3e042f29092180d06807680f94c17a26?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "325722fb-8377-4399-90b1-38722067fe5b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "512", + "Last-Modified" : "Tue, 19 Apr 2022 19:07:59 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:01 GMT", + "eTag" : "0x8DA2237EB9DE016", + "x-ms-request-id" : "830e366f-801e-0067-6220-54ca3e000000", + "Body" : "\n", + "x-ms-client-request-id" : "325722fb-8377-4399-90b1-38722067fe5b", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "b3e3e0420b3e3e042f2995132d65f5780bbab4551a4b", "b3e3e0421b3e3e042f29092180d06807680f94c17a26" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiff.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiff.json new file mode 100644 index 0000000000000..ca8afeae01f31 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiff.json @@ -0,0 +1,235 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "17d969d7-21c9-4699-b059-a7b8b8040137" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8AD5BA9", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5a09fe10-101e-0046-081e-54267f000000", + "x-ms-client-request-id" : "17d969d7-21c9-4699-b059-a7b8b8040137", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "791a9210-08d6-467a-b6a2-99b75c213307" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8BB5712", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "aba11633-f01e-0061-201e-5431bb000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "791a9210-08d6-467a-b6a2-99b75c213307", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d2d651b5-57aa-4665-aea7-83a35175a617" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8CD07DA", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "855931b3-501e-0068-1e1e-547468000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "d2d651b5-57aa-4665-aea7-83a35175a617", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "dc38f885-f928-4a74-b674-3b84d4465827", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "3bDOp25s6Cs=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8DB0F6D", + "x-ms-request-id" : "317fd948-801e-0036-101e-549f88000000", + "x-ms-client-request-id" : "dc38f885-f928-4a74-b674-3b84d4465827" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "47aaac8c-11af-4446-a2a9-e1893a42e78d" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "x-ms-snapshot" : "2022-04-19T18:51:48.9045524Z", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8DB0F6D", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "aba1169a-f01e-0061-011e-5431bb000000", + "x-ms-request-server-encrypted" : "false", + "x-ms-client-request-id" : "47aaac8c-11af-4446-a2a9-e1893a42e78d", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "83024736-2569-44a8-8349-e1fad6f77c17", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "JO5TC9OgMoc=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8FA048F", + "x-ms-request-id" : "aba116bc-f01e-0061-201e-5431bb000000", + "x-ms-client-request-id" : "83024736-2569-44a8-8349-e1fad6f77c17" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d091c97b-2be2-4225-8a60-da3a5daea53f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A916FE35", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8a7e4c47-301e-001c-3f1e-544098000000", + "x-ms-client-request-id" : "d091c97b-2be2-4225-8a60-da3a5daea53f", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "98c26771-2b63-475d-b37f-f5b32aec804c", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "JO5TC9OgMoc=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A9257B0F", + "x-ms-request-id" : "c62383da-701e-0022-801e-54d7e7000000", + "x-ms-client-request-id" : "98c26771-2b63-475d-b37f-f5b32aec804c" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "0847d2c6-1d8f-4b66-b58a-f408a4911773" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A94310DC", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f221105-501e-0078-061e-54b100000000", + "x-ms-client-request-id" : "0847d2c6-1d8f-4b66-b58a-f408a4911773", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/897736cd0897736cd5e8998767ba7c7eeae5244d596c/897736cd1897736cd5e892947757a5f50eedd4d60afd?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A48.9045524Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a9214c03-b05b-464f-9285-865a6b742942" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A94310DC", + "x-ms-request-id" : "af7568e0-e01e-0030-771e-54ac37000000", + "Body" : "\n01023102420472048307130724095", + "x-ms-client-request-id" : "a9214c03-b05b-464f-9285-865a6b742942", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "897736cd0897736cd5e8998767ba7c7eeae5244d596c", "897736cd1897736cd5e892947757a5f50eedd4d60afd", "dbb53bf9-7e43-4771-ac91-c5b1c011d126", "21bc9a3e-b74c-4cf4-b00b-5d5993c68d11" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[0].json new file mode 100644 index 0000000000000..bec2aef0ba812 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[0].json @@ -0,0 +1,91 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/397cc8640397cc86444f52330730703e51dd443b2ad2?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6ac91fcf-3bfc-4509-b82c-7cdb6a9075db" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CD9E169", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "84707e6a-a01e-0070-5620-546335000000", + "x-ms-client-request-id" : "6ac91fcf-3bfc-4509-b82c-7cdb6a9075db", + "Date" : "Tue, 19 Apr 2022 19:08:54 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/397cc8640397cc86444f52330730703e51dd443b2ad2/397cc8641397cc86444f431416f2311e0a19e45e8a8d", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c6038974-19fb-41ae-8f55-6e11689642a3" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D2ADC6A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0772202Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b25b0155-201e-006e-3420-548fed000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "c6038974-19fb-41ae-8f55-6e11689642a3", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/397cc8640397cc86444f52330730703e51dd443b2ad2/397cc8641397cc86444f431416f2311e0a19e45e8a8d?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "e19a47a8-8bfb-4e37-b72d-09161dbc7ceb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2391286Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2381286Z", + "eTag" : "0x8DA22380D2ADC6A", + "x-ms-request-id" : "84707f38-a01e-0070-0520-546335000000", + "x-ms-client-request-id" : "e19a47a8-8bfb-4e37-b72d-09161dbc7ceb" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/397cc8640397cc86444f52330730703e51dd443b2ad2/397cc8641397cc86444f431416f2311e0a19e45e8a8d?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2381286Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "2dd396ab-63ee-4442-b798-78b9c11ca2d3" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "304", + "x-ms-request-id" : "9ff2ef33-e01e-0061-3720-54f981000000", + "x-ms-client-request-id" : "2dd396ab-63ee-4442-b798-78b9c11ca2d3", + "Date" : "Tue, 19 Apr 2022 19:08:56 GMT" + }, + "Exception" : null + } ], + "variables" : [ "397cc8640397cc86444f52330730703e51dd443b2ad2", "397cc8641397cc86444f431416f2311e0a19e45e8a8d" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[1].json new file mode 100644 index 0000000000000..9a56dc9542d02 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[1].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/2067f92502067f9259af738928acb6a28f5ea4d5b943?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "948f8d3f-a522-41b8-bd46-0329c9238007" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CD9F2DF", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "01e2632f-b01e-0088-7c20-543fcb000000", + "x-ms-client-request-id" : "948f8d3f-a522-41b8-bd46-0329c9238007", + "Date" : "Tue, 19 Apr 2022 19:08:54 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/2067f92502067f9259af738928acb6a28f5ea4d5b943/2067f92512067f9259af7107081cadad2ea8442aca60", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "23e7c176-8d48-4b61-8478-c90ddd66c42f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D2ADC6A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0772202Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "824b73e5-e01e-003c-0120-54f305000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "23e7c176-8d48-4b61-8478-c90ddd66c42f", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/2067f92502067f9259af738928acb6a28f5ea4d5b943/2067f92512067f9259af7107081cadad2ea8442aca60?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "4220f939-f02d-430f-bb8c-0b2bf9638a02" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2451258Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2441258Z", + "eTag" : "0x8DA22380D2ADC6A", + "x-ms-request-id" : "01e26485-b01e-0088-0b20-543fcb000000", + "x-ms-client-request-id" : "4220f939-f02d-430f-bb8c-0b2bf9638a02" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/2067f92502067f9259af738928acb6a28f5ea4d5b943/2067f92512067f9259af7107081cadad2ea8442aca60?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2441258Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f089a8b9-49a6-427e-bc38-965873d4cd61" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "01e264e9-b01e-0088-5220-543fcb000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:01e264e9-b01e-0088-5220-543fcb000000\nTime:2022-04-19T19:08:56.4594315Z", + "x-ms-client-request-id" : "f089a8b9-49a6-427e-bc38-965873d4cd61", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "2067f92502067f9259af738928acb6a28f5ea4d5b943", "2067f92512067f9259af7107081cadad2ea8442aca60" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[2].json new file mode 100644 index 0000000000000..b5d87fbed74a4 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[2].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/0b4aaae600b4aaae64d083221232f97733e664328bca?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "1284e87d-a14a-4041-a560-c54ad1811cbe" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CD9197A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "824b733e-e01e-003c-7620-54f305000000", + "x-ms-client-request-id" : "1284e87d-a14a-4041-a560-c54ad1811cbe", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/0b4aaae600b4aaae64d083221232f97733e664328bca/0b4aaae610b4aaae64d028358d3b7e7de7941466fa50", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "39a636e5-35f4-45a0-925c-81f5c4d6d59c" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D2AB55D", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0772202Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "01771198-c01e-0092-1e20-545e14000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "39a636e5-35f4-45a0-925c-81f5c4d6d59c", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/0b4aaae600b4aaae64d083221232f97733e664328bca/0b4aaae610b4aaae64d028358d3b7e7de7941466fa50?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "83473e9e-630f-42f5-9937-a90ec3ee89f1" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2391286Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2381286Z", + "eTag" : "0x8DA22380D2AB55D", + "x-ms-request-id" : "b25b01d9-201e-006e-1f20-548fed000000", + "x-ms-client-request-id" : "83473e9e-630f-42f5-9937-a90ec3ee89f1" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/0b4aaae600b4aaae64d083221232f97733e664328bca/0b4aaae610b4aaae64d028358d3b7e7de7941466fa50?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2381286Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "fb16576e-393a-4923-8c4f-6bb1b79084d5" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "b25b024d-201e-006e-7e20-548fed000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:b25b024d-201e-006e-7e20-548fed000000\nTime:2022-04-19T19:08:56.4569011Z", + "x-ms-client-request-id" : "fb16576e-393a-4923-8c4f-6bb1b79084d5", + "Date" : "Tue, 19 Apr 2022 19:08:56 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "0b4aaae600b4aaae64d083221232f97733e664328bca", "0b4aaae610b4aaae64d028358d3b7e7de7941466fa50" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[3].json new file mode 100644 index 0000000000000..a4dba455d9196 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[3].json @@ -0,0 +1,122 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/12519ba7012519ba788c039572dc899cbe6da441aa91?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "9c909b34-26e7-4b3e-8cde-c2a052533149" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CD9FD45", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "017710be-c01e-0092-7720-545e14000000", + "x-ms-client-request-id" : "9c909b34-26e7-4b3e-8cde-c2a052533149", + "Date" : "Tue, 19 Apr 2022 19:08:54 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/12519ba7012519ba788c039572dc899cbe6da441aa91/12519ba7112519ba788c192175b6e5a07ef334db580e", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "ffca59da-2e63-44b8-9b95-50f5710f486f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D2ADC6A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0772202Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "84707f15-a01e-0070-6720-546335000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "ffca59da-2e63-44b8-9b95-50f5710f486f", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/12519ba7012519ba788c039572dc899cbe6da441aa91/12519ba7112519ba788c192175b6e5a07ef334db580e?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "beacd2f7-7d8c-49b5-87c0-a253be8cf509" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2451258Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2441258Z", + "eTag" : "0x8DA22380D2ADC6A", + "x-ms-request-id" : "017711ff-c01e-0092-6b20-545e14000000", + "x-ms-client-request-id" : "beacd2f7-7d8c-49b5-87c0-a253be8cf509" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://REDACTED.blob.core.windows.net/12519ba7012519ba788c039572dc899cbe6da441aa91/12519ba7112519ba788c192175b6e5a07ef334db580e", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "2fe6dd2d-954d-4768-8beb-0f1f22d2f204" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "content-length" : "512", + "x-ms-version" : "2021-04-10", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-state" : "available", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2451258Z", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-blob-type" : "PageBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-creation-time" : "Tue, 19 Apr 2022 19:08:56 GMT", + "eTag" : "0x8DA22380D2ADC6A", + "x-ms-request-id" : "84707f59-a01e-0070-1a20-546335000000", + "x-ms-client-request-id" : "2fe6dd2d-954d-4768-8beb-0f1f22d2f204", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/12519ba7012519ba788c039572dc899cbe6da441aa91/12519ba7112519ba788c192175b6e5a07ef334db580e?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2441258Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "854d0c92-f28f-4dc4-a5ef-78f9cb217561" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "304", + "x-ms-request-id" : "84707f98-a01e-0070-3b20-546335000000", + "x-ms-client-request-id" : "854d0c92-f28f-4dc4-a5ef-78f9cb217561", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + } ], + "variables" : [ "12519ba7012519ba788c039572dc899cbe6da441aa91", "12519ba7112519ba788c192175b6e5a07ef334db580e" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[4].json new file mode 100644 index 0000000000000..7b20418e3021f --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[4].json @@ -0,0 +1,116 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5d100d6005d100d6058066263560b701e04b941af9e2?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "2ad22e1d-b644-41da-925d-3b9ead4be11a" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CD9DE00", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b25b008b-201e-006e-1f20-548fed000000", + "x-ms-client-request-id" : "2ad22e1d-b644-41da-925d-3b9ead4be11a", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5d100d6005d100d6058066263560b701e04b941af9e2/5d100d6015d100d605803705964fd7afe6598482691b", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "1fd90b42-d186-42c0-9723-d2f32c4ff3cb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D29F227", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0712231Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "01e2640b-b01e-0088-2c20-543fcb000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "1fd90b42-d186-42c0-9723-d2f32c4ff3cb", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5d100d6005d100d6058066263560b701e04b941af9e2/5d100d6015d100d605803705964fd7afe6598482691b?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7ebe8de5-275f-4ec9-9701-02e9df9c5d67" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2451258Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2441258Z", + "eTag" : "0x8DA22380D29F227", + "x-ms-request-id" : "824b7415-e01e-003c-2820-54f305000000", + "x-ms-client-request-id" : "7ebe8de5-275f-4ec9-9701-02e9df9c5d67" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/5d100d6005d100d6058066263560b701e04b941af9e2/5d100d6015d100d605803705964fd7afe6598482691b?comp=lease", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "28ec3035-f203-45f4-897b-a3cc13df1a12" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-id" : "81a25258-8ff1-401a-a870-e7ea0addd478", + "eTag" : "0x8DA22380D29F227", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "01771276-c01e-0092-4120-545e14000000", + "x-ms-client-request-id" : "28ec3035-f203-45f4-897b-a3cc13df1a12", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/5d100d6005d100d6058066263560b701e04b941af9e2/5d100d6015d100d605803705964fd7afe6598482691b?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2441258Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bc0649e0-a0d2-47c3-b0e2-4036c6c7de51" + }, + "Response" : { + "content-length" : "265", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "LeaseIdMismatchWithBlobOperation", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "0177129a-c01e-0092-5a20-545e14000000", + "Body" : "\nLeaseIdMismatchWithBlobOperationThe lease ID specified did not match the lease ID for the blob.\nRequestId:0177129a-c01e-0092-5a20-545e14000000\nTime:2022-04-19T19:08:56.5616431Z", + "x-ms-client-request-id" : "bc0649e0-a0d2-47c3-b0e2-4036c6c7de51", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "5d100d6005d100d6058066263560b701e04b941af9e2", "5d100d6015d100d605803705964fd7afe6598482691b" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[5].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[5].json new file mode 100644 index 0000000000000..44521b3cae620 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffACFail[5].json @@ -0,0 +1,94 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/440b3c210440b3c216f071727b7b39b467745402eace?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "20438fa4-c54f-42fb-88e7-1cf239bc2d38" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380CDAD4B2", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:55 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9ff2ee52-e01e-0061-7f20-54f981000000", + "x-ms-client-request-id" : "20438fa4-c54f-42fb-88e7-1cf239bc2d38", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/440b3c210440b3c216f071727b7b39b467745402eace/440b3c211440b3c216f0207975b6105c692f3484c8fc", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "51559b81-e3e7-46d8-be0b-d09e22fc2d7b" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA22380D2B7893", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.0812179Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "9ff2eecc-e01e-0061-6420-54f981000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "51559b81-e3e7-46d8-be0b-d09e22fc2d7b", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/440b3c210440b3c216f071727b7b39b467745402eace/440b3c211440b3c216f0207975b6105c692f3484c8fc?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5551d28f-55a3-4016-8543-a454aac31627" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:56 GMT", + "x-ms-version-id" : "2022-04-19T19:08:56.2451258Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:55 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:56.2441258Z", + "eTag" : "0x8DA22380D2B7893", + "x-ms-request-id" : "9ff2ef05-e01e-0061-1020-54f981000000", + "x-ms-client-request-id" : "5551d28f-55a3-4016-8543-a454aac31627" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/440b3c210440b3c216f071727b7b39b467745402eace/440b3c211440b3c216f0207975b6105c692f3484c8fc?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A56.2441258Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "41c46656-c354-4637-a5de-d9b23ce28d34" + }, + "Response" : { + "content-length" : "253", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-error-code" : "ConditionNotMet", + "retry-after" : "0", + "StatusCode" : "412", + "x-ms-request-id" : "824b7443-e01e-003c-4c20-54f305000000", + "Body" : "\nConditionNotMetThe condition specified using HTTP conditional header(s) is not met.\nRequestId:824b7443-e01e-003c-4c20-54f305000000\nTime:2022-04-19T19:08:56.8156554Z", + "x-ms-client-request-id" : "41c46656-c354-4637-a5de-d9b23ce28d34", + "Date" : "Tue, 19 Apr 2022 19:08:56 GMT", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "440b3c210440b3c216f071727b7b39b467745402eace", "440b3c211440b3c216f0207975b6105c692f3484c8fc" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[0].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[0].json new file mode 100644 index 0000000000000..d576a8161ffb3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[0].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "97971188-2945-43d6-9b28-7f09ecc430dc" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD16EED", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c2b75391-601e-000d-2d20-541216000000", + "x-ms-client-request-id" : "97971188-2945-43d6-9b28-7f09ecc430dc", + "Date" : "Tue, 19 Apr 2022 19:08:27 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a3a48397-d135-4b8c-8e87-8b95d4aac745" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD224EC1", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1776193Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f107310-301e-0062-5620-5418e5000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "a3a48397-d135-4b8c-8e87-8b95d4aac745", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d66d16e3-20a3-40bb-a706-553e0f40c8e4" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD3A6715", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.3375280Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1399f384-d01e-006a-7420-5402ea000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "d66d16e3-20a3-40bb-a706-553e0f40c8e4", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3a62e527-6b7f-46ca-acfb-0ea76d1b329f", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "Tug7XgZ/D0Y=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6E19B2", + "x-ms-request-id" : "1399f3bd-d01e-006a-2020-5402ea000000", + "x-ms-client-request-id" : "3a62e527-6b7f-46ca-acfb-0ea76d1b329f" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b41ac38b-6f45-4d42-9a7d-335c39f2a141" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8122572Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8112572Z", + "eTag" : "0x8DA2237FD6E19B2", + "x-ms-request-id" : "1399f3d5-d01e-006a-3520-5402ea000000", + "x-ms-client-request-id" : "b41ac38b-6f45-4d42-9a7d-335c39f2a141" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b4cd1e5f-f80c-4785-b201-ccfa110133d5", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "57d06e98-b01e-007c-7b20-54f43d000000", + "x-ms-client-request-id" : "b4cd1e5f-f80c-4785-b201-ccfa110133d5", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59/ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8112572Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "e285d10e-0c9f-4ad5-8b86-e8b15210f4be" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6E19B2", + "x-ms-request-id" : "5f10760f-301e-0062-2120-5418e5000000", + "Body" : "\n", + "x-ms-client-request-id" : "e285d10e-0c9f-4ad5-8b86-e8b15210f4be", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "ff5f7d1c0ff5f7d1ce992166866878613a51b497fa59", "ff5f7d1c1ff5f7d1ce9987510615b836a31ce424c9c7", "dab1cb7e-419d-4c0f-8755-230375533488" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[1].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[1].json new file mode 100644 index 0000000000000..4ec614238265e --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[1].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "1fa63d55-1af3-4ed8-ab0b-a3baa22b21ca" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD11E6E", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "57d06d27-b01e-007c-4520-54f43d000000", + "x-ms-client-request-id" : "1fa63d55-1af3-4ed8-ab0b-a3baa22b21ca", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "522788aa-3c82-4d2e-81d5-3677d809825c" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD2227B6", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1766198Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "76e3291a-b01e-006c-2520-543155000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "522788aa-3c82-4d2e-81d5-3677d809825c", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bd15b63d-26de-489d-8993-8e5680143b7f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD3A6715", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.3375280Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "76e32966-b01e-006c-6b20-543155000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "bd15b63d-26de-489d-8993-8e5680143b7f", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "aca737d2-8a00-40a3-a093-d2495872a679", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "FmlxHgh4uG0=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6F2AF7", + "x-ms-request-id" : "a160d5e9-b01e-0053-1620-54f9f6000000", + "x-ms-client-request-id" : "aca737d2-8a00-40a3-a093-d2495872a679" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b2d3ee21-03c6-49b5-b122-9ecd58437402" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8192533Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8182533Z", + "eTag" : "0x8DA2237FD6F2AF7", + "x-ms-request-id" : "a160d609-b01e-0053-2d20-54f9f6000000", + "x-ms-client-request-id" : "b2d3ee21-03c6-49b5-b122-9ecd58437402" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "19f9c102-178e-4991-b64e-837427c5c143", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "c2b7553c-601e-000d-1a20-541216000000", + "x-ms-client-request-id" : "19f9c102-178e-4991-b64e-837427c5c143", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/e6444c5d0e6444c5d85877874c347257f673643f287d/e6444c5d1e6444c5d858868573b8f1b66a83a476493b?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8182533Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "9985ec70-d681-407b-98e6-f517a0bef5af" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6F2AF7", + "x-ms-request-id" : "c2b75598-601e-000d-6620-541216000000", + "Body" : "\n", + "x-ms-client-request-id" : "9985ec70-d681-407b-98e6-f517a0bef5af", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "e6444c5d0e6444c5d85877874c347257f673643f287d", "e6444c5d1e6444c5d858868573b8f1b66a83a476493b", "2215dc59-d09a-41ce-9293-4771df3a5ed9" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[2].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[2].json new file mode 100644 index 0000000000000..86f976ac2b8c2 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[2].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7320855a-e85f-49fb-9fbe-c79dfb37ef5f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD02BFE", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1916c9af-601e-008b-4a20-54deaf000000", + "x-ms-client-request-id" : "7320855a-e85f-49fb-9fbe-c79dfb37ef5f", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "4ba2d5bb-c8bf-43aa-a130-16b0c8bfbaaf" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD22EAE8", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1816168Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1399f36f-d01e-006a-6220-5402ea000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "4ba2d5bb-c8bf-43aa-a130-16b0c8bfbaaf", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "73cf352f-f1a6-4d1c-8193-0ddd70eb8768" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD3A6715", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.3365285Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f1073b5-301e-0062-6f20-5418e5000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "73cf352f-f1a6-4d1c-8193-0ddd70eb8768", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "96223da0-e528-42a1-8730-ff68cbc4fd25", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "QHnK0qjzJhE=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6EDCE4", + "x-ms-request-id" : "57d06e40-b01e-007c-3120-54f43d000000", + "x-ms-client-request-id" : "96223da0-e528-42a1-8730-ff68cbc4fd25" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "ef3454da-a700-41e0-82de-88273b5e25aa" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8172547Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8162547Z", + "eTag" : "0x8DA2237FD6EDCE4", + "x-ms-request-id" : "76e329f4-b01e-006c-6520-543155000000", + "x-ms-client-request-id" : "ef3454da-a700-41e0-82de-88273b5e25aa" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "205e673a-749e-49f5-99c5-655df60f9443", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "5f107575-301e-0062-1820-5418e5000000", + "x-ms-client-request-id" : "205e673a-749e-49f5-99c5-655df60f9443", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3/cd691f9e1cd691f9e2f6380305ab44c519d374f88b38?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8162547Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "23fbb7d3-08b9-4b5b-8df1-69386a473e8c" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6EDCE4", + "x-ms-request-id" : "1399f422-d01e-006a-7220-5402ea000000", + "Body" : "\n", + "x-ms-client-request-id" : "23fbb7d3-08b9-4b5b-8df1-69386a473e8c", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "cd691f9e0cd691f9e2f6182623a6bdfe5697545309a3", "cd691f9e1cd691f9e2f6380305ab44c519d374f88b38", "1d4613de-40fb-4386-a6d0-7a9e6ce2ddc8" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[3].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[3].json new file mode 100644 index 0000000000000..2ccb88c40f916 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[3].json @@ -0,0 +1,195 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "1eb1b867-310f-41c8-adb2-cd5a9458794c" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD11F52", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "76e32875-b01e-006c-1d20-543155000000", + "x-ms-client-request-id" : "1eb1b867-310f-41c8-adb2-cd5a9458794c", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3aee5a20-c507-4a0a-aad5-0ef151a011eb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD213D73", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1706227Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a160d588-b01e-0053-4420-54f9f6000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "3aee5a20-c507-4a0a-aad5-0ef151a011eb", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5a82c2aa-7874-4b91-bf9a-2b7494b4495a" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD5F75D6", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.5793894Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f107460-301e-0062-1220-5418e5000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "5a82c2aa-7874-4b91-bf9a-2b7494b4495a", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "2528ad79-00ad-49d3-9128-47b85779fe31", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "EBpcoPKtUnQ=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT", + "eTag" : "0x8DA2237FD7285DC", + "x-ms-request-id" : "5f10749d-301e-0062-4c20-5418e5000000", + "x-ms-client-request-id" : "2528ad79-00ad-49d3-9128-47b85779fe31" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c4534b45-56ea-4d47-97d4-183624fbfe6d" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8172547Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8162547Z", + "eTag" : "0x8DA2237FD7285DC", + "x-ms-request-id" : "57d06e61-b01e-007c-4c20-54f43d000000", + "x-ms-client-request-id" : "c4534b45-56ea-4d47-97d4-183624fbfe6d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f83a72b2-f340-4d6f-b3a4-357fd519388c", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "1916cc0e-601e-008b-6020-54deaf000000", + "x-ms-client-request-id" : "f83a72b2-f340-4d6f-b3a4-357fd519388c", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "HEAD", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "58e811e7-f857-4992-bbae-7b86d2bbc2b8" + }, + "Response" : { + "x-ms-is-current-version" : "true", + "content-length" : "4096", + "x-ms-version" : "2021-04-10", + "x-ms-lease-status" : "unlocked", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-tag-count" : "1", + "x-ms-lease-state" : "available", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8172547Z", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:30 GMT", + "x-ms-blob-type" : "PageBlob", + "Accept-Ranges" : "bytes", + "x-ms-server-encrypted" : "true", + "x-ms-creation-time" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD7285DC", + "x-ms-request-id" : "76e32a80-b01e-006c-5620-543155000000", + "x-ms-client-request-id" : "58e811e7-f857-4992-bbae-7b86d2bbc2b8", + "Content-Type" : "application/octet-stream" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/d4722edf0d4722edf9ca9441182ad3d459ed8497b828/d4722edf1d4722edf9ca57440d6f5647a66e44957afc?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8162547Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "25c95d12-1d0f-43b1-a86c-c75ff132fd15" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:30 GMT", + "eTag" : "0x8DA2237FD7285DC", + "x-ms-request-id" : "76e32ade-b01e-006c-2520-543155000000", + "Body" : "\n", + "x-ms-client-request-id" : "25c95d12-1d0f-43b1-a86c-c75ff132fd15", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "d4722edf0d4722edf9ca9441182ad3d459ed8497b828", "d4722edf1d4722edf9ca57440d6f5647a66e44957afc", "3db08c4b-5e94-4468-b00c-f5768079fe99" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[4].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[4].json new file mode 100644 index 0000000000000..554eb81572ca5 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[4].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d6da85f1-0823-43af-a0ce-c49886bffe1e" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD0047A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1399f306-d01e-006a-1620-5402ea000000", + "x-ms-client-request-id" : "d6da85f1-0823-43af-a0ce-c49886bffe1e", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d5668a92-86ac-4f32-9225-6d1fa6f1c7fa" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD2227B6", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1766198Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c2b75446-601e-000d-4320-541216000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "d5668a92-86ac-4f32-9225-6d1fa6f1c7fa", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bcc20df5-1b37-4b11-95cd-fed23059b9e3" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD3A6715", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.3365285Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "57d06df7-b01e-007c-7620-54f43d000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "bcc20df5-1b37-4b11-95cd-fed23059b9e3", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f02e30e9-0a87-4a38-ad44-afff068ff6cf", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "a5rl1saUg/4=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "c2b754cd-601e-000d-3c20-541216000000", + "x-ms-client-request-id" : "f02e30e9-0a87-4a38-ad44-afff068ff6cf" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "8a19d541-3906-45f1-b024-4957f432d94d" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8232512Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8222512Z", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "5f1074e1-301e-0062-0d20-5418e5000000", + "x-ms-client-request-id" : "8a19d541-3906-45f1-b024-4957f432d94d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7ee19ca3-885a-4a24-9dce-35427a2caad2", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "a160d630-b01e-0053-4c20-54f9f6000000", + "x-ms-client-request-id" : "7ee19ca3-885a-4a24-9dce-35427a2caad2", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/9b33b81809b33b8186c9720756109e8b2f24840c7b39/9b33b81819b33b8186c9788487b78f03f8720464d843?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8222512Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6fbcc803-f653-44f7-bbea-90ff3489752f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:30 GMT", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "57d06f06-b01e-007c-5920-54f43d000000", + "Body" : "\n", + "x-ms-client-request-id" : "6fbcc803-f653-44f7-bbea-90ff3489752f", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "9b33b81809b33b8186c9720756109e8b2f24840c7b39", "9b33b81819b33b8186c9788487b78f03f8720464d843", "a4d08463-2bf0-490b-bedd-4b45c733f91a" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[5].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[5].json new file mode 100644 index 0000000000000..9b168572d5927 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[5].json @@ -0,0 +1,185 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "456fedaa-55f9-447e-b32f-68595b8b4a98" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCCFAA79", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "5f107195-301e-0062-7820-5418e5000000", + "x-ms-client-request-id" : "456fedaa-55f9-447e-b32f-68595b8b4a98", + "Date" : "Tue, 19 Apr 2022 19:08:27 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "8aa2f36f-5f47-42b8-b248-e59026f435d3" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD2200AA", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1756202Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "57d06dd1-b01e-007c-5420-54f43d000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "8aa2f36f-5f47-42b8-b248-e59026f435d3", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "bd38adc9-19c7-4fc2-bcf3-a73a057e155e" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD3955CF", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.3295327Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c2b7547a-601e-000d-7320-541216000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "bd38adc9-19c7-4fc2-bcf3-a73a057e155e", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f9e9d09f-e639-4c0c-a685-8c9819c9cf04", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "MnazupoPCdI=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "76e329c8-b01e-006c-4120-543155000000", + "x-ms-client-request-id" : "f9e9d09f-e639-4c0c-a685-8c9819c9cf04" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "4cb14575-9550-4a47-84ee-f6d1ae98c491" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8212521Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8202521Z", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "c2b75503-601e-000d-6a20-541216000000", + "x-ms-client-request-id" : "4cb14575-9550-4a47-84ee-f6d1ae98c491" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a3eea997-490c-4237-8ef6-98fbf00c6e69", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "76e32a3e-b01e-006c-1f20-543155000000", + "x-ms-client-request-id" : "a3eea997-490c-4237-8ef6-98fbf00c6e69", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9?comp=lease", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6b4ad1e4-d42f-4c00-818a-cbbdee95bf68" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-lease-id" : "0e5fdd75-f182-43d2-acf7-39242445390f", + "eTag" : "0x8DA2237FD6F5203", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a160d66a-b01e-0053-7d20-54f9f6000000", + "x-ms-client-request-id" : "6b4ad1e4-d42f-4c00-818a-cbbdee95bf68", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/822889590822889591e708747a3ec3ee153404003b28/822889591822889591e7838676e06aa8e752648fc8c9?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8202521Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "07cc8fce-ca03-44fa-8a70-3a538ca4770e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:30 GMT", + "eTag" : "0x8DA2237FD6F5203", + "x-ms-request-id" : "a160d6a0-b01e-0053-2a20-54f9f6000000", + "Body" : "\n", + "x-ms-client-request-id" : "07cc8fce-ca03-44fa-8a70-3a538ca4770e", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "822889590822889591e708747a3ec3ee153404003b28", "822889591822889591e7838676e06aa8e752648fc8c9", "ae86de46-10da-4c75-8534-54039ed27273" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[6].json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[6].json new file mode 100644 index 0000000000000..c710c552bf8e1 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffAC[6].json @@ -0,0 +1,163 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7cb9b408-2f25-43c2-b23e-d81eb979faa4" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FCD1827A", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:28 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a160d4f8-b01e-0053-4b20-54f9f6000000", + "x-ms-client-request-id" : "7cb9b408-2f25-43c2-b23e-d81eb979faa4", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5064553c-05bd-4310-bc2d-52c439ebab54" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD21166E", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.1706227Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1916caa2-601e-008b-1b20-54deaf000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "5064553c-05bd-4310-bc2d-52c439ebab54", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "64601afb-41e9-4b83-8f12-d7926ddaa0f1" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2237FD67B200", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.6333584Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "1916cb62-601e-008b-4620-54deaf000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "64601afb-41e9-4b83-8f12-d7926ddaa0f1", + "Date" : "Tue, 19 Apr 2022 19:08:28 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6d55d9ca-9028-44a2-9c96-ac9900331f8b", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "IpTdLzOKxX4=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "eTag" : "0x8DA2237FD79149D", + "x-ms-request-id" : "1916cb8e-601e-008b-6f20-54deaf000000", + "x-ms-client-request-id" : "6d55d9ca-9028-44a2-9c96-ac9900331f8b" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "aaa29d09-e744-4d13-97ae-d341aa4b4352" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-version-id" : "2022-04-19T19:08:29.8572319Z", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "false", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT", + "x-ms-snapshot" : "2022-04-19T19:08:29.8562319Z", + "eTag" : "0x8DA2237FD79149D", + "x-ms-request-id" : "1916cbad-601e-008b-0920-54deaf000000", + "x-ms-client-request-id" : "aaa29d09-e744-4d13-97ae-d341aa4b4352" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817?comp=tags", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f957b0dd-a245-408e-9699-fd4c6d387f6d", + "Content-Type" : "application/xml" + }, + "Response" : { + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "retry-after" : "0", + "StatusCode" : "204", + "x-ms-request-id" : "1399f3f9-d01e-006a-5020-5402ea000000", + "x-ms-client-request-id" : "f957b0dd-a245-408e-9699-fd4c6d387f6d", + "Date" : "Tue, 19 Apr 2022 19:08:29 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/a905da9a0a905da9a53a382156c7c67fbec064e13911/a905da9a1a905da9a53a097375ed238ebf055435e817?comp=pagelist&prevsnapshot=2022-04-19T19%3A08%3A29.8562319Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c891d8d2-a42c-4d55-ac1d-ab990689be9e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 19:08:29 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 19:08:30 GMT", + "eTag" : "0x8DA2237FD79149D", + "x-ms-request-id" : "1916cc6b-601e-008b-2b20-54deaf000000", + "Body" : "\n", + "x-ms-client-request-id" : "c891d8d2-a42c-4d55-ac1d-ab990689be9e", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "a905da9a0a905da9a53a382156c7c67fbec064e13911", "a905da9a1a905da9a53a097375ed238ebf055435e817", "c7a19db5-c580-441c-9a71-11a74bb60c06" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffPageSize.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffPageSize.json new file mode 100644 index 0000000000000..e51b71fe2ce76 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesDiffPageSize.json @@ -0,0 +1,307 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f019c576-641c-422a-b770-8c1de8fc570b" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8C6455B", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "317fd930-801e-0036-7c1e-549f88000000", + "x-ms-client-request-id" : "f019c576-641c-422a-b770-8c1de8fc570b", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7c8cd7df-d2dd-497f-b9bc-a5751c5a0dd2" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8D8029F", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e1c079af-b01e-003d-621e-5464e3000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "7c8cd7df-d2dd-497f-b9bc-a5751c5a0dd2", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5981b457-299f-4b68-aa7b-050734990b91" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8E483E7", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "38f39ac3-c01e-0045-781e-54c71b000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "5981b457-299f-4b68-aa7b-050734990b91", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "82265123-fc89-49f7-bd0a-8ff1a225d79e", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "5HbEidZoE/o=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8F375DE", + "x-ms-request-id" : "566070be-501e-000a-101e-54b64f000000", + "x-ms-client-request-id" : "82265123-fc89-49f7-bd0a-8ff1a225d79e" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "7db8b8fb-0314-4072-8023-3eb4941548e9" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "x-ms-snapshot" : "2022-04-19T18:51:49.0444724Z", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8F375DE", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bc5787ff-701e-0050-5d1e-54d0a8000000", + "x-ms-request-server-encrypted" : "false", + "x-ms-client-request-id" : "7db8b8fb-0314-4072-8023-3eb4941548e9", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "967ca417-4152-4638-bfa1-d6b9962406bd", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "kJndXV9eB1I=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A919BCEF", + "x-ms-request-id" : "bc578835-701e-0050-0f1e-54d0a8000000", + "x-ms-client-request-id" : "967ca417-4152-4638-bfa1-d6b9962406bd" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c32048d6-ae11-4de2-8ecb-edfd030d08e2" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A92EC883", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bc578854-701e-0050-2a1e-54d0a8000000", + "x-ms-client-request-id" : "c32048d6-ae11-4de2-8ecb-edfd030d08e2", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "014bc7bb-d9db-4887-87dc-50e42afaf46d", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "kJndXV9eB1I=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A9472EE6", + "x-ms-request-id" : "bc76e1cc-e01e-0042-7f1e-54ab78000000", + "x-ms-client-request-id" : "014bc7bb-d9db-4887-87dc-50e42afaf46d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "464678a2-a307-4753-abfc-248f1a3eb91f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A954C177", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e1c07a57-b01e-003d-781e-5464e3000000", + "x-ms-client-request-id" : "464678a2-a307-4753-abfc-248f1a3eb91f", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.0444724Z&maxresults=2", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6e8b586d-1ee2-4598-a6aa-950712a63e5b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A954C177", + "x-ms-request-id" : "11d0de8d-701e-007f-681e-54dd63000000", + "Body" : "\n01023102420472!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "6e8b586d-1ee2-4598-a6aa-950712a63e5b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.0444724Z&marker=2%2116%21MDAwMDA0ITIwNDgh&maxresults=2", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "10c2588b-71e8-4abf-b7a7-73c47a10965b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A954C177", + "x-ms-request-id" : "6b6e20dc-c01e-0037-0f1e-54c054000000", + "Body" : "\n2048307130724095", + "x-ms-client-request-id" : "10c2588b-71e8-4abf-b7a7-73c47a10965b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.0444724Z&maxresults=2", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "c7166bff-b4a3-4001-88c3-83eec0e4c24f" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A954C177", + "x-ms-request-id" : "6b6e20e5-c01e-0037-161e-54c054000000", + "Body" : "\n01023102420472!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "c7166bff-b4a3-4001-88c3-83eec0e4c24f", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80/af91d57d1af91d57d97d45186007a7545fc4749e0a50?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.0444724Z&marker=2%2116%21MDAwMDA0ITIwNDgh&maxresults=2", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "d67bfac5-47cd-4428-be49-cd43821010d8" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:50 GMT", + "eTag" : "0x8DA2235A954C177", + "x-ms-request-id" : "6b6e20f8-c01e-0037-251e-54c054000000", + "Body" : "\n2048307130724095", + "x-ms-client-request-id" : "d67bfac5-47cd-4428-be49-cd43821010d8", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "af91d57d0af91d57d97d37086ba3cc2a17bef47e8b80", "af91d57d1af91d57d97d45186007a7545fc4749e0a50", "53df858f-c108-4b4a-aba7-d202e74bc9e3", "894003b9-aa6b-4f12-92cd-776cf89847c3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesPageSize.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesPageSize.json new file mode 100644 index 0000000000000..394c8ad13b3c7 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPageRangesPageSize.json @@ -0,0 +1,234 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5f649d6a-95bd-46da-b651-49d3caf0f19e" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A895628B", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "c6238374-701e-0022-2f1e-54d7e7000000", + "x-ms-client-request-id" : "5f649d6a-95bd-46da-b651-49d3caf0f19e", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "f202079c-bab4-43eb-b571-b2435b3d619f" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8A4EC32", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "f8c47973-401e-0006-671e-542147000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "f202079c-bab4-43eb-b571-b2435b3d619f", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a438b66f-ff9f-47e8-9e23-f3a86138dc09" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8B0F855", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "af756814-e01e-0030-4d1e-54ac37000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "a438b66f-ff9f-47e8-9e23-f3a86138dc09", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "1d6921f7-27ba-48b5-a8c8-83b0c423f359", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "ZUKWn7q47E8=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT", + "eTag" : "0x8DA2235A8BF7523", + "x-ms-request-id" : "6549daf5-301e-006e-521e-5447d7000000", + "x-ms-client-request-id" : "1d6921f7-27ba-48b5-a8c8-83b0c423f359" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3e940179-b0c4-47c0-a352-33a37d13085d" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8D6071F", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bc76e145-e01e-0042-0d1e-54ab78000000", + "x-ms-client-request-id" : "3e940179-b0c4-47c0-a352-33a37d13085d", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6b715f9d-a5c2-4f26-9a82-703fa525171a" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8E483E7", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e13c8156-601e-0063-621e-548f03000000", + "x-ms-client-request-id" : "6b715f9d-a5c2-4f26-9a82-703fa525171a", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=pagelist&maxresults=1", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "0ce2a091-eab5-4918-8fad-f536add9362b" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8E483E7", + "x-ms-request-id" : "bc76e171-e01e-0042-301e-54ab78000000", + "Body" : "\n010232!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "0ce2a091-eab5-4918-8fad-f536add9362b", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=pagelist&marker=2%2116%21MDAwMDA0ITIwNDgh&maxresults=1", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b14ffdf8-932a-4a99-9a15-f0d6b21e85c1" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A8E483E7", + "x-ms-request-id" : "6b6e20a5-c01e-0037-621e-54c054000000", + "Body" : "\n20483071", + "x-ms-client-request-id" : "b14ffdf8-932a-4a99-9a15-f0d6b21e85c1", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=pagelist&maxresults=1", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "01a1745c-d044-496f-89c8-c6a3a38205a3" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8E483E7", + "x-ms-request-id" : "11d0de17-701e-007f-7e1e-54dd63000000", + "Body" : "\n010232!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "01a1745c-d044-496f-89c8-c6a3a38205a3", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/40cb28db040cb28db68090134757fbbd6b37e416e942/40cb28db140cb28db680286548aa80169fe92492fb8a?comp=pagelist&marker=2%2116%21MDAwMDA0ITIwNDgh&maxresults=1", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6be9914b-d266-44f4-a187-45ae8540dd11" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A8E483E7", + "x-ms-request-id" : "c62383fb-701e-0022-1f1e-54d7e7000000", + "Body" : "\n20483071", + "x-ms-client-request-id" : "6be9914b-d266-44f4-a187-45ae8540dd11", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "40cb28db040cb28db68090134757fbbd6b37e416e942", "40cb28db140cb28db680286548aa80169fe92492fb8a", "54dc6c24-1bb4-4167-a347-44ae82e1eeb3" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesContinuationToken.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesContinuationToken.json new file mode 100644 index 0000000000000..63448756770dc --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesContinuationToken.json @@ -0,0 +1,186 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "ca516e37-9ff2-4383-9709-d7d3afb63cc2" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A89688DB", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "bc76e0fd-e01e-0042-4d1e-54ab78000000", + "x-ms-client-request-id" : "ca516e37-9ff2-4383-9709-d7d3afb63cc2", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "70ebe1b9-f960-43f8-a95d-97185b509952" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8A6C0A1", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "a2fd9df4-701e-0032-301e-54128f000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "70ebe1b9-f960-43f8-a95d-97185b509952", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "49ed3041-6f55-42a7-b674-8fce8f359017" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8B7D531", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6b6e206e-c01e-0037-3b1e-54c054000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "49ed3041-6f55-42a7-b674-8fce8f359017", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "66739db8-81b2-4019-a514-356d748542ec", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "fb3N3bNzkjo=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8C82682", + "x-ms-request-id" : "a3b88e9b-e01e-001f-371e-54a1fc000000", + "x-ms-client-request-id" : "66739db8-81b2-4019-a514-356d748542ec" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "333e17d2-f128-44b6-aab2-ecc63779e3c1" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8E7DECA", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "012ae0d8-f01e-005e-521e-54f918000000", + "x-ms-client-request-id" : "333e17d2-f128-44b6-aab2-ecc63779e3c1", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a6317f02-2af7-43d4-b3d2-61cc9d7877c5" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A908CF84", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "455cfb23-901e-0067-7a1e-540204000000", + "x-ms-client-request-id" : "a6317f02-2af7-43d4-b3d2-61cc9d7877c5", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e?comp=pagelist&maxresults=1", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3888210e-b5f1-4783-9211-c6c5d6839729" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A908CF84", + "x-ms-request-id" : "566070e1-501e-000a-2f1e-54b64f000000", + "Body" : "\n010232!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "3888210e-b5f1-4783-9211-c6c5d6839729", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/eee741060eee74106bb021714d0c9138562d74cd193a/eee741061eee74106bb0710964833870bbaee480388e?comp=pagelist&marker=2%2116%21MDAwMDA0ITIwNDgh", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "175a57c9-4fdf-497e-a4c5-58ba49ea4226" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A908CF84", + "x-ms-request-id" : "38f39b09-c01e-0045-361e-54c71b000000", + "Body" : "\n20483071", + "x-ms-client-request-id" : "175a57c9-4fdf-497e-a4c5-58ba49ea4226", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "eee741060eee74106bb021714d0c9138562d74cd193a", "eee741061eee74106bb0710964833870bbaee480388e", "55af99be-9eb2-4909-ace8-4089a5ff3923" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffContinuationToken.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffContinuationToken.json new file mode 100644 index 0000000000000..567d4bbe68831 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffContinuationToken.json @@ -0,0 +1,259 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "027e5e7d-1fd2-44e9-9520-33349dd20085" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8D8152E", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "87d9a4aa-d01e-0066-4f1e-545dd8000000", + "x-ms-client-request-id" : "027e5e7d-1fd2-44e9-9520-33349dd20085", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "064ce95d-4710-45e6-b6aa-acad99e630bf" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8E769B5", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "177fdbca-401e-0080-291e-54edfe000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "064ce95d-4710-45e6-b6aa-acad99e630bf", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "eaec15b8-ae2d-4011-895b-abca9dd30caf" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8F65B9F", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e13c816a-601e-0063-721e-548f03000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "eaec15b8-ae2d-4011-895b-abca9dd30caf", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "e002b9a8-b5a1-4e8d-bff4-006768235c5d", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "35SW8VVZK6M=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A916B027", + "x-ms-request-id" : "af756867-e01e-0030-161e-54ac37000000", + "x-ms-client-request-id" : "e002b9a8-b5a1-4e8d-bff4-006768235c5d" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "b7b702c8-aa68-4d2a-98ef-eb67ff2da339" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "x-ms-snapshot" : "2022-04-19T18:51:49.3782825Z", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A916B027", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "6549db62-301e-006e-311e-5447d7000000", + "x-ms-request-server-encrypted" : "false", + "x-ms-client-request-id" : "b7b702c8-aa68-4d2a-98ef-eb67ff2da339", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "403fff0a-8ab0-472b-86ad-63c63c52e653", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "ABhZYLqUqUw=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A94C5E46", + "x-ms-request-id" : "f8c47add-401e-0006-291e-542147000000", + "x-ms-client-request-id" : "403fff0a-8ab0-472b-86ad-63c63c52e653" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "fc933c93-6f7b-4bac-8c6f-9e7cd9b132dc" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A962F037", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80a44e2f-b01e-0070-271e-54ab0f000000", + "x-ms-client-request-id" : "fc933c93-6f7b-4bac-8c6f-9e7cd9b132dc", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "dc6d42b0-f67e-442f-b373-e9e8d8b2c9c7", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "ABhZYLqUqUw=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A976C370", + "x-ms-request-id" : "b2a0ac82-001e-0038-671e-54b638000000", + "x-ms-client-request-id" : "dc6d42b0-f67e-442f-b373-e9e8d8b2c9c7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "13e2e080-16bb-492d-aa94-c9ca72e41731" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A990893E", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "b2a0aca4-001e-0038-031e-54b638000000", + "x-ms-client-request-id" : "13e2e080-16bb-492d-aa94-c9ca72e41731", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.3782825Z&maxresults=2", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "59c3c02b-0ac2-4aef-b4e6-2898a625b9c2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A990893E", + "x-ms-request-id" : "b2a0acaf-001e-0038-0d1e-54b638000000", + "Body" : "\n01023102420472!16!MDAwMDA0ITIwNDgh", + "x-ms-client-request-id" : "59c3c02b-0ac2-4aef-b4e6-2898a625b9c2", + "Content-Type" : "application/xml" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/b8a9ec610b8a9ec616e912961ec63c72193c349418a4/b8a9ec611b8a9ec616e94540725e9677ade704250bd7?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.3782825Z&marker=2%2116%21MDAwMDA0ITIwNDgh", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "410a0df9-3705-4af0-b5df-7021b1594e8e" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A990893E", + "x-ms-request-id" : "b2a0accb-001e-0038-271e-54b638000000", + "Body" : "\n2048307130724095", + "x-ms-client-request-id" : "410a0df9-3705-4af0-b5df-7021b1594e8e", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "b8a9ec610b8a9ec616e912961ec63c72193c349418a4", "b8a9ec611b8a9ec616e94540725e9677ade704250bd7", "689fd499-39d9-4195-b98c-55ab29c7f711", "e8e1e929-77cd-4336-872b-979b55ddb896" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffRange.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffRange.json new file mode 100644 index 0000000000000..cc80cfbdb6d79 --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesDiffRange.json @@ -0,0 +1,235 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "a585d6f0-7166-48bb-978d-aa730109f5e0" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8D1C93D", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "913c1640-e01e-007d-2e1e-5463db000000", + "x-ms-client-request-id" : "a585d6f0-7166-48bb-978d-aa730109f5e0", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "adfa5d1b-f7d6-4e4e-bbc2-f523c5530b0c" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8DE6A52", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "455cfb05-901e-0067-601e-540204000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "adfa5d1b-f7d6-4e4e-bbc2-f523c5530b0c", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "4915ce8c-c928-4ffd-af6c-6733cffe57be" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8FC271E", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "00531aa0-601e-0011-1e1e-54884c000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "4915ce8c-c928-4ffd-af6c-6733cffe57be", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "3175bc4c-b318-4d12-8bc7-e06698e9b3a7", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "X69jyDlLlAw=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A917E874", + "x-ms-request-id" : "aba116e1-f01e-0061-401e-5431bb000000", + "x-ms-client-request-id" : "3175bc4c-b318-4d12-8bc7-e06698e9b3a7" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=snapshot", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "994ea107-d7c6-44d8-8ed5-8bac55706280" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "x-ms-snapshot" : "2022-04-19T18:51:49.2773404Z", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A917E874", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e1c07a24-b01e-003d-4e1e-5464e3000000", + "x-ms-request-server-encrypted" : "false", + "x-ms-client-request-id" : "994ea107-d7c6-44d8-8ed5-8bac55706280", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "aa452650-891d-4a4a-a647-3c8f86aab074", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "FtnWgDqt+WA=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A93F8EEA", + "x-ms-request-id" : "aba11722-f01e-0061-781e-5431bb000000", + "x-ms-client-request-id" : "aa452650-891d-4a4a-a647-3c8f86aab074" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "90b30c96-4f79-4324-a912-44b928148aec" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A94E59C8", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "e13c81ce-601e-0063-4d1e-548f03000000", + "x-ms-client-request-id" : "90b30c96-4f79-4324-a912-44b928148aec", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "873eb0f1-dc9c-4b71-987a-a6402846539e", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "FtnWgDqt+WA=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A963B36E", + "x-ms-request-id" : "e13c81f2-601e-0063-671e-548f03000000", + "x-ms-client-request-id" : "873eb0f1-dc9c-4b71-987a-a6402846539e" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "40af2fe1-798d-4031-b887-975eb8c87db6" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A9758B22", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80a44e38-b01e-0070-2f1e-54ab0f000000", + "x-ms-client-request-id" : "40af2fe1-798d-4031-b887-975eb8c87db6", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/25b8c60a025b8c60a46d577411dff19abccd24eb0acc/25b8c60a125b8c60a46d717431e0b84a508984726a4f?comp=pagelist&prevsnapshot=2022-04-19T18%3A51%3A49.2773404Z", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5968039c-c119-46f6-8706-429bbdc0bbc2" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:49 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:49 GMT", + "eTag" : "0x8DA2235A9758B22", + "x-ms-request-id" : "80a44e48-b01e-0070-391e-54ab0f000000", + "Body" : "\n2048307130724095", + "x-ms-client-request-id" : "5968039c-c119-46f6-8706-429bbdc0bbc2", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "25b8c60a025b8c60a46d577411dff19abccd24eb0acc", "25b8c60a125b8c60a46d717431e0b84a508984726a4f", "2cb82339-bfb6-4074-9353-5014b8188e2b", "e7ebc5e9-0bf8-4051-8534-17b753d83b17" ] +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesRange.json b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesRange.json new file mode 100644 index 0000000000000..8408857315e9f --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/test/resources/session-records/PageBlobAPITestListPagesRange.json @@ -0,0 +1,162 @@ +{ + "networkCallRecords" : [ { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a?restype=container", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "57aa7510-51c6-4bd8-8ea9-75fc280cf2fa" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A89687B5", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "80a44da0-b01e-0070-291e-54ab0f000000", + "x-ms-client-request-id" : "57aa7510-51c6-4bd8-8ea9-75fc280cf2fa", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "395bd933-9c57-4976-9f3e-75b6eb948907" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8A783DB", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "38f39a78-c01e-0045-331e-54c71b000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "395bd933-9c57-4976-9f3e-75b6eb948907", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "5cb1555b-f092-4d04-b4d7-8fee3a6f2d0c" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "eTag" : "0x8DA2235A8B1947F", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "38f39a80-c01e-0045-3b1e-54c71b000000", + "x-ms-request-server-encrypted" : "true", + "x-ms-client-request-id" : "5cb1555b-f092-4d04-b4d7-8fee3a6f2d0c", + "Date" : "Tue, 19 Apr 2022 18:51:47 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "6582e268-1845-421a-93a1-470fe1731b6f", + "Content-Type" : "application/octet-stream" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-content-crc64" : "e6CT6+IMzL0=", + "x-ms-blob-sequence-number" : "0", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-server-encrypted" : "true", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8C7FF75", + "x-ms-request-id" : "16b6895a-601e-003e-391e-548587000000", + "x-ms-client-request-id" : "6582e268-1845-421a-93a1-470fe1731b6f" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "39e214d4-c2a1-422c-a036-9bc9b64178af" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8DB367A", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "7877e4ef-801e-0044-091e-5498c7000000", + "x-ms-client-request-id" : "39e214d4-c2a1-422c-a036-9bc9b64178af", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "PUT", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a?comp=page", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "dfb8d471-9639-4870-95f4-14794ffff6fb" + }, + "Response" : { + "content-length" : "0", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-sequence-number" : "0", + "eTag" : "0x8DA2235A8EBAED6", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "201", + "x-ms-request-id" : "8a7e4bf7-301e-001c-7a1e-544098000000", + "x-ms-client-request-id" : "dfb8d471-9639-4870-95f4-14794ffff6fb", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "http://REDACTED.blob.core.windows.net/e6d332db0e6d332db405202419ee00bf580234d2e98a/e6d332db1e6d332db4056034401150a79a03f4a19a2a?comp=pagelist", + "Headers" : { + "x-ms-version" : "2021-04-10", + "User-Agent" : "azsdk-java-azure-storage-blob/12.17.0-beta.1 (11.0.13; Windows 10; 10.0)", + "x-ms-client-request-id" : "e2d2030f-719c-4417-a4ca-9e334d1045a0" + }, + "Response" : { + "Transfer-Encoding" : "chunked", + "x-ms-version" : "2021-04-10", + "Server" : "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0", + "x-ms-blob-content-length" : "4096", + "Last-Modified" : "Tue, 19 Apr 2022 18:51:48 GMT", + "retry-after" : "0", + "StatusCode" : "200", + "Date" : "Tue, 19 Apr 2022 18:51:48 GMT", + "eTag" : "0x8DA2235A8EBAED6", + "x-ms-request-id" : "0b2319a0-601e-004c-351e-5482c8000000", + "Body" : "\n20483071", + "x-ms-client-request-id" : "e2d2030f-719c-4417-a4ca-9e334d1045a0", + "Content-Type" : "application/xml" + }, + "Exception" : null + } ], + "variables" : [ "e6d332db0e6d332db405202419ee00bf580234d2e98a", "e6d332db1e6d332db4056034401150a79a03f4a19a2a", "96b6c949-a9ce-400e-8570-70750bd97298" ] +} \ No newline at end of file From 3841f5bb304d4f48ad48bd4073f88b06b1b22d7e Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Fri, 22 Apr 2022 12:27:06 -0700 Subject: [PATCH 15/19] Added samples --- .../blob/specialized/PageBlobAsyncClient.java | 67 ++++++-------- .../blob/specialized/PageBlobClient.java | 91 ++++++++++--------- ...ageBlobAsyncClientJavaDocCodeSnippets.java | 51 +++++++++++ .../PageBlobClientJavaDocCodeSnippets.java | 73 +++++++++++++++ .../common/test/shared/TestEnvironment.java | 14 +-- 5 files changed, 206 insertions(+), 90 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index b366b1501aaca..fe6167e28dad6 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -912,18 +912,15 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ * *

Code Samples

* - * + * *
      * BlobRange blobRange = new BlobRange(offset);
      *
-     * client.getPageRanges(blobRange).subscribe(response -> {
-     *     System.out.println("Valid Page Ranges are:");
-     *     for (PageRange pageRange : response.getPageRange()) {
-     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *     }
-     * });
+     * System.out.println("Valid Page Ranges are:");
+     * client.listPageRanges(blobRange).subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s%n",
+     * rangeItem.getRange().getOffset(), rangeItem.getRange().getLength()));
      * 
- * + * * * @param blobRange {@link BlobRange} * @@ -940,20 +937,16 @@ public PagedFlux listPageRanges(BlobRange blobRange) { * *

Code Samples

* - * + * *
-     * BlobRange blobRange = new BlobRange(offset);
-     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     * ListPageRangesOptions options = new ListPageRangesOptions(new BlobRange(offset))
+     * 	  .setMaxResultsPerPage(1000).setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId));
      *
-     * client.getPageRangesWithResponse(blobRange, blobRequestConditions)
-     *     .subscribe(response -> {
-     *         System.out.println("Valid Page Ranges are:");
-     *         for (PageRange pageRange : response.getValue().getPageRange()) {
-     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *         }
-     *     });
+     * client.listPageRanges(options)
+     * 	  .subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s%n", rangeItem.getRange().getOffset(),
+     * 		  rangeItem.getRange().getLength()));
      * 
- * + * * * @param options {@link ListPageRangesOptions} * @return A reactive response emitting all the page ranges. @@ -1121,19 +1114,17 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang * *

Code Samples

* - * + * *
      * BlobRange blobRange = new BlobRange(offset);
-     * final String prevSnapshot = "previous snapshot";
+     * String prevSnapshot = "previous snapshot";
      *
-     * client.getPageRangesDiff(blobRange, prevSnapshot).subscribe(response -> {
-     *     System.out.println("Valid Page Ranges are:");
-     *     for (PageRange pageRange : response.getPageRange()) {
-     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *     }
-     * });
+     * System.out.println("Valid Page Ranges are:");
+     * client.listPageRangesDiff(blobRange, prevSnapshot).subscribe(rangeItem ->
+     *     System.out.printf("Offset: %s, Length: %s, isClear: %s%n",
+     *     rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear()));
      * 
- * + * * * @param blobRange {@link BlobRange} * @param prevSnapshot Specifies that the response will contain only pages that were changed between target blob and @@ -1154,21 +1145,17 @@ public PagedFlux listPageRangesDiff(BlobRange blobRange, String p * *

Code Samples

* - * + * *
-     * BlobRange blobRange = new BlobRange(offset);
-     * final String prevSnapshot = "previous snapshot";
-     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     * ListPageRangesDiffOptions options = new ListPageRangesDiffOptions(new BlobRange(offset), "previous snapshot")
+     * 	   .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId))
+     * 	   .setMaxResultsPerPage(1000);
      *
-     * client.getPageRangesDiffWithResponse(blobRange, prevSnapshot, blobRequestConditions)
-     *     .subscribe(response -> {
-     *         System.out.println("Valid Page Ranges are:");
-     *         for (PageRange pageRange : response.getValue().getPageRange()) {
-     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *         }
-     *     });
+     * client.listPageRangesDiff(options)
+     * 	   .subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s, isClear: %s%n",
+     * 	       rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear()));
      * 
- * + * * * @param options {@link ListPageRangesDiffOptions}. * @return A reactive response emitting all the different page ranges. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index c2a39b19f1bf4..0dd8467bb70e2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -698,18 +698,17 @@ public Response getPageRangesWithResponse(BlobRange blobRange, BlobReq * *

Code Samples

* - * + * *
      * BlobRange blobRange = new BlobRange(offset);
-     *
-     * client.getPageRanges(blobRange).subscribe(response -> {
-     *     System.out.println("Valid Page Ranges are:");
-     *     for (PageRange pageRange : response.getPageRange()) {
-     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *     }
-     * });
+     * String prevSnapshot = "previous snapshot";
+     * PagedIterable iterable = client.listPageRanges(blobRange);
+     * for (PageRangeItem item : iterable) {
+     *     System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(),
+     *         item.getRange().getLength(), item.isClear());
+     * }
      * 
- * + * * * @param blobRange {@link BlobRange} * @@ -726,22 +725,24 @@ public PagedIterable listPageRanges(BlobRange blobRange) { * *

Code Samples

* - * - *
-     * BlobRange blobRange = new BlobRange(offset);
-     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
-     *
-     * client.getPageRangesWithResponse(blobRange, blobRequestConditions)
-     *     .subscribe(response -> {
-     *         System.out.println("Valid Page Ranges are:");
-     *         for (PageRange pageRange : response.getValue().getPageRange()) {
-     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *         }
-     *     });
+     * 
+     * ListPageRangesOptions options = new ListPageRangesOptions&40;new BlobRange&40;offset&41;&41;
+     *     .setRequestConditions&40;new BlobRequestConditions&40;&41;.setLeaseId&40;leaseId&41;&41;
+     *     .setMaxResultsPerPage&40;1000&41;;
+     * Context context = new Context&40;key, value&41;;
+     * PagedIterable<PageRangeItem> iter = client
+     *     .listPageRanges&40;options, timeout, context&41;;
+     * System.out.println&40;"Valid Page Ranges are:"&41;;
+     * for &40;PageRangeItem item : iter&41; {
+     *     System.out.printf&40;"Offset: %s, Length: %s, isClear: %s%n", item.getRange&40;&41;.getOffset&40;&41;,
+     *         item.getRange&40;&41;.getLength&40;&41;, item.isClear&40;&41;&41;;
+     *  }
      * 
- * + * * * @param options {@link ListPageRangesOptions} + * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. + * @param context Additional context that is passed through the Http pipeline during the service call. * @return A reactive response emitting all the page ranges. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -840,19 +841,18 @@ public Response getPageRangesDiffWithResponse(BlobRange blobRange, Str * *

Code Samples

* - * + * *
      * BlobRange blobRange = new BlobRange(offset);
-     * final String prevSnapshot = "previous snapshot";
+     * String prevSnapshot = "previous snapshot";
+     * PagedIterable<PageRangeItem> iterable = client.listPageRangesDiff(blobRange, prevSnapshot);
      *
-     * client.getPageRangesDiff(blobRange, prevSnapshot).subscribe(response -> {
-     *     System.out.println("Valid Page Ranges are:");
-     *     for (PageRange pageRange : response.getPageRange()) {
-     *         System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *     }
-     * });
+     * for (PageRangeItem item : iterable) {
+     *     System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(),
+     *         item.getRange().getLength(), item.isClear());
+     * }
      * 
- * + * * * @param blobRange {@link BlobRange} * @param prevSnapshot Specifies that the response will contain only pages that were changed between target blob and @@ -873,23 +873,28 @@ public PagedIterable listPageRangesDiff(BlobRange blobRange, Stri * *

Code Samples

* - * + * *
-     * BlobRange blobRange = new BlobRange(offset);
-     * final String prevSnapshot = "previous snapshot";
-     * BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setLeaseId(leaseId);
+     * ListPageRangesDiffOptions options = new ListPageRangesDiffOptions(new BlobRange(offset), "previous snapshot")
+     *     .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId))
+     *     .setMaxResultsPerPage(1000);
+     *
+     * Context context = new Context(key, value);
      *
-     * client.getPageRangesDiffWithResponse(blobRange, prevSnapshot, blobRequestConditions)
-     *     .subscribe(response -> {
-     *         System.out.println("Valid Page Ranges are:");
-     *         for (PageRange pageRange : response.getValue().getPageRange()) {
-     *             System.out.printf("Start: %s, End: %s%n", pageRange.getStart(), pageRange.getEnd());
-     *         }
-     *     });
+     * PagedIterable<PageRangeItem≶ iter = client
+     *     .listPageRangesDiff(options, timeout, context);
+     *
+     * System.out.println("Valid Page Ranges are:");
+     * for (PageRangeItem item : iter) {
+     *     System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(),
+     *         item.getRange().getLength(), item.isClear());
+     * }
      * 
- * + * * * @param options {@link ListPageRangesDiffOptions}. + * @param timeout An optional timeout value beyond which a {@link RuntimeException} will be raised. + * @param context Additional context that is passed through the Http pipeline during the service call. * @return A reactive response emitting all the different page ranges. * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java index 638a21f6295ae..70467d61a77d7 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java @@ -9,6 +9,8 @@ import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.CopyStatusType; +import com.azure.storage.blob.options.ListPageRangesDiffOptions; +import com.azure.storage.blob.options.ListPageRangesOptions; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.models.PageBlobRequestConditions; @@ -262,6 +264,29 @@ public void getPageRangesWithResponseCodeSnippet() { // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.getPageRangesWithResponse#BlobRange-BlobRequestConditions } + /** + * Code snippets for {@link PageBlobAsyncClient#listPageRanges(BlobRange)} and + * {@link PageBlobAsyncClient#listPageRanges(ListPageRangesOptions)} + */ + public void listPageRangesCodeSnippets() { + // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRanges#BlobRange + BlobRange blobRange = new BlobRange(offset); + + System.out.println("Valid Page Ranges are:"); + client.listPageRanges(blobRange).subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s%n", + rangeItem.getRange().getOffset(), rangeItem.getRange().getLength())); + // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRanges#BlobRange + + // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRanges#ListPageRangesOptions + ListPageRangesOptions options = new ListPageRangesOptions(new BlobRange(offset)) + .setMaxResultsPerPage(1000).setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId)); + + client.listPageRanges(options) + .subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s%n", rangeItem.getRange().getOffset(), + rangeItem.getRange().getLength())); + // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRanges#ListPageRangesOptions + } + /** * Code snippets for {@link PageBlobAsyncClient#getPageRangesDiff(BlobRange, String)} */ @@ -299,6 +324,32 @@ public void getPageRangesDiffWithResponseCodeSnippet() { // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.getPageRangesDiffWithResponse#BlobRange-String-BlobRequestConditions } + /** + * Code snippets for {@link PageBlobAsyncClient#listPageRangesDiff(BlobRange, String)} and + * {@link PageBlobAsyncClient#listPageRangesDiff(ListPageRangesDiffOptions)} + */ + public void listPageRangesDiffCodeSnippets() { + // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String + BlobRange blobRange = new BlobRange(offset); + String prevSnapshot = "previous snapshot"; + + System.out.println("Valid Page Ranges are:"); + client.listPageRangesDiff(blobRange, prevSnapshot).subscribe(rangeItem -> + System.out.printf("Offset: %s, Length: %s, isClear: %s%n", + rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear())); + // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String + + // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String-BlobRequestConditions + ListPageRangesDiffOptions options = new ListPageRangesDiffOptions(new BlobRange(offset), "previous snapshot") + .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId)) + .setMaxResultsPerPage(1000); + + client.listPageRangesDiff(options) + .subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s, isClear: %s%n", + rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear())); + // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String-BlobRequestConditions + } + /** * Code snippets for {@link PageBlobAsyncClient#getManagedDiskPageRangesDiff(BlobRange, String)} */ diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java index 59726a2001456..0d7819bb6966a 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java @@ -4,13 +4,18 @@ package com.azure.storage.blob.specialized; import com.azure.core.http.RequestConditions; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.CopyStatusType; +import com.azure.storage.blob.models.PageRangeItem; +import com.azure.storage.blob.options.ListPageRangesDiffOptions; +import com.azure.storage.blob.options.ListPageRangesOptions; import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.models.PageBlobItem; @@ -283,6 +288,40 @@ public void getPageRangesWithResponseCodeSnippet() { // END: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesWithResponse#BlobRange-BlobRequestConditions-Duration-Context } + /** + * Code snippets for {@link PageBlobClient#listPageRanges(ListPageRangesOptions, Duration, Context)} and + * {@link PageBlobClient#listPageRanges(BlobRange)}. + */ + public void listPageRangesCodeSnippets() { + // BEGIN: com.azure.storage.blob.specialized.PageBlobClient.listPageRanges#BlobRange + BlobRange blobRange = new BlobRange(offset); + String prevSnapshot = "previous snapshot"; + PagedIterable iterable = client.listPageRanges(blobRange); + + for (PageRangeItem item : iterable) { + System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(), + item.getRange().getLength(), item.isClear()); + } + // END: com.azure.storage.blob.specialized.PageBlobClient.listPageRanges#BlobRange + + // BEGIN: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesWithResponse#ListPageRangesOptions-Duration-Context + ListPageRangesOptions options = new ListPageRangesOptions(new BlobRange(offset)) + .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId)) + .setMaxResultsPerPage(1000); + + Context context = new Context(key, value); + + PagedIterable iter = client + .listPageRanges(options, timeout, context); + + System.out.println("Valid Page Ranges are:"); + for (PageRangeItem item : iter) { + System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(), + item.getRange().getLength(), item.isClear()); + } + // END: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesWithResponse#ListPageRangesOptions-Duration-Context + } + /** * Code snippets for {@link PageBlobClient#getPageRangesDiff(BlobRange, String)} */ @@ -320,6 +359,40 @@ public void getPageRangesDiffWithResponseCodeSnippet() { // END: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesDiffWithResponse#BlobRange-String-BlobRequestConditions-Duration-Context } + /** + * Code snippets for {@link PageBlobClient#listPageRangesDiff(ListPageRangesDiffOptions, Duration, Context)} and + * {@link PageBlobClient#listPageRangesDiff(BlobRange, String)} + */ + public void listPageRangesDiffCodeSnippets() { + // BEGIN: com.azure.storage.blob.specialized.PageBlobClient.listPageRangesDiff#BlobRange-String + BlobRange blobRange = new BlobRange(offset); + String prevSnapshot = "previous snapshot"; + PagedIterable iterable = client.listPageRangesDiff(blobRange, prevSnapshot); + + for (PageRangeItem item : iterable) { + System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(), + item.getRange().getLength(), item.isClear()); + } + // END: com.azure.storage.blob.specialized.PageBlobClient.listPageRangesDiff#BlobRange-String + + // BEGIN: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesDiffWithResponse#ListPageRangesDiffOptions-Duration-Context + ListPageRangesDiffOptions options = new ListPageRangesDiffOptions(new BlobRange(offset), "previous snapshot") + .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId)) + .setMaxResultsPerPage(1000); + + Context context = new Context(key, value); + + PagedIterable iter = client + .listPageRangesDiff(options, timeout, context); + + System.out.println("Valid Page Ranges are:"); + for (PageRangeItem item : iter) { + System.out.printf("Offset: %s, Length: %s, isClear: %s%n", item.getRange().getOffset(), + item.getRange().getLength(), item.isClear()); + } + // END: com.azure.storage.blob.specialized.PageBlobClient.getPageRangesDiffWithResponse#ListPageRangesDiffOptions-Duration-Context + } + /** * Code snippets for {@link PageBlobClient#getManagedDiskPageRangesDiff(BlobRange, String)} */ diff --git a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java index 8d071d3814cef..d63619a4533e8 100644 --- a/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java +++ b/sdk/storage/azure-storage-common/src/test-shared/java/com/azure/storage/common/test/shared/TestEnvironment.java @@ -88,22 +88,22 @@ private String readServiceVersionFromEnvironment() { private static TestAccount readTestAccountFromEnvironment(String prefix, TestMode testMode) { String name = "azstoragesdkaccount"; String key = "astorageaccountkey"; - String connectionString = "DefaultEndpointsProtocol=http;AccountName=teststorage;" + String connectionString = "DefaultEndpointsProtocol=https;AccountName=teststorage;" + "AccountKey=atestaccountkey;EndpointSuffix=core.windows.net"; if (testMode != TestMode.PLAYBACK) { name = Configuration.getGlobalConfiguration().get(prefix + "ACCOUNT_NAME"); key = Configuration.getGlobalConfiguration().get(prefix + "ACCOUNT_KEY"); connectionString = Configuration.getGlobalConfiguration().get(prefix + "CONNECTION_STRING"); if (connectionString == null || connectionString.trim().isEmpty()) { - connectionString = String.format("DefaultEndpointsProtocol=http;AccountName=%s;" + connectionString = String.format("DefaultEndpointsProtocol=https;AccountName=%s;" + "AccountKey=%s;EndpointSuffix=core.windows.net", name, key); } } - String blobEndpoint = String.format("http://%s.blob.core.windows.net", name); - String blobEndpointSecondary = String.format("http://%s-secondary.blob.core.windows.net", name); - String dataLakeEndpoint = String.format("http://%s.dfs.core.windows.net", name); - String queueEndpoint = String.format("http://%s.queue.core.windows.net", name); - String fileEndpoint = String.format("http://%s.file.core.windows.net", name); + String blobEndpoint = String.format("https://%s.blob.core.windows.net", name); + String blobEndpointSecondary = String.format("https://%s-secondary.blob.core.windows.net", name); + String dataLakeEndpoint = String.format("https://%s.dfs.core.windows.net", name); + String queueEndpoint = String.format("https://%s.queue.core.windows.net", name); + String fileEndpoint = String.format("https://%s.file.core.windows.net", name); return new TestAccount(name, key, connectionString, blobEndpoint, blobEndpointSecondary, dataLakeEndpoint, queueEndpoint, fileEndpoint); From d449e5cba8f5a92ecdd3a5e9e74646a9b53134be Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Mon, 25 Apr 2022 14:14:55 -0700 Subject: [PATCH 16/19] ci fix --- .../specialized/PageBlobAsyncClientJavaDocCodeSnippets.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java index 70467d61a77d7..ab7b031ef711e 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobAsyncClientJavaDocCodeSnippets.java @@ -339,7 +339,7 @@ public void listPageRangesDiffCodeSnippets() { rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear())); // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String - // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String-BlobRequestConditions + // BEGIN: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#ListPageRangesDiffOptions ListPageRangesDiffOptions options = new ListPageRangesDiffOptions(new BlobRange(offset), "previous snapshot") .setRequestConditions(new BlobRequestConditions().setLeaseId(leaseId)) .setMaxResultsPerPage(1000); @@ -347,7 +347,7 @@ public void listPageRangesDiffCodeSnippets() { client.listPageRangesDiff(options) .subscribe(rangeItem -> System.out.printf("Offset: %s, Length: %s, isClear: %s%n", rangeItem.getRange().getOffset(), rangeItem.getRange().getLength(), rangeItem.isClear())); - // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#BlobRange-String-BlobRequestConditions + // END: com.azure.storage.blob.specialized.PageBlobAsyncClient.listPageRangesDiff#ListPageRangesDiffOptions } /** From 20b07aeb4bfd2c6229d4044da3a2be2153c71a01 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Mon, 25 Apr 2022 16:28:35 -0700 Subject: [PATCH 17/19] imports fixes --- .../azure/storage/blob/options/ListPageRangesOptions.java | 1 - .../storage/blob/specialized/PageBlobAsyncClient.java | 8 ++++---- .../azure/storage/blob/specialized/PageBlobClient.java | 5 ----- .../specialized/PageBlobClientJavaDocCodeSnippets.java | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java index 1c6d4fc9eef60..c22b354e7a594 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/options/ListPageRangesOptions.java @@ -5,7 +5,6 @@ import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; -import java.time.Duration; import java.util.Objects; /** diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index fe6167e28dad6..95434f2c51802 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -926,7 +926,7 @@ Mono> getPageRangesWithResponse(BlobRange blobRange, BlobRequ * * @return A reactive response containing the information of the cleared pages. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPageRanges(BlobRange blobRange) { return listPageRanges(new ListPageRangesOptions(blobRange)); } @@ -951,7 +951,7 @@ public PagedFlux listPageRanges(BlobRange blobRange) { * @param options {@link ListPageRangesOptions} * @return A reactive response emitting all the page ranges. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPageRanges(ListPageRangesOptions options) { return new PagedFlux<>( pageSize -> withContext(context -> @@ -1133,7 +1133,7 @@ public Mono> getPageRangesDiffWithResponse(BlobRange blobRang * * @return A reactive response emitting all the different page ranges. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPageRangesDiff(BlobRange blobRange, String prevSnapshot) { return listPageRangesDiff(new ListPageRangesDiffOptions(blobRange, prevSnapshot)); } @@ -1162,7 +1162,7 @@ public PagedFlux listPageRangesDiff(BlobRange blobRange, String p * * @throws IllegalArgumentException If {@code prevSnapshot} is {@code null} */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listPageRangesDiff(ListPageRangesDiffOptions options) { return new PagedFlux<>( pageSize -> withContext(context -> diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java index 0dd8467bb70e2..33b261cad9769 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobClient.java @@ -18,7 +18,6 @@ import com.azure.storage.blob.models.BlobRange; import com.azure.storage.blob.models.BlobRequestConditions; import com.azure.storage.blob.models.BlobStorageException; -import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.CopyStatusType; import com.azure.storage.blob.models.CustomerProvidedKey; import com.azure.storage.blob.models.PageRangeItem; @@ -31,8 +30,6 @@ import com.azure.storage.blob.models.SequenceNumberActionType; import com.azure.storage.blob.options.ListPageRangesDiffOptions; import com.azure.storage.blob.options.ListPageRangesOptions; -import com.azure.storage.blob.options.PageBlobCopyIncrementalOptions; -import com.azure.storage.blob.options.PageBlobCreateOptions; import com.azure.storage.blob.options.PageBlobUploadPagesFromUrlOptions; import com.azure.storage.common.Utility; import com.azure.storage.common.implementation.Constants; @@ -48,8 +45,6 @@ import java.util.Map; import java.util.Objects; -import static com.azure.core.util.FluxUtil.withContext; - /** * Client to a page blob. It may only be instantiated through a {@link SpecializedBlobClientBuilder} or via the method * {@link BlobClient#getPageBlobClient()}. This class does not hold any state about a particular blob, but is instead a diff --git a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java index 0d7819bb6966a..33e1cb664ffd5 100644 --- a/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java +++ b/sdk/storage/azure-storage-blob/src/samples/java/com/azure/storage/blob/specialized/PageBlobClientJavaDocCodeSnippets.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.storage.blob.models.ClearRange; import com.azure.storage.blob.models.PageBlobCopyIncrementalRequestConditions; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobRange; From 30839b050d61bb4a39bfc12572ae377072f7d42c Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Thu, 28 Apr 2022 11:22:48 -0700 Subject: [PATCH 18/19] Added PageListHelper --- .../AzureBlobStorageImplBuilder.java | 179 +++++++++--------- .../implementation/models/BlobDeleteType.java | 6 +- .../models/BlobExpiryOptions.java | 6 +- .../models/BlobsGetTagsResponse.java | 6 +- .../BlockBlobsGetBlockListResponse.java | 6 +- .../models/ContainersFilterBlobsResponse.java | 6 +- .../ContainersGetAccessPolicyResponse.java | 6 +- ...ContainersListBlobFlatSegmentResponse.java | 6 +- ...inersListBlobHierarchySegmentResponse.java | 6 +- .../PageBlobsGetPageRangesDiffResponse.java | 6 +- .../PageBlobsGetPageRangesResponse.java | 6 +- .../implementation/models/PageListHelper.java | 27 +++ .../models/PremiumPageBlobAccessTier.java | 6 +- .../implementation/models/QueryFormat.java | 6 +- .../models/ServicesFilterBlobsResponse.java | 6 +- .../models/ServicesGetPropertiesResponse.java | 6 +- .../models/ServicesGetStatisticsResponse.java | 6 +- .../ServicesGetUserDelegationKeyResponse.java | 6 +- ...ListBlobContainersSegmentNextResponse.java | 6 +- ...icesListBlobContainersSegmentResponse.java | 6 +- .../azure/storage/blob/models/AccessTier.java | 6 +- .../storage/blob/models/ArchiveStatus.java | 6 +- .../storage/blob/models/BlobErrorCode.java | 11 +- .../blob/models/GeoReplicationStatus.java | 6 +- .../azure/storage/blob/models/PageList.java | 19 +- .../blob/models/PageListDeserializer.java | 4 +- .../storage/blob/models/PublicAccessType.java | 6 +- .../blob/models/RehydratePriority.java | 6 +- .../blob/specialized/PageBlobAsyncClient.java | 5 +- .../main/java/BlobStorageCustomization.java | 32 ++++ 30 files changed, 289 insertions(+), 126 deletions(-) create mode 100644 sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListHelper.java diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java index 60b54270333b7..155b4e6815800 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AzureBlobStorageImplBuilder.java @@ -6,22 +6,29 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.HttpTrait; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import java.util.ArrayList; @@ -32,13 +39,16 @@ /** A builder for creating a new instance of the AzureBlobStorage type. */ @ServiceClientBuilder(serviceClients = {AzureBlobStorageImpl.class}) -public final class AzureBlobStorageImplBuilder { +public final class AzureBlobStorageImplBuilder + implements HttpTrait, ConfigurationTrait { @Generated private static final String SDK_NAME = "name"; @Generated private static final String SDK_VERSION = "version"; @Generated private final Map properties = new HashMap<>(); + @Generated private final List pipelinePolicies; + /** Create an instance of the AzureBlobStorageImplBuilder. */ @Generated public AzureBlobStorageImplBuilder() { @@ -46,88 +56,76 @@ public AzureBlobStorageImplBuilder() { } /* - * The URL of the service account, container, or blob that is the target of - * the desired operation. + * The HTTP pipeline to send requests through. */ - @Generated private String url; + @Generated private HttpPipeline pipeline; - /** - * Sets The URL of the service account, container, or blob that is the target of the desired operation. - * - * @param url the url value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated - public AzureBlobStorageImplBuilder url(String url) { - this.url = url; + @Override + public AzureBlobStorageImplBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * Specifies the version of the operation to use for this request. + * The HTTP client used to send the request. */ - @Generated private String version; + @Generated private HttpClient httpClient; - /** - * Sets Specifies the version of the operation to use for this request. - * - * @param version the version value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated - public AzureBlobStorageImplBuilder version(String version) { - this.version = version; + @Override + public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP pipeline to send requests through + * The logging configuration for HTTP requests and responses. */ - @Generated private HttpPipeline pipeline; + @Generated private HttpLogOptions httpLogOptions; - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated - public AzureBlobStorageImplBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + @Override + public AzureBlobStorageImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; return this; } /* - * The serializer to serialize an object into a string + * The client options such as application ID and custom headers to set on a + * request. */ - @Generated private SerializerAdapter serializerAdapter; + @Generated private ClientOptions clientOptions; - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated - public AzureBlobStorageImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; + @Override + public AzureBlobStorageImplBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; return this; } /* - * The HTTP client used to send the request. + * The retry options to configure retry policy for failed requests. */ - @Generated private HttpClient httpClient; + @Generated private RetryOptions retryOptions; - /** - * Sets The HTTP client used to send the request. - * - * @param httpClient the httpClient value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated - public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + @Override + public AzureBlobStorageImplBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); return this; } @@ -137,85 +135,81 @@ public AzureBlobStorageImplBuilder httpClient(HttpClient httpClient) { */ @Generated private Configuration configuration; - /** - * Sets The configuration store that is used during construction of the service client. - * - * @param configuration the configuration value. - * @return the AzureBlobStorageImplBuilder. - */ + /** {@inheritDoc}. */ @Generated + @Override public AzureBlobStorageImplBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; } /* - * The logging configuration for HTTP requests and responses. + * The URL of the service account, container, or blob that is the target of + * the desired operation. */ - @Generated private HttpLogOptions httpLogOptions; + @Generated private String url; /** - * Sets The logging configuration for HTTP requests and responses. + * Sets The URL of the service account, container, or blob that is the target of the desired operation. * - * @param httpLogOptions the httpLogOptions value. + * @param url the url value. * @return the AzureBlobStorageImplBuilder. */ @Generated - public AzureBlobStorageImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; + public AzureBlobStorageImplBuilder url(String url) { + this.url = url; return this; } /* - * The retry policy that will attempt to retry failed requests, if - * applicable. + * Specifies the version of the operation to use for this request. */ - @Generated private RetryPolicy retryPolicy; + @Generated private String version; /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. + * Sets Specifies the version of the operation to use for this request. * - * @param retryPolicy the retryPolicy value. + * @param version the version value. * @return the AzureBlobStorageImplBuilder. */ @Generated - public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; + public AzureBlobStorageImplBuilder version(String version) { + this.version = version; return this; } /* - * The list of Http pipeline policies to add. - */ - @Generated private final List pipelinePolicies; - - /* - * The client options such as application ID and custom headers to set on a - * request. + * The serializer to serialize an object into a string */ - @Generated private ClientOptions clientOptions; + @Generated private SerializerAdapter serializerAdapter; /** - * Sets The client options such as application ID and custom headers to set on a request. + * Sets The serializer to serialize an object into a string. * - * @param clientOptions the clientOptions value. + * @param serializerAdapter the serializerAdapter value. * @return the AzureBlobStorageImplBuilder. */ @Generated - public AzureBlobStorageImplBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; + public AzureBlobStorageImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; return this; } + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + /** - * Adds a custom Http pipeline policy. + * Sets The retry policy that will attempt to retry failed requests, if applicable. * - * @param customPolicy The custom Http pipeline policy to add. + * @param retryPolicy the retryPolicy value. * @return the AzureBlobStorageImplBuilder. */ @Generated - public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); + public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; return this; } @@ -226,12 +220,12 @@ public AzureBlobStorageImplBuilder addPolicy(HttpPipelinePolicy customPolicy) { */ @Generated public AzureBlobStorageImpl buildClient() { - if (version == null) { - this.version = "2021-04-10"; - } if (pipeline == null) { this.pipeline = createHttpPipeline(); } + if (version == null) { + this.version = "2021-04-10"; + } if (serializerAdapter == null) { this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); } @@ -254,6 +248,8 @@ private HttpPipeline createHttpPipeline() { String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions); policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); HttpHeaders headers = new HttpHeaders(); clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); if (headers.getSize() > 0) { @@ -264,7 +260,8 @@ private HttpPipeline createHttpPipeline() { .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); policies.add(new CookiePolicy()); policies.addAll( this.pipelinePolicies.stream() diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobDeleteType.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobDeleteType.java index 85419191eff85..87fccd8ebdaf2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobDeleteType.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobDeleteType.java @@ -24,7 +24,11 @@ public static BlobDeleteType fromString(String name) { return fromString(name, BlobDeleteType.class); } - /** @return known BlobDeleteType values. */ + /** + * Gets known BlobDeleteType values. + * + * @return known BlobDeleteType values. + */ public static Collection values() { return values(BlobDeleteType.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobExpiryOptions.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobExpiryOptions.java index 3180d15a9a982..8f53b14d954f2 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobExpiryOptions.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobExpiryOptions.java @@ -33,7 +33,11 @@ public static BlobExpiryOptions fromString(String name) { return fromString(name, BlobExpiryOptions.class); } - /** @return known BlobExpiryOptions values. */ + /** + * Gets known BlobExpiryOptions values. + * + * @return known BlobExpiryOptions values. + */ public static Collection values() { return values(BlobExpiryOptions.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetTagsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetTagsResponse.java index 4806c2a07ecb4..c9ff99f1c11c1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetTagsResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlobsGetTagsResponse.java @@ -24,7 +24,11 @@ public BlobsGetTagsResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlobTags getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlockBlobsGetBlockListResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlockBlobsGetBlockListResponse.java index 431c9b3a888d4..0ac7f0a4801b8 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlockBlobsGetBlockListResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/BlockBlobsGetBlockListResponse.java @@ -29,7 +29,11 @@ public BlockBlobsGetBlockListResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlockList getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersFilterBlobsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersFilterBlobsResponse.java index 0919e5cb252d9..d54c4f04e077a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersFilterBlobsResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersFilterBlobsResponse.java @@ -28,7 +28,11 @@ public ContainersFilterBlobsResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public FilterBlobSegment getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetAccessPolicyResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetAccessPolicyResponse.java index 2e4d565641209..6667c041ee9fa 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetAccessPolicyResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersGetAccessPolicyResponse.java @@ -31,7 +31,11 @@ public ContainersGetAccessPolicyResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public List getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobFlatSegmentResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobFlatSegmentResponse.java index 2c38d6a2491d2..2b57f303f5bfc 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobFlatSegmentResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobFlatSegmentResponse.java @@ -29,7 +29,11 @@ public ContainersListBlobFlatSegmentResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public ListBlobsFlatSegmentResponse getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobHierarchySegmentResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobHierarchySegmentResponse.java index f5c8a1ac2d887..89ccc84755489 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobHierarchySegmentResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ContainersListBlobHierarchySegmentResponse.java @@ -29,7 +29,11 @@ public ContainersListBlobHierarchySegmentResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public ListBlobsHierarchySegmentResponse getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java index e454deb04d79f..08500fbe0cd9f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesDiffResponse.java @@ -30,7 +30,11 @@ public PageBlobsGetPageRangesDiffResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public PageList getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java index 015ac69ddf3ef..9fb25197fc782 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageBlobsGetPageRangesResponse.java @@ -29,7 +29,11 @@ public PageBlobsGetPageRangesResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public PageList getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListHelper.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListHelper.java new file mode 100644 index 0000000000000..4411f23c9786a --- /dev/null +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PageListHelper.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.storage.blob.implementation.models; + +import com.azure.storage.blob.models.PageList; + +public class PageListHelper { + private static PageListAccessor accessor; + + public static String getNextMarker(PageList pageList) { + return accessor.getNextMarker(pageList); + } + + public static PageList setNextMarker(PageList pageList, String marker) { + return accessor.setNextMarker(pageList, marker); + } + + public static void setAccessor(PageListAccessor pageListAccessor) { + accessor = pageListAccessor; + } + + public interface PageListAccessor { + String getNextMarker(PageList pageList); + PageList setNextMarker(PageList pageList, String marker); + } +} diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PremiumPageBlobAccessTier.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PremiumPageBlobAccessTier.java index 2fe071a8dd8f9..337fd3edeeb03 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PremiumPageBlobAccessTier.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/PremiumPageBlobAccessTier.java @@ -54,7 +54,11 @@ public static PremiumPageBlobAccessTier fromString(String name) { return fromString(name, PremiumPageBlobAccessTier.class); } - /** @return known PremiumPageBlobAccessTier values. */ + /** + * Gets known PremiumPageBlobAccessTier values. + * + * @return known PremiumPageBlobAccessTier values. + */ public static Collection values() { return values(PremiumPageBlobAccessTier.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryFormat.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryFormat.java index eb7332d39a85b..391787d73bf41 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryFormat.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/QueryFormat.java @@ -39,7 +39,7 @@ public final class QueryFormat { private ArrowConfiguration arrowConfiguration; /* - * Any object + * parquet configuration */ @JsonProperty(value = "ParquetTextConfiguration") private Object parquetTextConfiguration; @@ -129,7 +129,7 @@ public QueryFormat setArrowConfiguration(ArrowConfiguration arrowConfiguration) } /** - * Get the parquetTextConfiguration property: Any object. + * Get the parquetTextConfiguration property: parquet configuration. * * @return the parquetTextConfiguration value. */ @@ -138,7 +138,7 @@ public Object getParquetTextConfiguration() { } /** - * Set the parquetTextConfiguration property: Any object. + * Set the parquetTextConfiguration property: parquet configuration. * * @param parquetTextConfiguration the parquetTextConfiguration value to set. * @return the QueryFormat object itself. diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesFilterBlobsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesFilterBlobsResponse.java index 0d98112c0b499..3f1eacaaab91b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesFilterBlobsResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesFilterBlobsResponse.java @@ -28,7 +28,11 @@ public ServicesFilterBlobsResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public FilterBlobSegment getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java index f92658eb6e734..f68626c78982f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetPropertiesResponse.java @@ -30,7 +30,11 @@ public ServicesGetPropertiesResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlobServiceProperties getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetStatisticsResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetStatisticsResponse.java index 94311f6b7efb5..d856f01fdfff0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetStatisticsResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetStatisticsResponse.java @@ -30,7 +30,11 @@ public ServicesGetStatisticsResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlobServiceStatistics getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetUserDelegationKeyResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetUserDelegationKeyResponse.java index 3c7430bcbda6f..054903e91b839 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetUserDelegationKeyResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesGetUserDelegationKeyResponse.java @@ -30,7 +30,11 @@ public ServicesGetUserDelegationKeyResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public UserDelegationKey getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentNextResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentNextResponse.java index 3b6bfa11183cb..7da6818d07f3b 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentNextResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentNextResponse.java @@ -29,7 +29,11 @@ public ServicesListBlobContainersSegmentNextResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlobContainersSegment getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentResponse.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentResponse.java index 84fec3933cba3..48e2b7f5b42d1 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentResponse.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/models/ServicesListBlobContainersSegmentResponse.java @@ -29,7 +29,11 @@ public ServicesListBlobContainersSegmentResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public BlobContainersSegment getValue() { return super.getValue(); diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTier.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTier.java index 8f991f3c27b41..a8718e6dbf635 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTier.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/AccessTier.java @@ -63,7 +63,11 @@ public static AccessTier fromString(String name) { return fromString(name, AccessTier.class); } - /** @return known AccessTier values. */ + /** + * Gets known AccessTier values. + * + * @return known AccessTier values. + */ public static Collection values() { return values(AccessTier.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ArchiveStatus.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ArchiveStatus.java index 5ad0dc6fa4f74..b98d15a45b40f 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ArchiveStatus.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ArchiveStatus.java @@ -27,7 +27,11 @@ public static ArchiveStatus fromString(String name) { return fromString(name, ArchiveStatus.class); } - /** @return known ArchiveStatus values. */ + /** + * Gets known ArchiveStatus values. + * + * @return known ArchiveStatus values. + */ public static Collection values() { return values(ArchiveStatus.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java index 2b7ab48afdd3e..2c59687e362df 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobErrorCode.java @@ -369,10 +369,7 @@ public final class BlobErrorCode extends ExpandableStringEnum { public static final BlobErrorCode AUTHORIZATION_RESOURCE_TYPE_MISMATCH = fromString("AuthorizationResourceTypeMismatch"); - /** Static value SnaphotOperationRateExceeded for BlobErrorCode. - * @deprecated Please use {@link BlobErrorCode#SNAPSHOT_OPERATION_RATE_EXCEEDED} - */ - @Deprecated + /** Static value SnaphotOperationRateExceeded for BlobErrorCode. */ public static final BlobErrorCode SNAPHOT_OPERATION_RATE_EXCEEDED = fromString("SnaphotOperationRateExceeded"); /** @@ -386,7 +383,11 @@ public static BlobErrorCode fromString(String name) { return fromString(name, BlobErrorCode.class); } - /** @return known BlobErrorCode values. */ + /** + * Gets known BlobErrorCode values. + * + * @return known BlobErrorCode values. + */ public static Collection values() { return values(BlobErrorCode.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/GeoReplicationStatus.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/GeoReplicationStatus.java index dbd4a46417d33..e92bfa019e77a 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/GeoReplicationStatus.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/GeoReplicationStatus.java @@ -30,7 +30,11 @@ public static GeoReplicationStatus fromString(String name) { return fromString(name, GeoReplicationStatus.class); } - /** @return known GeoReplicationStatus values. */ + /** + * Gets known GeoReplicationStatus values. + * + * @return known GeoReplicationStatus values. + */ public static Collection values() { return values(GeoReplicationStatus.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java index 657baf212d412..71eb49c661722 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageList.java @@ -5,6 +5,7 @@ package com.azure.storage.blob.models; import com.azure.core.annotation.Fluent; +import com.azure.storage.blob.implementation.models.PageListHelper; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; @@ -16,6 +17,20 @@ @Fluent @JsonDeserialize(using = PageListDeserializer.class) public final class PageList { + static { + PageListHelper.setAccessor( + new PageListHelper.PageListAccessor() { + @Override + public String getNextMarker(PageList pageList) { + return pageList.getNextMarker(); + } + + @Override + public PageList setNextMarker(PageList pageList, String marker) { + return pageList.setNextMarker(marker); + } + }); + } /* * The PageRange property. */ @@ -79,7 +94,7 @@ public PageList setClearRange(List clearRange) { * * @return the nextMarker value. */ - public String getNextMarker() { + private String getNextMarker() { return this.nextMarker; } @@ -89,7 +104,7 @@ public String getNextMarker() { * @param nextMarker the nextMarker value to set. * @return the PageList object itself. */ - public PageList setNextMarker(String nextMarker) { + private PageList setNextMarker(String nextMarker) { this.nextMarker = nextMarker; return this; } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java index a65164364ae6b..a098d2bc86f2c 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PageListDeserializer.java @@ -3,6 +3,7 @@ package com.azure.storage.blob.models; +import com.azure.storage.blob.implementation.models.PageListHelper; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.core.JsonTokenId; @@ -80,6 +81,7 @@ public PageList deserialize(JsonParser p, DeserializationContext ctxt) throws IO } } - return new PageList().setPageRange(pageRanges).setClearRange(clearRanges).setNextMarker(nextMarker); + return PageListHelper.setNextMarker(new PageList().setPageRange(pageRanges).setClearRange(clearRanges), + nextMarker); } } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PublicAccessType.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PublicAccessType.java index 163d8ae7610fb..0f384b56ffd3d 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PublicAccessType.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/PublicAccessType.java @@ -27,7 +27,11 @@ public static PublicAccessType fromString(String name) { return fromString(name, PublicAccessType.class); } - /** @return known PublicAccessType values. */ + /** + * Gets known PublicAccessType values. + * + * @return known PublicAccessType values. + */ public static Collection values() { return values(PublicAccessType.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java index 7d03edfcd201c..0bcd61e123db0 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/RehydratePriority.java @@ -27,7 +27,11 @@ public static RehydratePriority fromString(String name) { return fromString(name, RehydratePriority.class); } - /** @return known RehydratePriority values. */ + /** + * Gets known RehydratePriority values. + * + * @return known RehydratePriority values. + */ public static Collection values() { return values(RehydratePriority.class); } diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java index 95434f2c51802..28b8cbdb300a7 100644 --- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java +++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/specialized/PageBlobAsyncClient.java @@ -30,6 +30,7 @@ import com.azure.storage.blob.implementation.models.PageBlobsUpdateSequenceNumberHeaders; import com.azure.storage.blob.implementation.models.PageBlobsUploadPagesFromURLHeaders; import com.azure.storage.blob.implementation.models.PageBlobsUploadPagesHeaders; +import com.azure.storage.blob.implementation.models.PageListHelper; import com.azure.storage.blob.implementation.util.ModelHelper; import com.azure.storage.blob.models.BlobHttpHeaders; import com.azure.storage.blob.models.BlobImmutabilityPolicy; @@ -997,7 +998,7 @@ BiFunction>> listPageRangesWi response.getStatusCode(), response.getHeaders(), value, - response.getValue().getNextMarker(), + PageListHelper.getNextMarker(response.getValue()), response.getDeserializedHeaders()); }); }; @@ -1318,7 +1319,7 @@ BiFunction>> listPageRangesDi response.getStatusCode(), response.getHeaders(), value, - response.getValue().getNextMarker(), + PageListHelper.getNextMarker(response.getValue()), response.getDeserializedHeaders()); }); }; diff --git a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java index 67b26830622c2..8c5bed895d39f 100644 --- a/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java +++ b/sdk/storage/azure-storage-blob/swagger/src/main/java/BlobStorageCustomization.java @@ -8,12 +8,15 @@ import com.azure.autorest.customization.PropertyCustomization; import org.slf4j.Logger; +import java.lang.reflect.Modifier; + /** * Customization class for Blob Storage. */ public class BlobStorageCustomization extends Customization { @Override public void customize(LibraryCustomization customization, Logger logger) { + // Implementation models customizations PackageCustomization implementationModels = customization.getPackage("com.azure.storage.blob.implementation.models"); implementationModels.getClass("BlobHierarchyListSegment").addAnnotation("@JsonDeserialize(using = com.azure.storage.blob.implementation.util.CustomHierarchicalListingDeserializer.class)"); @@ -22,6 +25,35 @@ public void customize(LibraryCustomization customization, Logger logger) { // Models customizations PackageCustomization models = customization.getPackage("com.azure.storage.blob.models"); models.getClass("PageList").addAnnotation("@JsonDeserialize(using = PageListDeserializer.class)"); + models.getClass("PageList").getMethod("getNextMarker").setModifier(Modifier.PRIVATE); + models.getClass("PageList").getMethod("setNextMarker").setModifier(Modifier.PRIVATE); + + // Add Accessor to PageList + String pageListFileName = "src/main/java/com/azure/storage/blob/models/PageList.java"; + + String fileContent = customization.getRawEditor().getFileContent(pageListFileName); + int startImportIndex = fileContent.indexOf("import com.azure.core.annotation.Fluent;") + 40; + int startStaticIndex = fileContent.indexOf("class PageList {") + 16; + String updatedFileContent = fileContent.substring(0, startImportIndex) + + "import com.azure.storage.blob.implementation.models.PageListHelper;" + + fileContent.substring(startImportIndex, startStaticIndex) + + "static {\n" + + " PageListHelper.setAccessor(new PageListHelper.PageListAccessor() {\n" + + " @Override\n" + + " public String getNextMarker(PageList pageList) {\n" + + " return pageList.getNextMarker();\n" + + " }\n" + + "\n" + + " @Override\n" + + " public PageList setNextMarker(PageList pageList, String marker) {\n" + + " return pageList.setNextMarker(marker);\n" + + " }\n" + + " });\n" + + " } " + + fileContent.substring(startStaticIndex); + + customization.getRawEditor().removeFile(pageListFileName); + customization.getRawEditor().addFile(pageListFileName, updatedFileContent); ClassCustomization blobHttpHeaders = models.getClass("BlobHttpHeaders"); blobHttpHeaders.getMethod("getContentMd5").getJavadoc().setDescription("Get the contentMd5 property: " + From 729e969c3629fa0b8b8c41bfe72c936b0666e016 Mon Sep 17 00:00:00 2001 From: Rick Ley Date: Fri, 29 Apr 2022 11:03:14 -0700 Subject: [PATCH 19/19] Fixed merge conflict --- sdk/storage/azure-storage-blob/swagger/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md index d292f308765b8..695fcf14ee6ae 100644 --- a/sdk/storage/azure-storage-blob/swagger/README.md +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -573,7 +573,6 @@ directive: $["x-ms-enum"].modelAsString = true; ``` -<<<<<<< HEAD ### Delete PageBlob_GetPageRanges x-ms-pageable as autorest can't recognize the itemName for this ``` yaml directive: @@ -590,7 +589,8 @@ directive: where: $["x-ms-paths"]["/{containerName}/{blob}?comp=pagelist&diff"].get transform: > delete $["x-ms-pageable"]; -======= +``` + ### BlobCopySourceTags expandable string enum ``` yaml directive: @@ -598,7 +598,6 @@ directive: where: $.parameters.CopySourceTags transform: > $["x-ms-enum"].modelAsString = true; ->>>>>>> upstream/main ``` ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fstorage%2Fazure-storage-blob%2Fswagger%2FREADME.png)