Send feedback
Class Storage (5.11.1) Stay organized with collections
Save and categorize content based on your preferences.
Version 5.11.1 keyboard_arrow_down
Inheritance
Service
>
Storage
Package
@google-cloud/storage!
Constructors
(constructor)(options)
constructor
(
options
?:
StorageOptions
);
Constructs the Storage client.
Parameter
Properties
acl
acl
:
typeof
Storage
.
acl
;
Reference to .
Storage#acl Storage.acl
Property Value
acl
static
acl
:
{
OWNER_ROLE
:
string
;
READER_ROLE
:
string
;
WRITER_ROLE
:
string
;
};
Property Value
Bucket
static
Bucket
:
typeof
Bucket
;
Bucket
class.
Storage.Bucket Bucket {Constructor}
Property Value
Channel
static
Channel
:
typeof
Channel
;
Channel
class.
Storage.Channel Channel {Constructor}
Property Value
File
static
File
:
typeof
File
;
File
class.
Storage.File File {Constructor}
Property Value
getBucketsStream
getBucketsStream
:
()
=
>
Readable
;
Property Value
getHmacKeysStream
getHmacKeysStream
:
()
=
>
Readable
;
Property Value
HmacKey
static
HmacKey
:
typeof
HmacKey
;
HmacKey
class.
Storage.HmacKey HmacKey {Constructor}
Property Value
retryOptions
retryOptions
:
RetryOptions
;
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
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
createBucket(name, metadata)
createBucket
(
name
:
string
,
metadata
?:
CreateBucketRequest
)
:
Promise<CreateBucketResponse>
;
Parameters
Returns
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
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
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
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
getServiceAccount(options)
getServiceAccount
(
options
?:
GetServiceAccountOptions
)
:
Promise<GetServiceAccountResponse>
;
Parameter
Returns
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 as projectId
in the options
argument.
Parameters Name
Description
accessId
string
The HMAC key's access ID.
options
HmacKeyOptions
HmacKey constructor owptions.
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-04 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-09-04 UTC."],[],[],null,[]]