@azure/storage-blob
Version:
Microsoft Azure Storage SDK for JavaScript - Blob
993 lines (955 loc) • 604 kB
TypeScript
import type { AbortSignalLike } from '@azure/abort-controller';
import { AzureLogger } from '@azure/logger';
import type { CancelOnProgress } from '@azure/core-lro';
import * as coreClient from '@azure/core-client';
import * as coreHttpCompat from '@azure/core-http-compat';
import * as coreRestPipeline from '@azure/core-rest-pipeline';
import { HttpHeadersLike as HttpHeaders } from '@azure/core-http-compat';
import { CompatResponse as HttpOperationResponse } from '@azure/core-http-compat';
import type { HttpPipelineLogLevel } from '@azure/core-http-compat';
import { RequestBodyType as HttpRequestBody } from '@azure/core-rest-pipeline';
import type { KeepAliveOptions } from '@azure/core-http-compat';
import type { OperationTracingOptions } from '@azure/core-tracing';
import type { PagedAsyncIterableIterator } from '@azure/core-paging';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
import type { ProxySettings } from '@azure/core-rest-pipeline';
import type { Readable } from 'stream';
import { RequestPolicy } from '@azure/core-http-compat';
import { RequestPolicyFactory } from '@azure/core-http-compat';
import { RequestPolicyOptionsLike as RequestPolicyOptions } from '@azure/core-http-compat';
import { RestError } from '@azure/core-rest-pipeline';
import type { TokenCredential } from '@azure/core-auth';
import type { TransferProgressEvent } from '@azure/core-rest-pipeline';
import type { UserAgentPolicyOptions } from '@azure/core-rest-pipeline';
import { WebResourceLike as WebResource } from '@azure/core-http-compat';
/** An Access policy */
export declare interface AccessPolicy {
/** the date-time the policy is active */
startsOn?: string;
/** the date-time the policy expires */
expiresOn?: string;
/** the permissions for the acl policy */
permissions?: string;
}
/** Defines values for AccessTier. */
export declare type AccessTier = "P4" | "P6" | "P10" | "P15" | "P20" | "P30" | "P40" | "P50" | "P60" | "P70" | "P80" | "Hot" | "Cool" | "Archive" | "Cold";
/** Defines values for AccountKind. */
export declare type AccountKind = "Storage" | "BlobStorage" | "StorageV2" | "FileStorage" | "BlockBlobStorage";
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the
* values are set, this should be serialized with toString and set as the permissions field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but
* the order of the permissions is particular and this class guarantees correctness.
*/
export declare class AccountSASPermissions {
/**
* Parse initializes the AccountSASPermissions fields from a string.
*
* @param permissions -
*/
static parse(permissions: string): AccountSASPermissions;
/**
* Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it
* and boolean values for them.
*
* @param permissionLike -
*/
static from(permissionLike: AccountSASPermissionsLike): AccountSASPermissions;
/**
* Permission to read resources and list queues and tables granted.
*/
read: boolean;
/**
* Permission to write resources granted.
*/
write: boolean;
/**
* Permission to delete blobs and files granted.
*/
delete: boolean;
/**
* Permission to delete versions granted.
*/
deleteVersion: boolean;
/**
* Permission to list blob containers, blobs, shares, directories, and files granted.
*/
list: boolean;
/**
* Permission to add messages, table entities, and append to blobs granted.
*/
add: boolean;
/**
* Permission to create blobs and files granted.
*/
create: boolean;
/**
* Permissions to update messages and table entities granted.
*/
update: boolean;
/**
* Permission to get and delete messages granted.
*/
process: boolean;
/**
* Specfies Tag access granted.
*/
tag: boolean;
/**
* Permission to filter blobs.
*/
filter: boolean;
/**
* Permission to set immutability policy.
*/
setImmutabilityPolicy: boolean;
/**
* Specifies that Permanent Delete is permitted.
*/
permanentDelete: boolean;
/**
* Produces the SAS permissions string for an Azure Storage account.
* Call this method to set AccountSASSignatureValues Permissions field.
*
* Using this method will guarantee the resource types are in
* an order accepted by the service.
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
*
*/
toString(): string;
}
/**
* A type that looks like an account SAS permission.
* Used in {@link AccountSASPermissions} to parse SAS permissions from raw objects.
*/
export declare interface AccountSASPermissionsLike {
/**
* Permission to read resources and list queues and tables granted.
*/
read?: boolean;
/**
* Permission to write resources granted.
*/
write?: boolean;
/**
* Permission to delete blobs and files granted.
*/
delete?: boolean;
/**
* Permission to delete versions granted.
*/
deleteVersion?: boolean;
/**
* Permission to list blob containers, blobs, shares, directories, and files granted.
*/
list?: boolean;
/**
* Permission to add messages, table entities, and append to blobs granted.
*/
add?: boolean;
/**
* Permission to create blobs and files granted.
*/
create?: boolean;
/**
* Permissions to update messages and table entities granted.
*/
update?: boolean;
/**
* Permission to get and delete messages granted.
*/
process?: boolean;
/**
* Specfies Tag access granted.
*/
tag?: boolean;
/**
* Permission to filter blobs.
*/
filter?: boolean;
/**
* Permission to set immutability policy.
*/
setImmutabilityPolicy?: boolean;
/**
* Specifies that Permanent Delete is permitted.
*/
permanentDelete?: boolean;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant access to that resource type. Once all the
* values are set, this should be serialized with toString and set as the resources field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but
* the order of the resources is particular and this class guarantees correctness.
*/
export declare class AccountSASResourceTypes {
/**
* Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an
* Error if it encounters a character that does not correspond to a valid resource type.
*
* @param resourceTypes -
*/
static parse(resourceTypes: string): AccountSASResourceTypes;
/**
* Permission to access service level APIs granted.
*/
service: boolean;
/**
* Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.
*/
container: boolean;
/**
* Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.
*/
object: boolean;
/**
* Converts the given resource types to a string.
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
*
*/
toString(): string;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value
* to true means that any SAS which uses these permissions will grant access to that service. Once all the
* values are set, this should be serialized with toString and set as the services field on an
* {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but
* the order of the services is particular and this class guarantees correctness.
*/
export declare class AccountSASServices {
/**
* Creates an {@link AccountSASServices} from the specified services string. This method will throw an
* Error if it encounters a character that does not correspond to a valid service.
*
* @param services -
*/
static parse(services: string): AccountSASServices;
/**
* Permission to access blob resources granted.
*/
blob: boolean;
/**
* Permission to access file resources granted.
*/
file: boolean;
/**
* Permission to access queue resources granted.
*/
queue: boolean;
/**
* Permission to access table resources granted.
*/
table: boolean;
/**
* Converts the given services to a string.
*
*/
toString(): string;
}
/**
* ONLY AVAILABLE IN NODE.JS RUNTIME.
*
* AccountSASSignatureValues is used to generate a Shared Access Signature (SAS) for an Azure Storage account. Once
* all the values here are set appropriately, call {@link generateAccountSASQueryParameters} to obtain a representation
* of the SAS which can actually be applied to blob urls. Note: that both this class and {@link SASQueryParameters}
* exist because the former is mutable and a logical representation while the latter is immutable and used to generate
* actual REST requests.
*
* @see https://learn.microsoft.com/en-us/azure/storage/common/storage-dotnet-shared-access-signature-part-1
* for more conceptual information on SAS
*
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas
* for descriptions of the parameters, including which are required
*/
export declare interface AccountSASSignatureValues {
/**
* If not provided, this defaults to the service version targeted by this version of the library.
*/
version?: string;
/**
* Optional. SAS protocols allowed.
*/
protocol?: SASProtocol;
/**
* Optional. When the SAS will take effect.
*/
startsOn?: Date;
/**
* The time after which the SAS will no longer work.
*/
expiresOn: Date;
/**
* Specifies which operations the SAS user may perform. Please refer to {@link AccountSASPermissions} for help
* constructing the permissions string.
*/
permissions: AccountSASPermissions;
/**
* Optional. IP range allowed.
*/
ipRange?: SasIPRange;
/**
* The values that indicate the services accessible with this SAS. Please refer to {@link AccountSASServices} to
* construct this value.
*/
services: string;
/**
* The values that indicate the resource types accessible with this SAS. Please refer
* to {@link AccountSASResourceTypes} to construct this value.
*/
resourceTypes: string;
/**
* Optional. Encryption scope to use when sending requests authorized with this SAS URI.
*/
encryptionScope?: string;
}
/**
* AnonymousCredential provides a credentialPolicyCreator member used to create
* AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with
* HTTP(S) requests that read public resources or for use with Shared Access
* Signatures (SAS).
*/
export declare class AnonymousCredential extends Credential_2 {
/**
* Creates an {@link AnonymousCredentialPolicy} object.
*
* @param nextPolicy -
* @param options -
*/
create(nextPolicy: RequestPolicy, options: RequestPolicyOptions): AnonymousCredentialPolicy;
}
/**
* AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources
* or for use with Shared Access Signatures (SAS).
*/
export declare class AnonymousCredentialPolicy extends CredentialPolicy {
/**
* Creates an instance of AnonymousCredentialPolicy.
* @param nextPolicy -
* @param options -
*/
constructor(nextPolicy: RequestPolicy, options: RequestPolicyOptions);
}
/** Interface representing a AppendBlob. */
declare interface AppendBlob {
/**
* The Create Append Blob operation creates a new append blob.
* @param contentLength The length of the request.
* @param options The options parameters.
*/
create(contentLength: number, options?: AppendBlobCreateOptionalParams): Promise<AppendBlobCreateResponse_2>;
/**
* The Append Block operation commits a new block of data to the end of an existing append blob. The
* Append Block operation is permitted only if the blob was created with x-ms-blob-type set to
* AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
* @param contentLength The length of the request.
* @param body Initial data
* @param options The options parameters.
*/
appendBlock(contentLength: number, body: coreRestPipeline.RequestBodyType, options?: AppendBlobAppendBlockOptionalParams): Promise<AppendBlobAppendBlockResponse_2>;
/**
* The Append Block operation commits a new block of data to the end of an existing append blob where
* the contents are read from a source url. The Append Block operation is permitted only if the blob
* was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version
* 2015-02-21 version or later.
* @param sourceUrl Specify a URL to the copy source.
* @param contentLength The length of the request.
* @param options The options parameters.
*/
appendBlockFromUrl(sourceUrl: string, contentLength: number, options?: AppendBlobAppendBlockFromUrlOptionalParams): Promise<AppendBlobAppendBlockFromUrlResponse_2>;
/**
* The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version
* 2019-12-12 version or later.
* @param options The options parameters.
*/
seal(options?: AppendBlobSealOptionalParams): Promise<AppendBlobSealResponse>;
}
/** Defines headers for AppendBlob_appendBlockFromUrl operation. */
export declare interface AppendBlobAppendBlockFromUrlHeaders {
/** The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. */
etag?: string;
/** Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. */
lastModified?: Date;
/** If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity. */
contentMD5?: Uint8Array;
/** This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers. */
xMsContentCrc64?: Uint8Array;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above. */
version?: string;
/** UTC date/time value generated by the service that indicates the time at which the response was initiated */
date?: Date;
/** This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes. */
blobAppendOffset?: string;
/** The number of committed blocks present in the blob. This header is returned only for append blobs. */
blobCommittedBlockCount?: number;
/** The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key. */
encryptionKeySha256?: string;
/** Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. */
encryptionScope?: string;
/** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
isServerEncrypted?: boolean;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface AppendBlobAppendBlockFromUrlOptionalParams extends coreClient.OperationOptions {
/** Parameter group */
leaseAccessConditions?: LeaseAccessConditions;
/** Parameter group */
modifiedAccessConditions?: ModifiedAccessConditionsModel;
/** Parameter group */
cpkInfo?: CpkInfo;
/** Parameter group */
sourceModifiedAccessConditions?: SourceModifiedAccessConditions;
/** Parameter group */
appendPositionAccessConditions?: AppendPositionAccessConditions;
/** The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a> */
timeoutInSeconds?: number;
/** 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. */
requestId?: string;
/** Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the default account encryption scope. For more information, see Encryption at Rest for Azure Storage Services. */
encryptionScope?: string;
/** Specify the md5 calculated for the range of bytes that must be read from the copy source. */
sourceContentMD5?: Uint8Array;
/** Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source. */
copySourceAuthorization?: string;
/** Specify the transactional md5 for the body, to be validated by the service. */
transactionalContentMD5?: Uint8Array;
/** Specify the crc64 calculated for the range of bytes that must be read from the copy source. */
sourceContentCrc64?: Uint8Array;
/** Bytes of source data in the specified range. */
sourceRange?: string;
}
/**
* Options to configure the {@link AppendBlobClient.appendBlockFromURL} operation.
*/
export declare interface AppendBlobAppendBlockFromURLOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Conditions to meet when appending append blob blocks.
*/
conditions?: AppendBlobRequestConditions;
/**
* Conditions to meet for the source Azure Blob/File when copying from a URL to the blob.
*/
sourceConditions?: MatchConditions & ModificationConditions;
/**
* An MD5 hash of the append block content from the URI.
* This hash is used to verify the integrity of the append block during transport of the data from the URI.
* When this is specified, the storage service compares the hash of the content that has arrived from the copy-source with this value.
*
* sourceContentMD5 and sourceContentCrc64 cannot be set at same time.
*/
sourceContentMD5?: Uint8Array;
/**
* A CRC64 hash of the append block content from the URI.
* This hash is used to verify the integrity of the append block during transport of the data from the URI.
* When this is specified, the storage service compares the hash of the content that has arrived from the copy-source with this value.
*
* sourceContentMD5 and sourceContentCrc64 cannot be set at same time.
*/
sourceContentCrc64?: Uint8Array;
/**
* Customer Provided Key Info.
*/
customerProvidedKey?: CpkInfo;
/**
* Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to
* encrypt the data provided in the request. If not specified, encryption is performed with the
* default account encryption scope. For more information, see Encryption at Rest for Azure
* Storage Services.
*/
encryptionScope?: string;
/**
* Only Bearer type is supported. Credentials should be a valid OAuth access token to copy source.
*/
sourceAuthorization?: HttpAuthorization;
}
/** Contains response data for the appendBlockFromUrl operation. */
export declare type AppendBlobAppendBlockFromUrlResponse = WithResponse<AppendBlobAppendBlockFromUrlHeaders, AppendBlobAppendBlockFromUrlHeaders>;
/** Contains response data for the appendBlockFromUrl operation. */
declare type AppendBlobAppendBlockFromUrlResponse_2 = AppendBlobAppendBlockFromUrlHeaders;
/** Defines headers for AppendBlob_appendBlock operation. */
export declare interface AppendBlobAppendBlockHeaders {
/** The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. */
etag?: string;
/** Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. */
lastModified?: Date;
/** If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity. */
contentMD5?: Uint8Array;
/** This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers. */
xMsContentCrc64?: Uint8Array;
/** If a client request id header is sent in the request, this header will be present in the response with the same value. */
clientRequestId?: string;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above. */
version?: string;
/** UTC date/time value generated by the service that indicates the time at which the response was initiated */
date?: Date;
/** This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes. */
blobAppendOffset?: string;
/** The number of committed blocks present in the blob. This header is returned only for append blobs. */
blobCommittedBlockCount?: number;
/** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
isServerEncrypted?: boolean;
/** The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key. */
encryptionKeySha256?: string;
/** Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. */
encryptionScope?: string;
/** Error Code */
errorCode?: string;
}
/** Optional parameters. */
declare interface AppendBlobAppendBlockOptionalParams extends coreClient.OperationOptions {
/** Parameter group */
leaseAccessConditions?: LeaseAccessConditions;
/** Parameter group */
modifiedAccessConditions?: ModifiedAccessConditionsModel;
/** Parameter group */
cpkInfo?: CpkInfo;
/** Parameter group */
appendPositionAccessConditions?: AppendPositionAccessConditions;
/** The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a> */
timeoutInSeconds?: number;
/** 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. */
requestId?: string;
/** Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the default account encryption scope. For more information, see Encryption at Rest for Azure Storage Services. */
encryptionScope?: string;
/** Specify the transactional md5 for the body, to be validated by the service. */
transactionalContentMD5?: Uint8Array;
/** Specify the transactional crc64 for the body, to be validated by the service. */
transactionalContentCrc64?: Uint8Array;
}
/**
* Options to configure the {@link AppendBlobClient.appendBlock} operation.
*/
export declare interface AppendBlobAppendBlockOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Conditions to meet when appending append blob blocks.
*/
conditions?: AppendBlobRequestConditions;
/**
* Callback to receive events on the progress of append block operation.
*/
onProgress?: (progress: TransferProgressEvent) => void;
/**
* An MD5 hash of the block content. This hash is used to verify the integrity of the block during transport.
* When this is specified, the storage service compares the hash of the content that has arrived with this value.
*
* transactionalContentMD5 and transactionalContentCrc64 cannot be set at same time.
*/
transactionalContentMD5?: Uint8Array;
/**
* A CRC64 hash of the append block content. This hash is used to verify the integrity of the append block during transport.
* When this is specified, the storage service compares the hash of the content that has arrived with this value.
*
* transactionalContentMD5 and transactionalContentCrc64 cannot be set at same time.
*/
transactionalContentCrc64?: Uint8Array;
/**
* Customer Provided Key Info.
*/
customerProvidedKey?: CpkInfo;
/**
* Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to
* encrypt the data provided in the request. If not specified, encryption is performed with the
* default account encryption scope. For more information, see Encryption at Rest for Azure
* Storage Services.
*/
encryptionScope?: string;
}
/** Contains response data for the appendBlock operation. */
export declare type AppendBlobAppendBlockResponse = WithResponse<AppendBlobAppendBlockHeaders, AppendBlobAppendBlockHeaders>;
/** Contains response data for the appendBlock operation. */
declare type AppendBlobAppendBlockResponse_2 = AppendBlobAppendBlockHeaders;
/**
* AppendBlobClient defines a set of operations applicable to append blobs.
*/
export declare class AppendBlobClient extends BlobClient {
/**
* appendBlobsContext provided by protocol layer.
*/
private appendBlobContext;
/**
*
* Creates an instance of AppendBlobClient.
*
* @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
* Account connection string example -
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
* SAS connection string example -
* `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`
* @param containerName - Container name.
* @param blobName - Blob name.
* @param options - Optional. Options to configure the HTTP pipeline.
*/
constructor(connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions);
/**
* Creates an instance of AppendBlobClient.
* This method accepts an encoded URL or non-encoded URL pointing to an append blob.
* Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
* If a blob name includes ? or %, blob name must be encoded in the URL.
*
* @param url - A URL string pointing to Azure Storage append blob, such as
* "https://myaccount.blob.core.windows.net/mycontainer/appendblob". You can
* append a SAS if using AnonymousCredential, such as
* "https://myaccount.blob.core.windows.net/mycontainer/appendblob?sasString".
* This method accepts an encoded URL or non-encoded URL pointing to a blob.
* Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
* However, if a blob name includes ? or %, blob name must be encoded in the URL.
* Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25".
* @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
* @param options - Optional. Options to configure the HTTP pipeline.
*/
constructor(url: string, credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions);
/**
* Creates an instance of AppendBlobClient.
* This method accepts an encoded URL or non-encoded URL pointing to an append blob.
* Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
* If a blob name includes ? or %, blob name must be encoded in the URL.
*
* @param url - A URL string pointing to Azure Storage append blob, such as
* "https://myaccount.blob.core.windows.net/mycontainer/appendblob". You can
* append a SAS if using AnonymousCredential, such as
* "https://myaccount.blob.core.windows.net/mycontainer/appendblob?sasString".
* This method accepts an encoded URL or non-encoded URL pointing to a blob.
* Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped.
* However, if a blob name includes ? or %, blob name must be encoded in the URL.
* Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25".
* @param pipeline - Call newPipeline() to create a default
* pipeline, or provide a customized pipeline.
*/
constructor(url: string, pipeline: PipelineLike);
/**
* Creates a new AppendBlobClient object identical to the source but with the
* specified snapshot timestamp.
* Provide "" will remove the snapshot and return a Client to the base blob.
*
* @param snapshot - The snapshot timestamp.
* @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.
*/
withSnapshot(snapshot: string): AppendBlobClient;
/**
* Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
* @see https://learn.microsoft.com/rest/api/storageservices/put-blob
*
* @param options - Options to the Append Block Create operation.
*
*
* Example usage:
*
* ```js
* const appendBlobClient = containerClient.getAppendBlobClient("<blob name>");
* await appendBlobClient.create();
* ```
*/
create(options?: AppendBlobCreateOptions): Promise<AppendBlobCreateResponse>;
/**
* Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
* If the blob with the same name already exists, the content of the existing blob will remain unchanged.
* @see https://learn.microsoft.com/rest/api/storageservices/put-blob
*
* @param options -
*/
createIfNotExists(options?: AppendBlobCreateIfNotExistsOptions): Promise<AppendBlobCreateIfNotExistsResponse>;
/**
* Seals the append blob, making it read only.
*
* @param options -
*/
seal(options?: AppendBlobSealOptions): Promise<AppendBlobAppendBlockResponse>;
/**
* Commits a new block of data to the end of the existing append blob.
* @see https://learn.microsoft.com/rest/api/storageservices/append-block
*
* @param body - Data to be appended.
* @param contentLength - Length of the body in bytes.
* @param options - Options to the Append Block operation.
*
*
* Example usage:
*
* ```js
* const content = "Hello World!";
*
* // Create a new append blob and append data to the blob.
* const newAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
* await newAppendBlobClient.create();
* await newAppendBlobClient.appendBlock(content, content.length);
*
* // Append data to an existing append blob.
* const existingAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
* await existingAppendBlobClient.appendBlock(content, content.length);
* ```
*/
appendBlock(body: HttpRequestBody, contentLength: number, options?: AppendBlobAppendBlockOptions): Promise<AppendBlobAppendBlockResponse>;
/**
* The Append Block operation commits a new block of data to the end of an existing append blob
* where the contents are read from a source url.
* @see https://learn.microsoft.com/en-us/rest/api/storageservices/append-block-from-url
*
* @param sourceURL -
* The url to the blob that will be the source of the copy. A source blob in the same storage account can
* be authenticated via Shared Key. However, if the source is a blob in another account, the source blob
* must either be public or must be authenticated via a shared access signature. If the source blob is
* public, no authentication is required to perform the operation.
* @param sourceOffset - Offset in source to be appended
* @param count - Number of bytes to be appended as a block
* @param options -
*/
appendBlockFromURL(sourceURL: string, sourceOffset: number, count: number, options?: AppendBlobAppendBlockFromURLOptions): Promise<AppendBlobAppendBlockFromUrlResponse>;
}
/** Defines headers for AppendBlob_create operation. */
export declare interface AppendBlobCreateHeaders {
/** The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. */
etag?: string;
/** Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. */
lastModified?: Date;
/** If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity. */
contentMD5?: Uint8Array;
/** If a client request id header is sent in the request, this header will be present in the response with the same value. */
clientRequestId?: string;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above. */
version?: string;
/** A DateTime value returned by the service that uniquely identifies the blob. The value of this header indicates the blob version, and may be used in subsequent requests to access this version of the blob. */
versionId?: string;
/** UTC date/time value generated by the service that indicates the time at which the response was initiated */
date?: Date;
/** The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. */
isServerEncrypted?: boolean;
/** The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key. */
encryptionKeySha256?: string;
/** Returns the name of the encryption scope used to encrypt the blob contents and application metadata. Note that the absence of this header implies use of the default account encryption scope. */
encryptionScope?: string;
/** Error Code */
errorCode?: string;
}
/**
* Options to configure {@link AppendBlobClient.createIfNotExists} operation.
*/
export declare interface AppendBlobCreateIfNotExistsOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* HTTP headers to set when creating append blobs. A common header to set is
* `blobContentType`, enabling the browser to provide functionality
* based on file type.
*
*/
blobHTTPHeaders?: BlobHTTPHeaders;
/**
* A collection of key-value string pair to associate with the blob when creating append blobs.
*/
metadata?: Metadata;
/**
* Customer Provided Key Info.
*/
customerProvidedKey?: CpkInfo;
/**
* Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to
* encrypt the data provided in the request. If not specified, encryption is performed with the
* default account encryption scope. For more information, see Encryption at Rest for Azure
* Storage Services.
*/
encryptionScope?: string;
/**
* Optional. Specifies immutability policy for a blob.
* Note that is parameter is only applicable to a blob within a container that
* has version level worm enabled.
*/
immutabilityPolicy?: BlobImmutabilityPolicy;
/**
* Optional. Indicates if a legal hold should be placed on the blob.
* Note that is parameter is only applicable to a blob within a container that
* has version level worm enabled.
*/
legalHold?: boolean;
}
/**
* Contains response data for the {@link appendBlobClient.createIfNotExists} operation.
*/
export declare interface AppendBlobCreateIfNotExistsResponse extends AppendBlobCreateResponse {
/**
* Indicate whether the blob is successfully created. Is false when the blob is not changed as it already exists.
*/
succeeded: boolean;
}
/** Optional parameters. */
declare interface AppendBlobCreateOptionalParams extends coreClient.OperationOptions {
/** Parameter group */
leaseAccessConditions?: LeaseAccessConditions;
/** Parameter group */
modifiedAccessConditions?: ModifiedAccessConditionsModel;
/** Parameter group */
cpkInfo?: CpkInfo;
/** Parameter group */
blobHttpHeaders?: BlobHTTPHeaders;
/** The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a> */
timeoutInSeconds?: number;
/** 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. */
requestId?: string;
/** Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. */
metadata?: {
[propertyName: string]: string;
};
/** Specifies the date time when the blobs immutability policy is set to expire. */
immutabilityPolicyExpiry?: Date;
/** Specifies the immutability policy mode to set on the blob. */
immutabilityPolicyMode?: BlobImmutabilityPolicyMode;
/** Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the default account encryption scope. For more information, see Encryption at Rest for Azure Storage Services. */
encryptionScope?: string;
/** Optional. Used to set blob tags in various blob operations. */
blobTagsString?: string;
/** Specified if a legal hold should be set on the blob. */
legalHold?: boolean;
}
/**
* Options to configure {@link AppendBlobClient.create} operation.
*/
export declare interface AppendBlobCreateOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Conditions to meet when creating append blobs.
*/
conditions?: BlobRequestConditions;
/**
* HTTP headers to set when creating append blobs. A common header
* to set is `blobContentType`, enabling the browser to provide functionality
* based on file type.
*
*/
blobHTTPHeaders?: BlobHTTPHeaders;
/**
* A collection of key-value string pair to associate with the blob when creating append blobs.
*/
metadata?: Metadata;
/**
* Customer Provided Key Info.
*/
customerProvidedKey?: CpkInfo;
/**
* Optional. Version 2019-07-07 and later. Specifies the name of the encryption scope to use to
* encrypt the data provided in the request. If not specified, encryption is performed with the
* default account encryption scope. For more information, see Encryption at Rest for Azure
* Storage Services.
*/
encryptionScope?: string;
/**
* Optional. Specifies immutability policy for a blob.
* Note that is parameter is only applicable to a blob within a container that
* has version level worm enabled.
*/
immutabilityPolicy?: BlobImmutabilityPolicy;
/**
* Optional. Indicates if a legal hold should be placed on the blob.
* Note that is parameter is only applicable to a blob within a container that
* has version level worm enabled.
*/
legalHold?: boolean;
/**
* Blob tags.
*/
tags?: Tags;
}
/** Contains response data for the create operation. */
export declare type AppendBlobCreateResponse = WithResponse<AppendBlobCreateHeaders, AppendBlobCreateHeaders>;
/** Contains response data for the create operation. */
declare type AppendBlobCreateResponse_2 = AppendBlobCreateHeaders;
/**
* Conditions to add to the creation of this append blob.
*/
export declare interface AppendBlobRequestConditions extends BlobRequestConditions, AppendPositionAccessConditions {
}
/** Defines headers for AppendBlob_seal operation. */
declare interface AppendBlobSealHeaders {
/** The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. */
etag?: string;
/** Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. */
lastModified?: Date;
/** If a client request id header is sent in the request, this header will be present in the response with the same value. */
clientRequestId?: string;
/** This header uniquely identifies the request that was made and can be used for troubleshooting the request. */
requestId?: string;
/** Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above. */
version?: string;
/** UTC date/time value generated by the service that indicates the time at which the response was initiated */
date?: Date;
/** If this blob has been sealed */
isSealed?: boolean;
}
/** Optional parameters. */
declare interface AppendBlobSealOptionalParams extends coreClient.OperationOptions {
/** Parameter group */
leaseAccessConditions?: LeaseAccessConditions;
/** Parameter group */
modifiedAccessConditions?: ModifiedAccessConditionsModel;
/** Parameter group */
appendPositionAccessConditions?: AppendPositionAccessConditions;
/** The timeout parameter is expressed in seconds. For more information, see <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting Timeouts for Blob Service Operations.</a> */
timeoutInSeconds?: number;
/** 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. */
requestId?: string;
}
/**
* Options to configure {@link AppendBlobClient.seal} operation.
*/
export declare interface AppendBlobSealOptions extends CommonOptions {
/**
* An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
* For example, use the @azure/abort-controller to create an `AbortSignal`.
*/
abortSignal?: AbortSignalLike;
/**
* Conditions to meet.
*/
conditions?: AppendBlobRequestConditions;
}
/** Contains response data for the seal operation. */
declare type AppendBlobSealResponse = AppendBlobSealHeaders;
/** Parameter group */
export declare interface AppendPositionAccessConditions {
/** Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed). */
maxSize?: number;
/** Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed). */
appendPosition?: number;
}
/** Defines values for ArchiveStatus. */
export declare type ArchiveStatus = "rehydrate-pending-to-hot" | "rehydrate-pending-to-cool" | "rehydrate-pending-to-cold";
/** Groups the settings used for formatting the response if the response should be Arrow formatted. */
declare interface ArrowConfiguration {
schema: ArrowField[];
}
/** Groups settings regarding specific field of an arrow schema */
declar