BlobBatchClient class  
BlobBatchClient 允许向 Azure 存储 Blob 服务发出批处理请求。
请参阅 https://free.blessedness.top/rest/api/storageservices/blob-batch
构造函数
| Blob | 创建 BlobBatchClient 的实例。 | 
| Blob | 创建 BlobBatchClient 的实例。 | 
方法
| create | 创建 BlobBatch。 BlobBatch 表示对 Blob 的聚合作集。 | 
| delete | 创建多个删除作以标记要删除的指定 Blob 或快照。 请注意,若要删除 Blob,必须删除其所有快照。 可以同时删除两者。 请参阅 删除作详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。 请参阅 blob 批处理授权详细信息。 | 
| delete | 创建多个删除作以标记要删除的指定 Blob 或快照。 请注意,若要删除 Blob,必须删除其所有快照。 可以同时删除两者。 请参阅 删除作详细信息。 作将通过指定的凭据进行身份验证和授权。 请参阅 blob 批处理授权详细信息。 | 
| set | 创建多个集层作以设置 Blob 上的层。 该作允许在高级存储帐户中的页 Blob 和 Blob 存储帐户中的块 Blob 上(仅限本地冗余存储)。 高级页 Blob 层确定 Blob 允许的大小、IOPS 和带宽。 块 Blob 层确定热/冷/存档存储类型。 此作不会更新 Blob 的 ETag。 请参阅 设置 blob 层详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。请参阅 blob 批处理授权详细信息。 | 
| set | 创建多个集层作以设置 Blob 上的层。 该作允许在高级存储帐户中的页 Blob 和 Blob 存储帐户中的块 Blob 上(仅限本地冗余存储)。 高级页 Blob 层确定 Blob 允许的大小、IOPS 和带宽。 块 Blob 层确定热/冷/存档存储类型。 此作不会更新 Blob 的 ETag。 请参阅 设置 blob 层详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。请参阅 blob 批处理授权详细信息。 | 
| submit | 提交包含多个子请求的批处理请求。 在运行代码片段之前,先获取  示例用法: 使用租约的示例: 请参阅 https://free.blessedness.top/rest/api/storageservices/blob-batch | 
构造函数详细信息
		BlobBatchClient(string, PipelineLike)
	   
	创建 BlobBatchClient 的实例。
new BlobBatchClient(url: string, pipeline: PipelineLike)参数
- url
- 
				string 
指向 Azure 存储 Blob 服务的 URL,例如“https://myaccount.blob.core.windows.net"。 如果使用 AnonymousCredential(如“https://myaccount.blob.core.windows.net?sasString"),则可以追加 SAS。
- pipeline
- PipelineLike
调用 newPipeline()以创建默认管道,或提供自定义管道。
		BlobBatchClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions)
	         
	创建 BlobBatchClient 的实例。
new BlobBatchClient(url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)参数
- url
- 
				string 
指向 Azure 存储 Blob 服务的 URL,例如“https://myaccount.blob.core.windows.net"。 如果使用 AnonymousCredential(如“https://myaccount.blob.core.windows.net?sasString"),则可以追加 SAS。
- credential
- 
				StorageSharedKeyCredential | AnonymousCredential | TokenCredential 
例如 AnonymousCredential、StorageSharedKeyCredential 或任何来自 @azure/identity 包的凭据,用于对服务的请求进行身份验证。 还可以提供实现 TokenCredential 接口的对象。 如果未指定,则使用 AnonymousCredential。
- options
- StoragePipelineOptions
用于配置 HTTP 管道的选项。
方法详细信息
		createBatch()
	 
	
		deleteBlobs(BlobClient[], BlobDeleteOptions)
	    
	创建多个删除作以标记要删除的指定 Blob 或快照。 请注意,若要删除 Blob,必须删除其所有快照。 可以同时删除两者。 请参阅 删除作详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。 请参阅 blob 批处理授权详细信息。
function deleteBlobs(blobClients: BlobClient[], options?: BlobDeleteOptions): Promise<BlobBatchSubmitBatchResponse>参数
- blobClients
要删除的 Blob 的 BlobClients。
- options
- BlobDeleteOptions
返回
Promise<BlobBatchSubmitBatchResponse>
		deleteBlobs(string[], StorageSharedKeyCredential | AnonymousCredential | TokenCredential, BlobDeleteOptions)
	        
	创建多个删除作以标记要删除的指定 Blob 或快照。 请注意,若要删除 Blob,必须删除其所有快照。 可以同时删除两者。 请参阅 删除作详细信息。 作将通过指定的凭据进行身份验证和授权。 请参阅 blob 批处理授权详细信息。
function deleteBlobs(urls: string[], credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: BlobDeleteOptions): Promise<BlobBatchSubmitBatchResponse>参数
- urls
- 
				string[] 
要删除的 Blob 资源的 URL。
- credential
- 
				StorageSharedKeyCredential | AnonymousCredential | TokenCredential 
例如 AnonymousCredential、StorageSharedKeyCredential 或任何来自 @azure/identity 包的凭据,用于对服务的请求进行身份验证。 还可以提供实现 TokenCredential 接口的对象。 如果未指定,则使用 AnonymousCredential。
- options
- BlobDeleteOptions
返回
Promise<BlobBatchSubmitBatchResponse>
		setBlobsAccessTier(BlobClient[], AccessTier, BlobSetTierOptions)
	        
	创建多个集层作以设置 Blob 上的层。 该作允许在高级存储帐户中的页 Blob 和 Blob 存储帐户中的块 Blob 上(仅限本地冗余存储)。 高级页 Blob 层确定 Blob 允许的大小、IOPS 和带宽。 块 Blob 层确定热/冷/存档存储类型。 此作不会更新 Blob 的 ETag。 请参阅 设置 blob 层详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。请参阅 blob 批处理授权详细信息。
function setBlobsAccessTier(blobClients: BlobClient[], tier: AccessTier, options?: BlobSetTierOptions): Promise<BlobBatchSubmitBatchResponse>参数
- blobClients
应设置新层的 Blob 的 BlobClients。
- tier
- AccessTier
- options
- BlobSetTierOptions
返回
Promise<BlobBatchSubmitBatchResponse>
		setBlobsAccessTier(string[], StorageSharedKeyCredential | AnonymousCredential | TokenCredential, AccessTier, BlobSetTierOptions)
	            
	创建多个集层作以设置 Blob 上的层。 该作允许在高级存储帐户中的页 Blob 和 Blob 存储帐户中的块 Blob 上(仅限本地冗余存储)。 高级页 Blob 层确定 Blob 允许的大小、IOPS 和带宽。 块 Blob 层确定热/冷/存档存储类型。 此作不会更新 Blob 的 ETag。 请参阅 设置 blob 层详细信息。 作(subrequest)将通过指定的凭据进行身份验证和授权。请参阅 blob 批处理授权详细信息。
function setBlobsAccessTier(urls: string[], credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, tier: AccessTier, options?: BlobSetTierOptions): Promise<BlobBatchSubmitBatchResponse>参数
- urls
- 
				string[] 
要删除的 Blob 资源的 URL。
- credential
- 
				StorageSharedKeyCredential | AnonymousCredential | TokenCredential 
例如 AnonymousCredential、StorageSharedKeyCredential 或任何来自 @azure/identity 包的凭据,用于对服务的请求进行身份验证。 还可以提供实现 TokenCredential 接口的对象。 如果未指定,则使用 AnonymousCredential。
- tier
- AccessTier
- options
- BlobSetTierOptions
返回
Promise<BlobBatchSubmitBatchResponse>
		submitBatch(BlobBatch, BlobBatchSubmitBatchOptionalParams)
	       
	提交包含多个子请求的批处理请求。
在运行代码片段之前,先获取 blobBatchClient 和其他详细信息。
              blobServiceClient.getBlobBatchClient() 提供 blobBatchClient
示例用法:
import { DefaultAzureCredential } from "@azure/identity";
import { BlobServiceClient, BlobBatch } from "@azure/storage-blob";
const account = "<account>";
const credential = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(
  `https://${account}.blob.core.windows.net`,
  credential,
);
const containerName = "<container name>";
const containerClient = blobServiceClient.getContainerClient(containerName);
const blobBatchClient = containerClient.getBlobBatchClient();
const batchRequest = new BlobBatch();
await batchRequest.deleteBlob("<blob-url-1>", credential);
await batchRequest.deleteBlob("<blob-url-2>", credential, {
  deleteSnapshots: "include",
});
const batchResp = await blobBatchClient.submitBatch(batchRequest);
console.log(batchResp.subResponsesSucceededCount);
使用租约的示例:
import { DefaultAzureCredential } from "@azure/identity";
import { BlobServiceClient, BlobBatch } from "@azure/storage-blob";
const account = "<account>";
const credential = new DefaultAzureCredential();
const blobServiceClient = new BlobServiceClient(
  `https://${account}.blob.core.windows.net`,
  credential,
);
const containerName = "<container name>";
const containerClient = blobServiceClient.getContainerClient(containerName);
const blobBatchClient = containerClient.getBlobBatchClient();
const blobClient = containerClient.getBlobClient("<blob name>");
const batchRequest = new BlobBatch();
await batchRequest.setBlobAccessTier(blobClient, "Cool");
await batchRequest.setBlobAccessTier(blobClient, "Cool", {
  conditions: { leaseId: "<lease-id>" },
});
const batchResp = await blobBatchClient.submitBatch(batchRequest);
console.log(batchResp.subResponsesSucceededCount);
请参阅 https://free.blessedness.top/rest/api/storageservices/blob-batch
function submitBatch(batchRequest: BlobBatch, options?: BlobBatchSubmitBatchOptionalParams): Promise<BlobBatchSubmitBatchResponse>参数
- batchRequest
- BlobBatch
一组 Delete 或 SetTier作。
返回
Promise<BlobBatchSubmitBatchResponse>