Resource name of the Cloud KMS key, of the formprojects/my-project/locations/location/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overwrites the object metadata's kms_key_name value, if any.
userProject
string
The ID of the project which will be billed for the request.
Configuration options for File#copy(). See anObject resource.
Properties:
Name
Type
Attributes
Description
cacheControl
string
The cacheControl setting for the new file.
contentEncoding
string
The contentEncoding setting for the new file.
contentType
string
The contentType setting for the new file.
destinationKmsKeyName
string
Resource name of the Cloud KMS key, of the formprojects/my-project/locations/location/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overwrites the object metadata's kms_key_name value, if any.
metadata
Metadata
Metadata to specify on the copied file.
predefinedAcl
string
Set the ACL for the new file.
token
string
A previously-returned rewriteToken from an unfinished rewrite request.
userProject
string
The ID of the project which will be billed for the request.
Specify whether Autoclass is enabled for the bucket.
autoclass.terminalStorageClass
object
'NEARLINE'
The storage class that objects in an Autoclass bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE.
Specify the bucket's regions for dual-region buckets. For more information, see Bucket Locations.
dra
boolean
false
Specify the storage class as Durable Reduced Availability.
enableObjectRetention
boolean
false
Specifiy whether or not object retention should be enabled on this bucket.
hierarchicalNamespace.enabled
object
false
Specify whether or not to enable hierarchical namespace on this bucket.
location
string
Specify the bucket's location. If specifying a dual-region, the customPlacementConfig property should be set in conjunction. For more information, see Bucket Locations.
multiRegional
boolean
false
Specify the storage class as Multi-Regional.
nearline
boolean
false
Specify the storage class as Nearline.
regional
boolean
false
Specify the storage class as Regional.
requesterPays
boolean
false
Force the use of the User Project metadata field to assign operational costs when an operation is made on a Bucket and its objects.
rpo
string
For dual-region buckets, controls whether turbo replication is enabled (ASYNC_TURBO) or disabled (DEFAULT).
standard
boolean
true
Specify the storage class as Standard.
storageClass
string
The new storage class. (standard,nearline, coldline, or archive).Note: The storage classes multi_regional, regional, anddurable_reduced_availability are now legacy and will be deprecated in the future.
versioning
Versioning
Specify the versioning status.
userProject
string
The ID of the project which will be billed for the request.
The project ID of the project that owns the service account of the requested HMAC key. If not provided, the project ID used to instantiate the Storage client will be used.
The ID of the project which will be billed for the request.
validation
string | boolean
Possible values: "md5","crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended.
start
number
A byte offset to begin the file's download from. Default is 0. NOTE: Byte ranges are inclusive; that is,options.start = 0 and options.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.
end
number
A byte offset to stop reading the file at. NOTE: Byte ranges are inclusive; that is, options.start = 0 andoptions.end = 999 represent the first 1000 bytes in a file or object. NOTE: when specifying a byte range, data integrity is not available.
decompress
boolean
true
Disable auto decompression of the received data. By default this option is set to true. Applicable in cases where the data was uploaded withgzip: true option. See File#createWriteStream.
CreateResumableUploadCallback(errnullable, uri)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
uri
string
The resumable upload's unique session URI.
CreateResumableUploadOptions
Properties:
Name
Type
Attributes
Description
metadata
object
Metadata to set on the file.
offset
number
The starting byte of the upload stream for resuming an interrupted upload.
origin
string
Origin header to set for the upload.
predefinedAcl
string
Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers get READER access. bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. private - Object owner gets OWNER access. projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. publicRead - Object owner gets OWNER access, and allUsersget READER access.
private
boolean
Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public
boolean
Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
userProject
string
The ID of the project which will be billed for the request.
Configuration options for File#createWriteStream().
Properties:
Name
Type
Attributes
Default
Description
contentType
string
Alias foroptions.metadata.contentType. If set to auto, the file name is used to determine the contentType.
gzip
string | boolean
If true, automatically gzip the file. If set to auto, the contentType is used to determine if the file should be gzipped. This will set options.metadata.contentEncoding togzip if necessary.
The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
predefinedAcl
string
Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers get READER access. bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. private - Object owner gets OWNER access. projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. publicRead - Object owner gets OWNER access, and allUsersget READER access.
private
boolean
Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public
boolean
Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
resumable
boolean
Force a resumable upload. NOTE: When working with streams, the file format and size is unknown until it's completely consumed. Because of this, it's best for you to be explicit for what makes sense given your input.
timeout
number
60000
Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000
The ID of the project which will be billed for the request.
validation
string | boolean
Possible values: "md5","crc32c", or false. By default, data integrity is validated with a CRC32c checksum. You may use MD5 if preferred, but that hash is not supported for composite objects. An error will be raised if MD5 is specified but is not available. You may also choose to skip validation completely, however this is not recommended. In addition to specifying validation type, providing metadata.crc32c or metadata.md5Hash will cause the server to perform validation in addition to client validation. NOTE: Validation is automatically skipped for objects that were uploaded using the gzip option and have already compressed content.
DeleteBucketCallback(errnullable, apiResponse)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
apiResponse
object
The full API response.
DeleteBucketResponse
Properties:
Name
Type
Description
0
object
The full API response.
DeleteFileCallback(errnullable, apiResponse)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
apiResponse
object
The full API response.
DeleteFileResponse
Properties:
Name
Type
Description
0
object
The full API response.
DeleteFilesCallback(err, apiResponseopt)
Parameters:
Name
Type
Attributes
Description
err
Error | ?Array.
Request error, if any, or array of errors from files that were not able to be deleted.
apiResponse
object
The full API response.
DeleteFilesOptions
Query object. See Bucket#getFilesfor all of the supported properties.
Properties:
Name
Type
Attributes
Description
force
boolean
Suppress errors until all files have been processed.
An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
description
string
An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
expression
string
Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported.The condition that is associated with this binding.
Only listing objects within a bucket (HTTP: GET) is supported for bucket-level signed URLs.
expires
*
A timestamp when this link will expire. Any value given is passed to new Date(). Note: 'v4' supports maximum duration of 7 days (604800 seconds) from now.
version
string
'v2'
The signing version to use, either 'v2' or 'v4'.
virtualHostedStyle
boolean
false
Use virtual hosted-style URLs ('https://mybucket.storage.googleapis.com/...') instead of path-style ('https://storage.googleapis.com/mybucket/...'). Virtual hosted-style URLs should generally be preferred instaed of path-style URL. Currently defaults to false for path-style, although this may change in a future major-version release.
If these headers are used, the server will check to make sure that the client provides matching values. See Canonical extension headersfor the requirements of this feature, most notably: The header name must be prefixed with x-goog- The header name must be all lowercase Note: Multi-valued header passed as an array in the extensionHeaders object is converted into a string, delimited by , with no space. Requests made using the signed URL will need to delimit multi-valued headers using a single , as well, or else the server will report a mismatched signature.
queryParams
object
Additional query parameters to include in the signed URL.
Maximum number of items plus prefixes to return per call. Note: By default will handle pagination automatically if more than 1 page worth of results are requested per call. When autoPaginate is set to false the smaller of maxResultsor 1 page of results will be returned per call.
pageToken
string
A previously-returned page token representing part of the larger set of results to view.
userProject
string
The ID of the project which will be billed for the request.
Results will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name truncated after the delimiter, returned in apiResponse.prefixes. Duplicate prefixes are omitted.
endOffset
string
Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).
includeFoldersAsPrefixes
boolean
If true, includes folders and managed folders in the set of prefixes returned by the query. Only applicable if delimiter is set to / and autoPaginate is set to false. See: https://cloud.google.com/storage/docs/managed-folders
includeTrailingDelimiter
boolean
If true, objects that end in exactly one instance of delimiter have their metadata included in items[] in addition to the relevant part of the object name appearing in prefixes[].
prefix
string
Filter results to objects whose names begin with this prefix.
matchGlob
string
A glob pattern used to filter results, for example foo*bar
maxApiCalls
number
Maximum number of API calls to make.
maxResults
number
Maximum number of items plus prefixes to return per call. Note: By default will handle pagination automatically if more than 1 page worth of results are requested per call. When autoPaginate is set to false the smaller of maxResultsor 1 page of results will be returned per call.
pageToken
string
A previously-returned page token representing part of the larger set of results to view.
softDeleted
boolean
If true, only soft-deleted object versions will be listed as distinct results in order of generation number. Note soft_deleted andversions cannot be set to true simultaneously.
startOffset
string
Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).
userProject
string
The ID of the project which will be billed for the request.
versions
boolean
If true, returns File objects scoped to their versions.
The version of IAM policies to request. If a policy with a condition is requested without setting this, the server will return an error. This must be set to a value of 3 to retrieve IAM policies containing conditions. This is to prevent client code that isn't aware of IAM conditions from interpreting and modifying policies incorrectly. The service might return a policy with version lower than the one that was requested, based on the feature syntax in the policy fetched. See IAM Policy versions
userProject
string
The ID of the project which will be billed for the request.
The project ID of the project that owns the service account of the requested HMAC key. If not provided, the project ID used to instantiate the Storage client will be used.
IsPublicCallback(errnullable, resp)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
resp
boolean
Whether file is public or not.
IsPublicResponse
Properties:
Name
Type
Description
0
boolean
Whether file is public or not.
LifecycleRule
The new lifecycle rule to be added to objects in this bucket.
Properties:
Name
Type
Attributes
Description
action
string | object
The action to be taken upon matching of all the conditions 'delete', 'setStorageClass', or 'AbortIncompleteMultipartUpload'.Note: For configuring a raw-formatted rule object to be passed as actionplease refer to the examples.
condition
object
Condition a bucket must meet before the action occurs on the bucket. Refer to following supported conditions.
storageClass
string
When using the setStorageClassaction, provide this option to dictate which storage class the object should update to. Please seeSetStorageClass option documentation for supported transitions.
Configuration options for File#moveFileAtomic(). See anObject resource.
Properties:
Name
Type
Attributes
Description
userProject
string
The ID of the project which will be billed for the request.
preconditionOpts
object
Precondition options. Properties Name Type Attributes Description ifGenerationMatch number Makes the operation conditional on whether the object's current generation matches the given value.
The syntax schema version of the Policy. To set an IAM policy with conditional binding, this field must be set to 3 or greater. See IAM Policy versions
PolicyBinding
Properties:
Name
Type
Attributes
Description
role
string
Role that is assigned to members.
members
Array.
Specifies the identities requesting access for the bucket.
The ID of the project which will be billed for the request.
SetBucketMetadataResponse
Properties:
Name
Type
Description
apiResponse
object
The full API response.
SetBucketStorageClassCallback(errnullable)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
SetBucketStorageClassOptions
Properties:
Name
Type
Attributes
Description
userProject
string
The ID of the project which will be billed for the request.
SetFileMetadataCallback(errnullable, apiResponse)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
apiResponse
object
The full API response.
SetFileMetadataOptions
Configuration options for File#setMetadata().
SetFileMetadataResponse
Properties:
Name
Type
Description
0
object
The full API response.
SetHmacKeyMetadata
Properties:
Name
Type
Attributes
Description
state
string
New state of the HmacKey. Either 'ACTIVE' or 'INACTIVE'.
etag
string
Include an etag from a previous get HMAC key request to perform safe read-modify-write.
SetHmacKeyMetadataOptions
Properties:
Name
Type
Attributes
Description
userProject
string
This parameter is currently ignored.
SetLabelsCallback(errnullable, metadata)
Deprecated: true
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
metadata
object
The bucket metadata.
SetLabelsOptions
Configuration options for Bucket#setLabels().
Properties:
Name
Type
Attributes
Description
userProject
string
The ID of the project which will be billed for the request.
SetLabelsResponse
Properties:
Name
Type
Description
0
object
The bucket metadata.
SetStorageClassCallback(errnullable, apiResponse)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
apiResponse
object
The full API response.
SetStorageClassOptions
Configuration options for File#setStorageClass().
Properties:
Name
Type
Attributes
Description
userProject
string
The ID of the project which will be billed for the request.
SetStorageClassResponse
Properties:
Name
Type
Description
0
object
The full API response.
SignedPostPolicyV4Output
Properties:
Name
Type
Description
url
string
The request URL.
fields
object
The form fields to include in the POST request.
StopCallback(errnullable, apiResponse)
Parameters:
Name
Type
Attributes
Description
err
Error
Request error, if any.
apiResponse
object
The full API response.
StopResponse
Properties:
Name
Type
Description
0
object
The full API response.
StorageOptions
Properties:
Name
Type
Attributes
Default
Description
projectId
string
The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.
keyFilename
string
Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option above is not necessary. NOTE: .pem and .p12 require you to specify the email option as well.
email
string
Account email address. Required when using a .pem or .p12 keyFilename.
credentials
object
Credentials object. Properties Name Type Attributes Description client_email string private_key string
retryOptions
object
Options for customizing retries. Retriable server errors will be retried with exponential delay between them dictated by the formula max(maxRetryDelay, retryDelayMultiplier*retryNumber) until maxRetries or totalTimeout has been reached. Retries will only happen if autoRetry is set to true. Properties Name Type Attributes Default Description autoRetry boolean true Automatically retry requests if the response is related to rate limits or certain intermittent server errors. We will exponentially backoff subsequent requests by default. retryDelayMultiplier number 2 the multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request. totalTimeout number 600 The total time, starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile. maxRetryDelay number 64 The maximum delay time between requests. When this value is reached, retryDelayMultiplier will no longer be used to increase delay time. maxRetries number 3 Maximum number of automatic retries attempted before returning the error. retryableErrorFn function Function that returns true if a given error should be retried and false otherwise. idempotencyStrategy enum IdempotencyStrategy.RetryConditional Enumeration controls how conditionally idempotent operations are retried. Possible values are: RetryAlways - will respect other retry settings and attempt to retry conditionally idempotent operations. RetryConditional - will retry conditionally idempotent operations if the correct preconditions are set. RetryNever - never retry a conditionally idempotent operation.
userAgent
string
The value to be prepended to the User-Agent header in API requests.
authClient
object
AuthClient or GoogleAuth client to reuse instead of creating a new one.
timeout
number
The amount of time in milliseconds to wait per http request before timing out.
interceptors_
Array.
Array of custom request interceptors to be returned in the order they were assigned.
apiEndpoint
string
storage.google.com
The API endpoint of the service used to make requests.
useAuthWithCustomEndpoint
boolean
false
Controls whether or not to use authentication when using a custom endpoint.
The place to save your file. If given a string, the file will be uploaded to the bucket using the string as a filename. When given a File object, your local file will be uploaded to the File object's bucket and under the File object's name. Lastly, when this argument is omitted, the file is uploaded to your bucket using the name of the local file.
Automatically gzip the file. This will setoptions.metadata.contentEncoding to gzip.
kmsKeyName
string
The name of the Cloud KMS key that will be used to encrypt the object. Must be in the format:projects/my-project/locations/location/keyRings/my-kr/cryptoKeys/my-key.
The starting byte of the upload stream, for resuming an interrupted upload. Defaults to 0.
predefinedAcl
string
Apply a predefined set of access controls to this object. Acceptable values are: authenticatedRead - Object owner gets OWNER access, andallAuthenticatedUsers get READER access. bucketOwnerFullControl - Object owner gets OWNER access, and project team owners get OWNER access. bucketOwnerRead - Object owner gets OWNER access, and project team owners get READER access. private - Object owner gets OWNER access. projectPrivate - Object owner gets OWNER access, and project team members get access according to their roles. publicRead - Object owner gets OWNER access, and allUsersget READER access.
private
boolean
Make the uploaded file private. (Alias foroptions.predefinedAcl = 'private')
public
boolean
Make the uploaded file public. (Alias foroptions.predefinedAcl = 'publicRead')
resumable
boolean
true
Resumable uploads are automatically enabled and must be shut off explicitly by setting to false.
timeout
number
60000
Set the HTTP request timeout in milliseconds. This option is not available for resumable uploads. Default: 60000
The ID of the project which will be billed for the request.
validation
string | boolean
Possible values: "md5","crc32c", or false. By default, data integrity is validated with an MD5 checksum for maximum reliability. CRC32c will provide better performance with less reliability. You may also choose to skip validation completely, however this is not recommended.