Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STG94 Get Account Info on Container and Blob level #39597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-blob/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/storage/azure-storage-blob",
"Tag": "java/storage/azure-storage-blob_38ff3444aa"
"Tag": "java/storage/azure-storage-blob_adf9415a55"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,8 @@ public Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse() {

Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse(Context context) {
context = context == null ? Context.NONE : context;
return this.azureBlobStorage.getContainers().getAccountInfoWithResponseAsync(containerName, context)
return this.azureBlobStorage.getContainers().getAccountInfoWithResponseAsync(containerName, null,
null, context)
.map(rb -> {
ContainersGetAccountInfoHeaders hd = rb.getDeserializedHeaders();
return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ public Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse() {

Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse(Context context) {
throwOnAnonymousAccess();
return this.azureBlobStorage.getServices().getAccountInfoWithResponseAsync(context)
return this.azureBlobStorage.getServices().getAccountInfoWithResponseAsync(null, null, context)
.map(rb -> {
ServicesGetAccountInfoHeaders hd = rb.getDeserializedHeaders();
return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public AzureBlobStorageImplBuilder retryPolicy(RetryPolicy retryPolicy) {
@Generated
public AzureBlobStorageImpl buildClient() {
HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
String localVersion = (version != null) ? version : "2021-12-02";
String localVersion = (version != null) ? version : "2024-08-04";
SerializerAdapter localSerializerAdapter =
(serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter();
AzureBlobStorageImpl client =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,9 @@ Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfo(
@PathParam("blob") String blob,
@QueryParam("restype") String restype,
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept,
Context context);

Expand All @@ -995,7 +997,9 @@ Mono<Response<Void>> getAccountInfoNoCustomHeaders(
@PathParam("blob") String blob,
@QueryParam("restype") String restype,
@QueryParam("comp") String comp,
@QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-version") String version,
@HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept,
Context context);

Expand Down Expand Up @@ -9178,14 +9182,19 @@ public Mono<Response<Void>> setTierNoCustomHeadersWithResponseAsync(
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
* @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 {@link ResponseBase} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfoWithResponseAsync(
String containerName, String blob) {
String containerName, String blob, Integer timeout, String requestId) {
final String restype = "account";
final String comp = "properties";
final String accept = "application/xml";
Expand All @@ -9197,7 +9206,9 @@ public Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfoWithRe
blob,
restype,
comp,
timeout,
this.client.getVersion(),
requestId,
accept,
context));
}
Expand All @@ -9207,6 +9218,11 @@ public Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfoWithRe
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
Expand All @@ -9215,57 +9231,85 @@ public Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfoWithRe
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ResponseBase<BlobsGetAccountInfoHeaders, Void>> getAccountInfoWithResponseAsync(
String containerName, String blob, Context context) {
String containerName, String blob, Integer timeout, String requestId, Context context) {
final String restype = "account";
final String comp = "properties";
final String accept = "application/xml";
return service.getAccountInfo(
this.client.getUrl(), containerName, blob, restype, comp, this.client.getVersion(), accept, context);
this.client.getUrl(),
containerName,
blob,
restype,
comp,
timeout,
this.client.getVersion(),
requestId,
accept,
context);
}

/**
* Returns the sku name and account kind.
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
* @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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> getAccountInfoAsync(String containerName, String blob) {
return getAccountInfoWithResponseAsync(containerName, blob).flatMap(ignored -> Mono.empty());
public Mono<Void> getAccountInfoAsync(String containerName, String blob, Integer timeout, String requestId) {
return getAccountInfoWithResponseAsync(containerName, blob, timeout, requestId)
.flatMap(ignored -> Mono.empty());
}

/**
* Returns the sku name and account kind.
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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 A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> getAccountInfoAsync(String containerName, String blob, Context context) {
return getAccountInfoWithResponseAsync(containerName, blob, context).flatMap(ignored -> Mono.empty());
public Mono<Void> getAccountInfoAsync(
String containerName, String blob, Integer timeout, String requestId, Context context) {
return getAccountInfoWithResponseAsync(containerName, blob, timeout, requestId, context)
.flatMap(ignored -> Mono.empty());
}

/**
* Returns the sku name and account kind.
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
* @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 {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(String containerName, String blob) {
public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(
String containerName, String blob, Integer timeout, String requestId) {
final String restype = "account";
final String comp = "properties";
final String accept = "application/xml";
Expand All @@ -9277,7 +9321,9 @@ public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(Strin
blob,
restype,
comp,
timeout,
this.client.getVersion(),
requestId,
accept,
context));
}
Expand All @@ -9287,6 +9333,11 @@ public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(Strin
*
* @param containerName The container name.
* @param blob The blob name.
* @param timeout The timeout parameter is expressed in seconds. For more information, see &lt;a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting
* Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
Expand All @@ -9295,12 +9346,21 @@ public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(Strin
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> getAccountInfoNoCustomHeadersWithResponseAsync(
String containerName, String blob, Context context) {
String containerName, String blob, Integer timeout, String requestId, Context context) {
final String restype = "account";
final String comp = "properties";
final String accept = "application/xml";
return service.getAccountInfoNoCustomHeaders(
this.client.getUrl(), containerName, blob, restype, comp, this.client.getVersion(), accept, context);
this.client.getUrl(),
containerName,
blob,
restype,
comp,
timeout,
this.client.getVersion(),
requestId,
accept,
context);
}

/**
Expand Down
Loading