azure-docs-sdk-java/docs-ref-autogen/com.azure.storage.blob.batc...

154 строки
19 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.storage.blob.batch.BlobBatchClient"
fullName: "com.azure.storage.blob.batch.BlobBatchClient"
name: "BlobBatchClient"
nameWithType: "BlobBatchClient"
summary: "This class provides a client that contains all operations that apply to Azure Storage Blob batching."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **BlobBatchClient**"
methods:
- uid: "com.azure.storage.blob.batch.BlobBatchClient.deleteBlobs(java.util.List<java.lang.String>,com.azure.storage.blob.models.DeleteSnapshotsOptionType)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions)"
name: "deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions)"
nameWithType: "BlobBatchClient.deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions)"
summary: "Delete multiple blobs in a single request to the service."
parameters:
- description: "Urls of the blobs to delete. Blob names must be encoded to UTF-8."
name: "blobUrls"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The deletion option for all blobs."
name: "deleteOptions"
type: "<xref href=\"com.azure.storage.blob.models.DeleteSnapshotsOptionType?alt=com.azure.storage.blob.models.DeleteSnapshotsOptionType&text=DeleteSnapshotsOptionType\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<Response<Void>> deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions)"
desc: "Delete multiple blobs in a single request to the service.\n\n**Code samples**\n\n```java\nList<String> blobUrls = new ArrayList<>();\n blobUrls.add(blobClient1.getBlobUrl());\n blobUrls.add(blobClient2.getBlobUrl());\n blobUrls.add(blobClient3.getBlobUrl());\n\n try {\n batchClient.deleteBlobs(blobUrls, DeleteSnapshotsOptionType.INCLUDE).forEach(response ->\n System.out.printf(\"Deleting blob with URL %s completed with status code %d%n\",\n response.getRequest().getUrl(), response.getStatusCode()));\n } catch (Throwable error) {\n System.err.printf(\"Deleting blob failed with exception: %s%n\", error.getMessage());\n }\n```"
returns:
description: "The status of each delete operation."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;&gt;"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.deleteBlobs(java.util.List<java.lang.String>,com.azure.storage.blob.models.DeleteSnapshotsOptionType,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions, Duration timeout, Context context)"
name: "deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions, Duration timeout, Context context)"
nameWithType: "BlobBatchClient.deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions, Duration timeout, Context context)"
summary: "Delete multiple blobs in a single request to the service."
parameters:
- description: "Urls of the blobs to delete. Blob names must be encoded to UTF-8."
name: "blobUrls"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "The deletion option for all blobs."
name: "deleteOptions"
type: "<xref href=\"com.azure.storage.blob.models.DeleteSnapshotsOptionType?alt=com.azure.storage.blob.models.DeleteSnapshotsOptionType&text=DeleteSnapshotsOptionType\" data-throw-if-not-resolved=\"False\" />"
- description: "An optional timeout value beyond which a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be raised."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<Response<Void>> deleteBlobs(List<String> blobUrls, DeleteSnapshotsOptionType deleteOptions, Duration timeout, Context context)"
desc: "Delete multiple blobs in a single request to the service.\n\n**Code samples**\n\n```java\nList<String> blobUrls = new ArrayList<>();\n blobUrls.add(blobClient1.getBlobUrl());\n blobUrls.add(blobClient2.getBlobUrl());\n blobUrls.add(blobClient3.getBlobUrl());\n\n try {\n batchClient.deleteBlobs(blobUrls, DeleteSnapshotsOptionType.INCLUDE, timeout, Context.NONE)\n .forEach(response -> System.out.printf(\"Deleting blob with URL %s completed with status code %d%n\",\n response.getRequest().getUrl(), response.getStatusCode()));\n } catch (Throwable error) {\n System.err.printf(\"Deleting blob failed with exception: %s%n\", error.getMessage());\n }\n```"
returns:
description: "The status of each delete operation."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;&gt;"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.getBlobBatch()"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.getBlobBatch()"
name: "getBlobBatch()"
nameWithType: "BlobBatchClient.getBlobBatch()"
summary: "Gets a <xref uid=\"com.azure.storage.blob.batch.BlobBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobBatch\"></xref> used to configure a batching operation to send to Azure Storage blobs."
syntax: "public BlobBatch getBlobBatch()"
desc: "Gets a <xref uid=\"com.azure.storage.blob.batch.BlobBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobBatch\"></xref> used to configure a batching operation to send to Azure Storage blobs."
returns:
description: "a new <xref uid=\"com.azure.storage.blob.batch.BlobBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobBatch\"></xref> instance."
type: "<xref href=\"com.azure.storage.blob.batch.BlobBatch?alt=com.azure.storage.blob.batch.BlobBatch&text=BlobBatch\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.setBlobsAccessTier(java.util.List<java.lang.String>,com.azure.storage.blob.models.AccessTier)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier)"
name: "setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier)"
nameWithType: "BlobBatchClient.setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier)"
summary: "Set access tier on multiple blobs in a single request to the service."
parameters:
- description: "Urls of the blobs to set their access tier. Blob names must be encoded to UTF-8."
name: "blobUrls"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "<xref uid=\"com.azure.storage.blob.models.AccessTier\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AccessTier\"></xref> to set on each blob."
name: "accessTier"
type: "<xref href=\"com.azure.storage.blob.models.AccessTier?alt=com.azure.storage.blob.models.AccessTier&text=AccessTier\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<Response<Void>> setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier)"
desc: "Set access tier on multiple blobs in a single request to the service.\n\n**Code samples**\n\n```java\nList<String> blobUrls = new ArrayList<>();\n blobUrls.add(blobClient1.getBlobUrl());\n blobUrls.add(blobClient2.getBlobUrl());\n blobUrls.add(blobClient3.getBlobUrl());\n\n try {\n batchClient.setBlobsAccessTier(blobUrls, AccessTier.HOT).forEach(response ->\n System.out.printf(\"Setting blob access tier with URL %s completed with status code %d%n\",\n response.getRequest().getUrl(), response.getStatusCode()));\n } catch (Throwable error) {\n System.err.printf(\"Setting blob access tier failed with exception: %s%n\", error.getMessage());\n }\n```"
returns:
description: "The status of each set tier operation."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;&gt;"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.setBlobsAccessTier(java.util.List<java.lang.String>,com.azure.storage.blob.models.AccessTier,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier, Duration timeout, Context context)"
name: "setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier, Duration timeout, Context context)"
nameWithType: "BlobBatchClient.setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier, Duration timeout, Context context)"
summary: "Set access tier on multiple blobs in a single request to the service."
parameters:
- description: "Urls of the blobs to set their access tier. Blob names must be encoded to UTF-8."
name: "blobUrls"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "<xref uid=\"com.azure.storage.blob.models.AccessTier\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AccessTier\"></xref> to set on each blob."
name: "accessTier"
type: "<xref href=\"com.azure.storage.blob.models.AccessTier?alt=com.azure.storage.blob.models.AccessTier&text=AccessTier\" data-throw-if-not-resolved=\"False\" />"
- description: "An optional timeout value beyond which a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be raised."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public PagedIterable<Response<Void>> setBlobsAccessTier(List<String> blobUrls, AccessTier accessTier, Duration timeout, Context context)"
desc: "Set access tier on multiple blobs in a single request to the service.\n\n**Code samples**\n\n```java\nList<String> blobUrls = new ArrayList<>();\n blobUrls.add(blobClient1.getBlobUrl());\n blobUrls.add(blobClient2.getBlobUrl());\n blobUrls.add(blobClient3.getBlobUrl());\n\n try {\n batchClient.setBlobsAccessTier(blobUrls, AccessTier.HOT, timeout, Context.NONE).forEach(response ->\n System.out.printf(\"Setting blob access tier with URL %s completed with status code %d%n\",\n response.getRequest().getUrl(), response.getStatusCode()));\n } catch (Throwable error) {\n System.err.printf(\"Setting blob access tier failed with exception: %s%n\", error.getMessage());\n }\n```"
returns:
description: "The status of each set tier operation."
type: "<xref href=\"com.azure.core.http.rest.PagedIterable?alt=com.azure.core.http.rest.PagedIterable&text=PagedIterable\" data-throw-if-not-resolved=\"False\" />&lt;<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;&gt;"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.submitBatch(com.azure.storage.blob.batch.BlobBatch)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.submitBatch(BlobBatch batch)"
name: "submitBatch(BlobBatch batch)"
nameWithType: "BlobBatchClient.submitBatch(BlobBatch batch)"
summary: "Submits a batch operation."
parameters:
- description: "Batch to submit."
name: "batch"
type: "<xref href=\"com.azure.storage.blob.batch.BlobBatch?alt=com.azure.storage.blob.batch.BlobBatch&text=BlobBatch\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void submitBatch(BlobBatch batch)"
desc: "Submits a batch operation.\n\nIf any request in a batch fails this will throw a <xref uid=\"com.azure.storage.blob.models.BlobStorageException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobStorageException\"></xref>.\n\n**Code samples**\n\n```java\nBlobBatch batch = batchClient.getBlobBatch();\n\n Response<Void> deleteResponse1 = batch.deleteBlob(\"container\", \"blob1\");\n Response<Void> deleteResponse2 = batch.deleteBlob(\"container\", \"blob2\", DeleteSnapshotsOptionType.INCLUDE,\n new BlobRequestConditions().setLeaseId(\"leaseId\"));\n\n try {\n batchClient.submitBatch(batch);\n System.out.println(\"Batch submission completed successfully.\");\n System.out.printf(\"Delete operation 1 completed with status code: %d%n\", deleteResponse1.getStatusCode());\n System.out.printf(\"Delete operation 2 completed with status code: %d%n\", deleteResponse2.getStatusCode());\n } catch (BlobStorageException error) {\n System.err.printf(\"Batch submission failed. Error message: %s%n\", error.getMessage());\n }\n```"
- uid: "com.azure.storage.blob.batch.BlobBatchClient.submitBatchWithResponse(com.azure.storage.blob.batch.BlobBatch,boolean,java.time.Duration,com.azure.core.util.Context)"
fullName: "com.azure.storage.blob.batch.BlobBatchClient.submitBatchWithResponse(BlobBatch batch, boolean throwOnAnyFailure, Duration timeout, Context context)"
name: "submitBatchWithResponse(BlobBatch batch, boolean throwOnAnyFailure, Duration timeout, Context context)"
nameWithType: "BlobBatchClient.submitBatchWithResponse(BlobBatch batch, boolean throwOnAnyFailure, Duration timeout, Context context)"
summary: "Submits a batch operation."
parameters:
- description: "Batch to submit."
name: "batch"
type: "<xref href=\"com.azure.storage.blob.batch.BlobBatch?alt=com.azure.storage.blob.batch.BlobBatch&text=BlobBatch\" data-throw-if-not-resolved=\"False\" />"
- description: "Flag to indicate if an exception should be thrown if any request in the batch fails."
name: "throwOnAnyFailure"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- description: "An optional timeout value beyond which a <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RuntimeException\"></xref> will be raised."
name: "timeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- description: "Additional context that is passed through the Http pipeline during the service call."
name: "context"
type: "<xref href=\"com.azure.core.util.Context?alt=com.azure.core.util.Context&text=Context\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Response<Void> submitBatchWithResponse(BlobBatch batch, boolean throwOnAnyFailure, Duration timeout, Context context)"
desc: "Submits a batch operation.\n\nIf `throwOnAnyFailure` is `true` a <xref uid=\"com.azure.storage.blob.models.BlobStorageException\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobStorageException\"></xref> will be thrown if any request fails.\n\n**Code samples**\n\n```java\nBlobBatch batch = batchClient.getBlobBatch();\n\n Response<Void> deleteResponse1 = batch.deleteBlob(\"container\", \"blob1\");\n Response<Void> deleteResponse2 = batch.deleteBlob(\"container\", \"blob2\", DeleteSnapshotsOptionType.INCLUDE,\n new BlobRequestConditions().setLeaseId(\"leaseId\"));\n\n try {\n System.out.printf(\"Batch submission completed with status code: %d%n\",\n batchClient.submitBatchWithResponse(batch, true, timeout, Context.NONE).getStatusCode());\n System.out.printf(\"Delete operation 1 completed with status code: %d%n\", deleteResponse1.getStatusCode());\n System.out.printf(\"Delete operation 2 completed with status code: %d%n\", deleteResponse2.getStatusCode());\n } catch (BlobStorageException error) {\n System.err.printf(\"Batch submission failed. Error message: %s%n\", error.getMessage());\n }\n```"
returns:
description: "A response only containing header and status code information, used to indicate that the batch operation\n has completed."
type: "<xref href=\"com.azure.core.http.rest.Response?alt=com.azure.core.http.rest.Response&text=Response\" data-throw-if-not-resolved=\"False\" />&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html\">Void</a>&gt;"
type: "class"
desc: "This class provides a client that contains all operations that apply to Azure Storage Blob batching.\n\nThis client offers the ability to delete and set access tier on multiple blobs at once and to submit a <xref uid=\"com.azure.storage.blob.batch.BlobBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BlobBatch\"></xref>."
metadata: {}
package: "com.azure.storage.blob.batch"
artifact: com.azure:azure-storage-blob-batch:12.24.0