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 #40026

Merged
merged 20 commits into from
Jun 11, 2024
Merged

STG94 #40026

Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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: 2 additions & 0 deletions sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 12.27.0-beta.1 (Unreleased)
- Added support for getting account info on blob container clients and the blob base client.
- Added support for bearer token challenges.

### Features Added

Expand Down
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_bd8a4072b4"
"Tag": "java/storage/azure-storage-blob_e9a4d152f3"
}
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 @@ -117,7 +117,12 @@ public enum BlobServiceVersion implements ServiceVersion {
/**
* Service version {@code 2024-05-04}.
*/
V2024_05_04("2024-05-04");
V2024_05_04("2024-05-04"),

/**
* Service version {@code 2024-08-04}.
*/
V2024_08_04("2024-08-04");

private final String version;

Expand All @@ -139,6 +144,6 @@ public String getVersion() {
* @return the latest {@link BlobServiceVersion}
*/
public static BlobServiceVersion getLatest() {
return V2024_05_04;
return V2024_08_04;
}
}
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
Loading