Package @google-cloud/storage (7.16.0) Stay organized with collections Save and categorize content based on your preferences.
Classes
ApiError
Custom error type for API errors.
Bucket
Create a Bucket object to interact with a Cloud Storage bucket.
Channel
Create a channel object to interact with a Cloud Storage channel.
CRC32C
File_2
A File object is created from yourBucket object using .
HashStreamValidator
HmacKey
An HmacKey object contains metadata of an HMAC key created from a service account through the client using .
Iam
Get and set IAM policies for your Cloud Storage bucket.
SeeCloud Storage IAM Management SeeGranting, Changing, and Revoking Access SeeIAM Roles
Iam
MultiPartUploadError
Notification
A Notification object is created from yourBucket object using . Use it to interact with Cloud Pub/Sub notifications.
Storage_2
ACLs
Cloud Storage uses access control lists (ACLs) to manage object and bucket access. ACLs are the mechanism you use to share files with other users and allow other users to access your buckets and files.To learn more about ACLs, read this overview onAccess Control.
TransferManager
Create a TransferManager object to perform parallel transfer operations on a Cloud Storage bucket.
Interfaces
AccessControlObject
AclMetadata
AclOptions
AddAclCallback
AddAclOptions
BucketCallback
BucketExistsOptions
BucketLockCallback
BucketMetadata
BucketOptions
CombineCallback
CombineOptions
CopyCallback
CopyOptions
CRC32CValidator
An interface for CRC32C hashing and validation
CRC32CValidatorGenerator
A function that generates a CRC32C Validator
CreateBucketQuery
CreateBucketRequest
CreateChannelCallback
CreateChannelConfig
CreateChannelOptions
CreateHmacKeyCallback
CreateHmacKeyOptions
CreateNotificationCallback
CreateNotificationOptions
CreateReadStreamOptions
CreateResumableUploadCallback
CreateResumableUploadOptions
CreateWriteStreamOptions
DeleteBucketCallback
DeleteBucketOptions
DeleteFileCallback
DeleteFileOptions
DeleteFilesCallback
DeleteFilesOptions
DeleteNotificationCallback
DeleteNotificationCallback
DeleteNotificationOptions
DisableRequesterPaysCallback
DownloadFileInChunksOptions
DownloadManyFilesOptions
DownloadOptions
EnableRequesterPaysCallback
EncryptionKeyOptions
FileExistsCallback
FileExistsOptions
FileMetadata
FileOptions
GenerateSignedPostPolicyV2Callback
GenerateSignedPostPolicyV2Options
GenerateSignedPostPolicyV4Callback
GenerateSignedPostPolicyV4Options
GetAclCallback
GetAclOptions
GetBucketCallback
GetBucketMetadataCallback
GetBucketMetadataOptions
GetBucketOptions
GetBucketsCallback
GetBucketSignedUrlConfig
GetBucketsRequest
GetExpirationDateCallback
GetFileCallback
GetFileMetadataCallback
GetFileMetadataOptions
GetFileOptions
GetFilesCallback
GetFilesOptions
GetHmacKeysCallback
GetHmacKeysOptions
GetLabelsCallback
GetLabelsOptions
GetNotificationCallback
GetNotificationCallback
GetNotificationMetadataCallback
GetNotificationMetadataCallback
GetNotificationMetadataOptions
GetNotificationOptions
GetNotificationsCallback
GetNotificationsOptions
GetPolicyCallback
GetPolicyCallback
GetPolicyOptions
GetServiceAccountCallback
GetServiceAccountOptions
GetSignedUrlCallback
GetSignedUrlConfig
HashStreamValidatorOptions
HmacKeyMetadata
HmacKeyMetadataCallback
HmacKeyResourceResponse
Labels
LifecycleAction
LifecycleCondition
LifecycleRule
MakeBucketPrivateCallback
MakeBucketPrivateOptions
MakeBucketPublicCallback
MakeBucketPublicOptions
MakeFilePrivateOptions
MakeFilePublicCallback
MoveCallback
MoveOptions
MultiPartUploadHelper
NotificationMetadata
Policy
PolicyDocument
PolicyFields
PreconditionOptions
RemoveAclCallback
RemoveAclOptions
SaveCallback
SaveOptions
ServiceAccount
SetBucketMetadataCallback
SetBucketMetadataOptions
SetBucketStorageClassCallback
SetBucketStorageClassOptions
SetFileMetadataCallback
SetFileMetadataOptions
SetHmacKeyMetadata
SetHmacKeyMetadataOptions
SetLabelsCallback
SetLabelsOptions
SetPolicyCallback
SetPolicyCallback
SetPolicyOptions
{object} SetPolicyOptions
SetStorageClassCallback
SetStorageClassOptions
SignedPostPolicyV4Output
StopCallback
StorageOptions
TestIamPermissionsCallback
TestIamPermissionsCallback
TestIamPermissionsOptions
{object} TestIamPermissionsOptions Configuration options for Iam#testPermissions().
UpdateAclCallback
UpdateAclOptions
UploadCallback
UploadFileInChunksOptions
UploadManyFilesOptions
UploadOptions
Enums
IdempotencyStrategy
Variables
CRC32C_DEFAULT_VALIDATOR_GENERATOR
CRC32C_DEFAULT_VALIDATOR_GENERATOR:CRC32CValidatorGeneratorCRC32C_EXCEPTION_MESSAGES
CRC32C_EXCEPTION_MESSAGES:{readonlyINVALID_INIT_BASE64_RANGE:(l:number)=>string;readonlyINVALID_INIT_BUFFER_LENGTH:(l:number)=>string;readonlyINVALID_INIT_INTEGER:(l:number)=>string;}CRC32C_EXTENSION_TABLE
CRC32C_EXTENSION_TABLE:Int32ArrayCRC32C_EXTENSIONS
CRC32C_EXTENSIONS:readonly[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697]Ported from
Functions
RETRYABLE_ERR_FN_DEFAULT(err)
RETRYABLE_ERR_FN_DEFAULT:(err?:ApiError)=>booleanReturns true if the API request should be retried, given the error that was given the first time the request was attempted.
| Parameter | |
|---|---|
| Name | Description |
err | ApiErrorThe API error to check if it is appropriate to retry. {boolean} True if the API request should be retried, false otherwise. |
| Returns | |
|---|---|
| Type | Description |
boolean | |
Type Aliases
AddAclResponse
exporttypeAddAclResponse=[AccessControlObject,AclMetadata];BucketExistsCallback
exporttypeBucketExistsCallback=ExistsCallback;BucketExistsResponse
exporttypeBucketExistsResponse=[boolean];BucketLockResponse
exporttypeBucketLockResponse=[unknown];CombineResponse
exporttypeCombineResponse=[File,unknown];CopyResponse
exporttypeCopyResponse=[File,unknown];CreateBucketResponse
exporttypeCreateBucketResponse=[Bucket,unknown];CreateChannelResponse
exporttypeCreateChannelResponse=[Channel,unknown];CreateHmacKeyResponse
exporttypeCreateHmacKeyResponse=[HmacKey,string,HmacKeyResourceResponse];CreateNotificationResponse
exporttypeCreateNotificationResponse=[Notification,unknown];CreateResumableUploadResponse
exporttypeCreateResumableUploadResponse=[string];DeleteBucketResponse
exporttypeDeleteBucketResponse=[unknown];DeleteFileResponse
exporttypeDeleteFileResponse=[unknown];DeleteLabelsCallback
exporttypeDeleteLabelsCallback=SetLabelsCallback;DeleteLabelsResponse
exporttypeDeleteLabelsResponse=[unknown];DisableRequesterPaysResponse
exporttypeDisableRequesterPaysResponse=[unknown];DownloadCallback
exporttypeDownloadCallback=(err:RequestError|null,contents:Buffer)=>void;DownloadResponse
exporttypeDownloadResponse=[Buffer];EnableRequesterPaysResponse
exporttypeEnableRequesterPaysResponse=[unknown];FileExistsResponse
exporttypeFileExistsResponse=[boolean];GenerateSignedPostPolicyV2Response
exporttypeGenerateSignedPostPolicyV2Response=[PolicyDocument];GenerateSignedPostPolicyV4Response
exporttypeGenerateSignedPostPolicyV4Response=[SignedPostPolicyV4Output];GetAclResponse
exporttypeGetAclResponse=[AccessControlObject|AccessControlObject[],AclMetadata];GetBucketMetadataResponse
exporttypeGetBucketMetadataResponse=[BucketMetadata,unknown];GetBucketResponse
exporttypeGetBucketResponse=[Bucket,unknown];GetBucketsResponse
exporttypeGetBucketsResponse=[Bucket[],{},unknown];GetExpirationDateResponse
exporttypeGetExpirationDateResponse=[Date];GetFileMetadataResponse
exporttypeGetFileMetadataResponse=[FileMetadata,unknown];GetFileResponse
exporttypeGetFileResponse=[File,unknown];GetFilesResponse
exporttypeGetFilesResponse=[File[],(GetFilesOptions|{}) &Partial<>GetHmacKeysResponse
exporttypeGetHmacKeysResponse=[HmacKey[]];GetLabelsResponse
exporttypeGetLabelsResponse=[unknown];GetNotificationMetadataResponse
exporttypeGetNotificationMetadataResponse=[ResponseBody,unknown];{array} GetNotificationMetadataResponse {object} 0 The notification metadata. {object} 1 The full API response.
GetNotificationResponse
exporttypeGetNotificationResponse=[Notification,unknown];{array} GetNotificationResponse {Notification} 0 TheNotification {object} 1 The full API response.
GetNotificationsResponse
exporttypeGetNotificationsResponse=[Notification[],unknown];GetPolicyResponse
exporttypeGetPolicyResponse=[Policy,unknown];GetServiceAccountResponse
exporttypeGetServiceAccountResponse=[ServiceAccount,unknown];GetSignedUrlResponse
exporttypeGetSignedUrlResponse=[SignerGetSignedUrlResponse];HmacKeyMetadataResponse
exporttypeHmacKeyMetadataResponse=[HmacKeyMetadata,unknown];MakeBucketPrivateResponse
exporttypeMakeBucketPrivateResponse=[File[]];MakeBucketPublicResponse
exporttypeMakeBucketPublicResponse=[File[]];MakeFilePrivateCallback
exporttypeMakeFilePrivateCallback=SetFileMetadataCallback;MakeFilePrivateResponse
exporttypeMakeFilePrivateResponse=[unknown];MakeFilePublicResponse
exporttypeMakeFilePublicResponse=[unknown];MoveFileAtomicCallback
exporttypeMoveFileAtomicCallback=MoveCallback;MoveFileAtomicOptions
exporttypeMoveFileAtomicOptions=MoveOptions;MoveFileAtomicResponse
exporttypeMoveFileAtomicResponse=MoveResponse;MoveResponse
exporttypeMoveResponse=[unknown];MultiPartHelperGenerator
exporttypeMultiPartHelperGenerator=(bucket:Bucket,fileName:string,uploadId?:string,partsMap?:MapPredefinedAcl
exporttypePredefinedAcl='authenticatedRead'|'bucketOwnerFullControl'|'bucketOwnerRead'|'private'|'projectPrivate'|'publicRead';RemoveAclResponse
exporttypeRemoveAclResponse=[AclMetadata];RotateEncryptionKeyCallback
exporttypeRotateEncryptionKeyCallback=CopyCallback;RotateEncryptionKeyOptions
exporttypeRotateEncryptionKeyOptions=string|Buffer|EncryptionKeyOptions;RotateEncryptionKeyResponse
exporttypeRotateEncryptionKeyResponse=CopyResponse;SaveData
exporttypeSaveData=string|Buffer|Uint8Array|PipelineSourceSetBucketMetadataResponse
exporttypeSetBucketMetadataResponse=[BucketMetadata];SetFileMetadataResponse
exporttypeSetFileMetadataResponse=[unknown];SetLabelsResponse
exporttypeSetLabelsResponse=[unknown];SetPolicyResponse
exporttypeSetPolicyResponse=[Policy,unknown];{array} SetPolicyResponse {object} 0 The policy. {object} 1 The full API response.
SetStorageClassResponse
exporttypeSetStorageClassResponse=[unknown];TestIamPermissionsResponse
exporttypeTestIamPermissionsResponse=[{[key:string]:boolean;},unknown];{array} TestIamPermissionsResponse {object} 0 A subset of permissions that the caller is allowed. {object} 1 The full API response.
UpdateAclResponse
exporttypeUpdateAclResponse=[AccessControlObject,AclMetadata];UploadResponse
exporttypeUploadResponse=[File,unknown];Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.