Send feedback Class Storage (5.8.5) Stay organized with collections Save and categorize content based on your preferences. Version 5.8.5keyboard_arrow_down
Inheritance Service > Storage Package @google-cloud/storage! Constructors (constructor)(options)
constructor ( options ?: StorageOptions ); Constructs the Storage client.
Parameter Properties acl Reference to .
Storage#acl Storage.acl
Property Value acl
static acl : { OWNER_ROLE : string ; READER_ROLE : string ; WRITER_ROLE : string ; }; Property Value Type Description { OWNER_ROLE: string; READER_ROLE: string; WRITER_ROLE: string; }
Bucket
static Bucket : typeof Bucket ; Bucket class.
Storage.Bucket Bucket {Constructor}
Property Value Type Description typeofBucket
Channel
static Channel : typeof Channel ; Channel class.
Storage.Channel Channel {Constructor}
Property Value Type Description typeofChannel
File File class.
Storage.File File {Constructor}
Property Value Type Description typeofFile
getBucketsStream
getBucketsStream : () = >Readable ; Property Value Type Description () =>internal.Readable
getHmacKeysStream
getHmacKeysStream : () = >Readable ; Property Value Type Description () =>internal.Readable
HmacKey
static HmacKey : typeof HmacKey ; HmacKey class.
Storage.HmacKey HmacKey {Constructor}
Property Value Methods bucket(name, options)
bucket ( name : string , options ?: BucketOptions ) : Bucket ; Get a reference to a Cloud Storage bucket.
Parameters Name Description name string Name of the bucket.
options BucketOptions Configuration object.
Returns Type Description Bucket {Bucket} Bucket
channel(id, resourceId)
channel ( id : string , resourceId : string ) : Channel ; Reference a channel to receive notifications about changes to your bucket.
Parameters Name Description id string The ID of the channel.
resourceId string The resource ID of the channel.
Returns Type Description Channel {Channel} Channel
createBucket(name, metadata)
createBucket ( name : string , metadata ?: CreateBucketRequest ) : Promise<CreateBucketResponse> ; Parameters Returns Type Description Promise <CreateBucketResponse >
createBucket(name, callback)
createBucket ( name : string , callback : BucketCallback ) : void ; Parameters Returns createBucket(name, metadata, callback)
createBucket ( name : string , metadata : CreateBucketRequest , callback : BucketCallback ) : void ; Parameters Returns createBucket(name, metadata, callback)
createBucket ( name : string , metadata : CreateBucketRequest , callback : BucketCallback ) : void ; Parameters Returns createHmacKey(serviceAccountEmail, options)
createHmacKey ( serviceAccountEmail : string , options ?: CreateHmacKeyOptions ) : Promise<CreateHmacKeyResponse> ; Parameters Returns Type Description Promise <CreateHmacKeyResponse >
createHmacKey(serviceAccountEmail, callback)
createHmacKey ( serviceAccountEmail : string , callback : CreateHmacKeyCallback ) : void ; Parameters Returns createHmacKey(serviceAccountEmail, options, callback)
createHmacKey ( serviceAccountEmail : string , options : CreateHmacKeyOptions , callback : CreateHmacKeyCallback ) : void ; Parameters Returns getBuckets(options)
getBuckets ( options ?: GetBucketsRequest ) : Promise<GetBucketsResponse> ; Parameter Returns Type Description Promise <GetBucketsResponse >
getBuckets(options, callback)
getBuckets ( options : GetBucketsRequest , callback : GetBucketsCallback ) : void ; Parameters Returns getBuckets(callback)
getBuckets ( callback : GetBucketsCallback ) : void ; Parameter Returns getHmacKeys(options)
getHmacKeys ( options ?: GetHmacKeysOptions ) : Promise<GetHmacKeysResponse> ; Retrieves a list of HMAC keys matching the criteria.
The authenticated user must have storage.hmacKeys.list permission for the project in which the key exists.
Parameter Returns Type Description Promise <GetHmacKeysResponse >
getHmacKeys(callback)
getHmacKeys ( callback : GetHmacKeysCallback ) : void ; Parameter Returns getHmacKeys(options, callback)
getHmacKeys ( options : GetHmacKeysOptions , callback : GetHmacKeysCallback ) : void ; Parameters Returns getServiceAccount(options)
getServiceAccount ( options ?: GetServiceAccountOptions ) : Promise<GetServiceAccountResponse> ; Parameter Returns Type Description Promise <GetServiceAccountResponse >
getServiceAccount(options)
getServiceAccount ( options ?: GetServiceAccountOptions ) : Promise<GetServiceAccountResponse> ; Parameter Returns Type Description Promise <GetServiceAccountResponse >
getServiceAccount(options, callback)
getServiceAccount ( options : GetServiceAccountOptions , callback : GetServiceAccountCallback ) : void ; Parameters Returns getServiceAccount(callback)
getServiceAccount ( callback : GetServiceAccountCallback ) : void ; Parameter Returns hmacKey(accessId, options)
hmacKey ( accessId : string , options ?: HmacKeyOptions ) : HmacKey ; Get a reference to an HmacKey object. Note: this does not fetch the HMAC key's metadata. Use HmacKey#get() to retrieve and populate the metadata.
To get a reference to an HMAC key that's not created for a service account in the same project used to instantiate the Storage client, supply the project's ID asprojectId in theoptions argument.
Parameters Name Description accessId string The HMAC key's access ID.
options HmacKeyOptions HmacKey constructor owptions.
Returns Type Description HmacKey {HmacKey} HmacKey
Send feedback
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.
Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]