Package
@google-cloud/storage-control
Constructors
(constructor)(options)
constructor(options?: StorageControlClientOptions);
Constructs a new instance of the StorageControlClient class
| Parameter |
| Name |
Description |
options |
StorageControlClientOptions
|
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
operationsClient
operationsClient: gax.OperationsClient;
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
storageClient
storageClient: StorageClient;
storageControlInternal
storageControlInternal: StorageControlInternal;
storageControlStub
storageControlStub?: Promise<{
[name: string]: Function;
}>;
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
anywhereCachePath(project, bucket, anywhereCache)
anywhereCachePath(project: string, bucket: string, anywhereCache: string): string;
Return a fully-qualified anywhereCache resource name string.
| Parameters |
| Name |
Description |
project |
string
|
bucket |
string
|
anywhereCache |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
bucketPath(project, bucket)
bucketPath(project: string, bucket: string): string;
Return a fully-qualified bucket resource name string.
| Parameters |
| Name |
Description |
project |
string
|
bucket |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
cancelOperation(request, options)
cancelOperation(request?: protos.google.longrunning.CancelOperationRequest, options?: CallOptions): Promise<protos.google.protobuf.Empty>;
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.
| Parameters |
| Name |
Description |
request |
CancelOperationRequest
The request object that will be sent.
|
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
|
Example
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options: CallOptions, callback: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): void;
| Returns |
| Type |
Description |
void |
|
cancelOperation(request, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, callback: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): void;
| Returns |
| Type |
Description |
void |
|
checkCreateAnywhereCacheProgress(name)
checkCreateAnywhereCacheProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.CreateAnywhereCacheMetadata>>;
Check the status of the long running operation returned by createAnywhereCache().
| Parameter |
| Name |
Description |
name |
string
The operation name that will be passed.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The bucket to which this cache belongs.
* Format: `projects/{project}/buckets/{bucket}`
*/
// const parent = 'abc123'
/**
* Required. Properties of the Anywhere Cache instance being created.
* The parent bucket name is specified in the `parent` field. Server uses the
* default value of `ttl` or `admission_policy` if not specified in
* request.
*/
// const anywhereCache = {}
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callCreateAnywhereCache() {
// Construct request
const request = {
parent,
anywhereCache,
};
// Run request
const [operation] = await storageControlClient.createAnywhereCache(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateAnywhereCache();
checkDeleteFolderRecursiveProgress(name)
checkDeleteFolderRecursiveProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.storage.control.v2.DeleteFolderRecursiveMetadata>>;
Check the status of the long running operation returned by deleteFolderRecursive().
| Parameter |
| Name |
Description |
name |
string
The operation name that will be passed.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the folder being deleted, however all of its contents
* will be deleted too. Format:
* `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Optional. Makes the operation only succeed conditional on whether the root
* folder's current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Optional. Makes the operation only succeed conditional on whether the root
* folder's current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDeleteFolderRecursive() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await storageControlClient.deleteFolderRecursive(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteFolderRecursive();
checkRenameFolderProgress(name)
checkRenameFolderProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.Folder, protos.google.storage.control.v2.RenameFolderMetadata>>;
Check the status of the long running operation returned by renameFolder().
| Parameter |
| Name |
Description |
name |
string
The operation name that will be passed.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the source folder being renamed.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Required. The destination folder ID, e.g. `foo/bar/`.
*/
// const destinationFolderId = 'abc123'
/**
* Makes the operation only succeed conditional on whether the source
* folder's current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Makes the operation only succeed conditional on whether the source
* folder's current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callRenameFolder() {
// Construct request
const request = {
name,
destinationFolderId,
};
// Run request
const [operation] = await storageControlClient.renameFolder(request);
const [response] = await operation.promise();
console.log(response);
}
callRenameFolder();
checkUpdateAnywhereCacheProgress(name)
checkUpdateAnywhereCacheProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.UpdateAnywhereCacheMetadata>>;
Check the status of the long running operation returned by updateAnywhereCache().
| Parameter |
| Name |
Description |
name |
string
The operation name that will be passed.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Anywhere Cache instance to be updated.
*/
// const anywhereCache = {}
/**
* Required. List of fields to be updated. Mutable fields of AnywhereCache
* include `ttl` and `admission_policy`.
* To specify ALL fields, specify a single field with the value `*`. Note: We
* recommend against doing this. If a new field is introduced at a later time,
* an older client updating with the `*` may accidentally reset the new
* field's value.
* Not specifying any fields is an error.
*/
// const updateMask = {}
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateAnywhereCache() {
// Construct request
const request = {
anywhereCache,
updateMask,
};
// Run request
const [operation] = await storageControlClient.updateAnywhereCache(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateAnywhereCache();
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
| Returns |
| Type |
Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed.
|
createAnywhereCache(request, options)
createAnywhereCache(request?: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, options?: CallOptions): Promise<[
LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates an Anywhere Cache instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The bucket to which this cache belongs.
* Format: `projects/{project}/buckets/{bucket}`
*/
// const parent = 'abc123'
/**
* Required. Properties of the Anywhere Cache instance being created.
* The parent bucket name is specified in the `parent` field. Server uses the
* default value of `ttl` or `admission_policy` if not specified in
* request.
*/
// const anywhereCache = {}
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callCreateAnywhereCache() {
// Construct request
const request = {
parent,
anywhereCache,
};
// Run request
const [operation] = await storageControlClient.createAnywhereCache(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateAnywhereCache();
createAnywhereCache(request, options, callback)
createAnywhereCache(request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createAnywhereCache(request, callback)
createAnywhereCache(request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createBucket(request, options)
createBucket(request?: protos.google.storage.v2.ICreateBucketRequest, options?: CallOptions): Promise<[
protos.google.storage.v2.IBucket,
protos.google.storage.v2.ICreateBucketRequest | undefined,
{} | undefined
]>;
Creates a new bucket.
**IAM Permissions**:
Requires storage.buckets.create IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions:
- To enable object retention using the
enableObjectRetention query parameter: storage.buckets.enableObjectRetention - To set the bucket IP filtering rules: storage.buckets.setIpFilter
| Parameters |
| Name |
Description |
request |
ICreateBucketRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project to which this bucket belongs. This field must either
* be empty or `projects/_`. The project ID that owns this bucket should be
* specified in the `bucket.project` field.
*/
// const parent = 'abc123'
/**
* Optional. Properties of the new bucket being inserted.
* The name of the bucket is specified in the `bucket_id` field. Populating
* `bucket.name` field results in an error.
* The project of the bucket must be specified in the `bucket.project` field.
* This field must be in `projects/{projectIdentifier}` format,
* {projectIdentifier} can be the project ID or project number. The `parent`
* field must be either empty or `projects/_`.
*/
// const bucket = {}
/**
* Required. The ID to use for this bucket, which becomes the final component
* of the bucket's resource name. For example, the value `foo` might result in
* a bucket with the name `projects/123456/buckets/foo`.
*/
// const bucketId = 'abc123'
/**
* Optional. Apply a predefined set of access controls to this bucket.
* Valid values are `authenticatedRead`, `private`, `projectPrivate`,
* `publicRead`, or `publicReadWrite`.
*/
// const predefinedAcl = 'abc123'
/**
* Optional. Apply a predefined set of default object access controls to this
* bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
* `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
*/
// const predefinedDefaultObjectAcl = 'abc123'
/**
* Optional. If true, enable object retention on the bucket.
*/
// const enableObjectRetention = true
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callCreateBucket() {
// Construct request
const request = {
parent,
bucketId,
};
// Run request
const response = await storageControlClient.createBucket(request);
console.log(response);
}
callCreateBucket();
createBucket(request, options, callback)
createBucket(request: protos.google.storage.v2.ICreateBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ICreateBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createBucket(request, callback)
createBucket(request: protos.google.storage.v2.ICreateBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ICreateBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createFolder(request, options)
createFolder(request?: protos.google.storage.control.v2.ICreateFolderRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IFolder,
protos.google.storage.control.v2.ICreateFolderRequest | undefined,
{} | undefined
]>;
Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.
| Parameters |
| Name |
Description |
request |
ICreateFolderRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the bucket in which the folder will reside. The bucket
* must be a hierarchical namespace enabled bucket.
*/
// const parent = 'abc123'
/**
* Required. Properties of the new folder being created.
* The bucket and name of the folder are specified in the parent and folder_id
* fields, respectively. Populating those fields in `folder` will result in an
* error.
*/
// const folder = {}
/**
* Required. The full name of a folder, including all its parent folders.
* Folders use single '/' characters as a delimiter.
* The folder_id must end with a slash.
* For example, the folder_id of "books/biographies/" would create a new
* "biographies/" folder under the "books/" folder.
*/
// const folderId = 'abc123'
/**
* Optional. If true, parent folder doesn't have to be present and all missing
* ancestor folders will be created atomically.
*/
// const recursive = true
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callCreateFolder() {
// Construct request
const request = {
parent,
folder,
folderId,
};
// Run request
const response = await storageControlClient.createFolder(request);
console.log(response);
}
callCreateFolder();
createFolder(request, options, callback)
createFolder(request: protos.google.storage.control.v2.ICreateFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createFolder(request, callback)
createFolder(request: protos.google.storage.control.v2.ICreateFolderRequest, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createManagedFolder(request, options)
createManagedFolder(request?: protos.google.storage.control.v2.ICreateManagedFolderRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IManagedFolder,
protos.google.storage.control.v2.ICreateManagedFolderRequest | undefined,
{} | undefined
]>;
Creates a new managed folder.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the bucket this managed folder belongs to.
*/
// const parent = 'abc123'
/**
* Required. Properties of the managed folder being created.
* The bucket and managed folder names are specified in the `parent` and
* `managed_folder_id` fields. Populating these fields in `managed_folder`
* will result in an error.
*/
// const managedFolder = {}
/**
* Required. The name of the managed folder. It uses a single `/` as delimiter
* and leading and trailing `/` are allowed.
*/
// const managedFolderId = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callCreateManagedFolder() {
// Construct request
const request = {
parent,
managedFolder,
managedFolderId,
};
// Run request
const response = await storageControlClient.createManagedFolder(request);
console.log(response);
}
callCreateManagedFolder();
createManagedFolder(request, options, callback)
createManagedFolder(request: protos.google.storage.control.v2.ICreateManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
createManagedFolder(request, callback)
createManagedFolder(request: protos.google.storage.control.v2.ICreateManagedFolderRequest, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
cryptoKeyPath(project, location, keyRing, cryptoKey)
cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;
Return a fully-qualified cryptoKey resource name string.
| Parameters |
| Name |
Description |
project |
string
|
location |
string
|
keyRing |
string
|
cryptoKey |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
deleteBucket(request, options)
deleteBucket(request?: protos.google.storage.v2.IDeleteBucketRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.storage.v2.IDeleteBucketRequest | undefined,
{} | undefined
]>;
Permanently deletes an empty bucket. The request fails if there are any live or noncurrent objects in the bucket, but the request succeeds if the bucket only contains soft-deleted objects or incomplete uploads, such as ongoing XML API multipart uploads. Does not permanently delete soft-deleted objects.
When this API is used to delete a bucket containing an object that has a soft delete policy enabled, the object becomes soft deleted, and the softDeleteTime and hardDeleteTime properties are set on the object.
Objects and multipart uploads that were in the bucket at the time of deletion are also retained for the specified retention duration. When a soft-deleted bucket reaches the end of its retention duration, it is permanently deleted. The hardDeleteTime of the bucket always equals or exceeds the expiration time of the last soft-deleted object in the bucket.
**IAM Permissions**:
Requires storage.buckets.delete IAM permission on the bucket.
| Parameters |
| Name |
Description |
request |
IDeleteBucketRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of a bucket to delete.
*/
// const name = 'abc123'
/**
* If set, only deletes the bucket if its metageneration matches this value.
*/
// const ifMetagenerationMatch = 1234
/**
* If set, only deletes the bucket if its metageneration does not match this
* value.
*/
// const ifMetagenerationNotMatch = 1234
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDeleteBucket() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.deleteBucket(request);
console.log(response);
}
callDeleteBucket();
deleteBucket(request, options, callback)
deleteBucket(request: protos.google.storage.v2.IDeleteBucketRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.v2.IDeleteBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteBucket(request, callback)
deleteBucket(request: protos.google.storage.v2.IDeleteBucketRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.v2.IDeleteBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteFolder(request, options)
deleteFolder(request?: protos.google.storage.control.v2.IDeleteFolderRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.storage.control.v2.IDeleteFolderRequest | undefined,
{} | undefined
]>;
Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.
| Parameters |
| Name |
Description |
request |
IDeleteFolderRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the folder.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Makes the operation only succeed conditional on whether the folder's
* current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Makes the operation only succeed conditional on whether the folder's
* current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDeleteFolder() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.deleteFolder(request);
console.log(response);
}
callDeleteFolder();
deleteFolder(request, options, callback)
deleteFolder(request: protos.google.storage.control.v2.IDeleteFolderRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteFolder(request, callback)
deleteFolder(request: protos.google.storage.control.v2.IDeleteFolderRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteFolderRecursive(request, options)
deleteFolderRecursive(request?: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRecursiveMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes a folder recursively. This operation is only applicable to a hierarchical namespace enabled bucket.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the folder being deleted, however all of its contents
* will be deleted too. Format:
* `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Optional. Makes the operation only succeed conditional on whether the root
* folder's current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Optional. Makes the operation only succeed conditional on whether the root
* folder's current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDeleteFolderRecursive() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await storageControlClient.deleteFolderRecursive(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteFolderRecursive();
deleteFolderRecursive(request, options, callback)
deleteFolderRecursive(request: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRecursiveMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteFolderRecursive(request, callback)
deleteFolderRecursive(request: protos.google.storage.control.v2.IDeleteFolderRecursiveRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRecursiveMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteManagedFolder(request, options)
deleteManagedFolder(request?: protos.google.storage.control.v2.IDeleteManagedFolderRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.storage.control.v2.IDeleteManagedFolderRequest | undefined,
{} | undefined
]>;
Permanently deletes an empty managed folder.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the managed folder.
* Format:
* `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
*/
// const name = 'abc123'
/**
* The operation succeeds conditional on the managed folder's current
* metageneration matching the value here specified.
*/
// const ifMetagenerationMatch = 1234
/**
* The operation succeeds conditional on the managed folder's current
* metageneration NOT matching the value here specified.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Allows deletion of a managed folder even if it is not empty.
* A managed folder is empty if it manages no child managed folders or
* objects. Caller must have permission for
* storage.managedFolders.setIamPolicy.
*/
// const allowNonEmpty = true
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDeleteManagedFolder() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.deleteManagedFolder(request);
console.log(response);
}
callDeleteManagedFolder();
deleteManagedFolder(request, options, callback)
deleteManagedFolder(request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteManagedFolder(request, callback)
deleteManagedFolder(request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteOperation(request, options)
deleteOperation(request?: protos.google.longrunning.DeleteOperationRequest, options?: CallOptions): Promise<protos.google.protobuf.Empty>;
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
| Parameters |
| Name |
Description |
request |
DeleteOperationRequest
The request object that will be sent.
|
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
|
Example
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options: CallOptions, callback: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
deleteOperation(request, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, callback: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
disableAnywhereCache(request, options)
disableAnywhereCache(request?: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IAnywhereCache,
protos.google.storage.control.v2.IDisableAnywhereCacheRequest | undefined,
{} | undefined
]>;
Disables an Anywhere Cache instance. A disabled instance is read-only. The disablement could be revoked by calling ResumeAnywhereCache. The cache instance will be deleted automatically if it remains in the disabled state for at least one hour.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
*/
// const name = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callDisableAnywhereCache() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.disableAnywhereCache(request);
console.log(response);
}
callDisableAnywhereCache();
disableAnywhereCache(request, options, callback)
disableAnywhereCache(request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
disableAnywhereCache(request, callback)
disableAnywhereCache(request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
folderLocationIntelligenceConfigPath(folder, location)
folderLocationIntelligenceConfigPath(folder: string, location: string): string;
Return a fully-qualified folderLocationIntelligenceConfig resource name string.
| Parameters |
| Name |
Description |
folder |
string
|
location |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
folderPath(project, bucket, folder)
folderPath(project: string, bucket: string, folder: string): string;
Return a fully-qualified folder resource name string.
| Parameters |
| Name |
Description |
project |
string
|
bucket |
string
|
folder |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
getAnywhereCache(request, options)
getAnywhereCache(request?: protos.google.storage.control.v2.IGetAnywhereCacheRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IAnywhereCache,
protos.google.storage.control.v2.IGetAnywhereCacheRequest | undefined,
{} | undefined
]>;
Gets an Anywhere Cache instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
*/
// const name = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetAnywhereCache() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getAnywhereCache(request);
console.log(response);
}
callGetAnywhereCache();
getAnywhereCache(request, options, callback)
getAnywhereCache(request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getAnywhereCache(request, callback)
getAnywhereCache(request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getBucket(request, options)
getBucket(request?: protos.google.storage.v2.IGetBucketRequest, options?: CallOptions): Promise<[
protos.google.storage.v2.IBucket,
protos.google.storage.v2.IGetBucketRequest | undefined,
{} | undefined
]>;
Returns metadata for the specified bucket.
**IAM Permissions**:
Requires storage.buckets.get IAM permission on the bucket. Additionally, to return specific bucket metadata, the authenticated user must have the following permissions:
- To return the IAM policies:
storage.buckets.getIamPolicy - To return the bucket IP filtering rules: storage.buckets.getIpFilter
| Parameters |
| Name |
Description |
request |
IGetBucketRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of a bucket.
*/
// const name = 'abc123'
/**
* If set, only gets the bucket metadata if its metageneration matches this
* value.
*/
// const ifMetagenerationMatch = 1234
/**
* If set, and if the bucket's current metageneration matches the specified
* value, the request returns an error.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Mask specifying which fields to read.
* A `*` field might be used to indicate all fields.
* If no mask is specified, it defaults to all fields.
*/
// const readMask = {}
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetBucket() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getBucket(request);
console.log(response);
}
callGetBucket();
getBucket(request, options, callback)
getBucket(request: protos.google.storage.v2.IGetBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IGetBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getBucket(request, callback)
getBucket(request: protos.google.storage.v2.IGetBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IGetBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getFolder(request, options)
getFolder(request?: protos.google.storage.control.v2.IGetFolderRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IFolder,
protos.google.storage.control.v2.IGetFolderRequest | undefined,
{} | undefined
]>;
Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.
| Parameters |
| Name |
Description |
request |
IGetFolderRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the folder.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Makes the operation only succeed conditional on whether the folder's
* current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Makes the operation only succeed conditional on whether the folder's
* current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetFolder() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getFolder(request);
console.log(response);
}
callGetFolder();
getFolder(request, options, callback)
getFolder(request: protos.google.storage.control.v2.IGetFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getFolder(request, callback)
getFolder(request: protos.google.storage.control.v2.IGetFolderRequest, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getFolderIntelligenceConfig(request, options)
getFolderIntelligenceConfig(request?: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Returns the Folder scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the `IntelligenceConfig` resource associated with
* your folder.
* Format: `folders/{id}/locations/global/intelligenceConfig`
*/
// const name = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetFolderIntelligenceConfig() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getFolderIntelligenceConfig(request);
console.log(response);
}
callGetFolderIntelligenceConfig();
getFolderIntelligenceConfig(request, options, callback)
getFolderIntelligenceConfig(request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getFolderIntelligenceConfig(request, callback)
getFolderIntelligenceConfig(request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getIamPolicy(request, options)
getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.IGetIamPolicyRequest | undefined,
{} | undefined
]>;
Gets the IAM policy for a specified bucket. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.
| Parameters |
| Name |
Description |
request |
IGetIamPolicyRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* OPTIONAL: A `GetPolicyOptions` object for specifying options to
* `GetIamPolicy`.
*/
// const options = {}
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetIamPolicy() {
// Construct request
const request = {
resource,
};
// Run request
const response = await storageControlClient.getIamPolicy(request);
console.log(response);
}
callGetIamPolicy();
getIamPolicy(request, options, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getIamPolicy(request, callback)
getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getManagedFolder(request, options)
getManagedFolder(request?: protos.google.storage.control.v2.IGetManagedFolderRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IManagedFolder,
protos.google.storage.control.v2.IGetManagedFolderRequest | undefined,
{} | undefined
]>;
Returns metadata for the specified managed folder.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the managed folder.
* Format:
* `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
*/
// const name = 'abc123'
/**
* The operation succeeds conditional on the managed folder's current
* metageneration matching the value here specified.
*/
// const ifMetagenerationMatch = 1234
/**
* The operation succeeds conditional on the managed folder's current
* metageneration NOT matching the value here specified.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetManagedFolder() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getManagedFolder(request);
console.log(response);
}
callGetManagedFolder();
getManagedFolder(request, options, callback)
getManagedFolder(request: protos.google.storage.control.v2.IGetManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getManagedFolder(request, callback)
getManagedFolder(request: protos.google.storage.control.v2.IGetManagedFolderRequest, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getOperation(request, options)
getOperation(request?: protos.google.longrunning.GetOperationRequest, options?: CallOptions): Promise<[protos.google.longrunning.Operation]>;
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
| Parameters |
| Name |
Description |
request |
GetOperationRequest
The request object that will be sent.
|
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
|
Example
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options: CallOptions, callback: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getOperation(request, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, callback: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getOrganizationIntelligenceConfig(request, options)
getOrganizationIntelligenceConfig(request?: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Returns the Organization scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the `IntelligenceConfig` resource associated with
* your organization.
* Format: `organizations/{org_id}/locations/global/intelligenceConfig`
*/
// const name = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetOrganizationIntelligenceConfig() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getOrganizationIntelligenceConfig(request);
console.log(response);
}
callGetOrganizationIntelligenceConfig();
getOrganizationIntelligenceConfig(request, options, callback)
getOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getOrganizationIntelligenceConfig(request, callback)
getOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getProjectId(callback)
getProjectId(callback?: Callback<string, undefined, undefined>): Promise<string> | void;
| Parameter |
| Name |
Description |
callback |
Callback<string, undefined, undefined>
|
| Returns |
| Type |
Description |
Promise<string> | void |
|
getProjectIntelligenceConfig(request, options)
getProjectIntelligenceConfig(request?: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Returns the Project scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the `IntelligenceConfig` resource associated with
* your project.
* Format: `projects/{id}/locations/global/intelligenceConfig`
*/
// const name = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetProjectIntelligenceConfig() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getProjectIntelligenceConfig(request);
console.log(response);
}
callGetProjectIntelligenceConfig();
getProjectIntelligenceConfig(request, options, callback)
getProjectIntelligenceConfig(request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getProjectIntelligenceConfig(request, callback)
getProjectIntelligenceConfig(request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getStorageLayout(request, options)
getStorageLayout(request?: protos.google.storage.control.v2.IGetStorageLayoutRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IStorageLayout,
protos.google.storage.control.v2.IGetStorageLayoutRequest | undefined,
{} | undefined
]>;
Returns the storage layout configuration for a given bucket.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the StorageLayout resource.
* Format: `projects/{project}/buckets/{bucket}/storageLayout`
*/
// const name = 'abc123'
/**
* An optional prefix used for permission check. It is useful when the caller
* only has limited permissions under a specific prefix.
*/
// const prefix = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callGetStorageLayout() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.getStorageLayout(request);
console.log(response);
}
callGetStorageLayout();
getStorageLayout(request, options, callback)
getStorageLayout(request: protos.google.storage.control.v2.IGetStorageLayoutRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
getStorageLayout(request, callback)
getStorageLayout(request: protos.google.storage.control.v2.IGetStorageLayoutRequest, callback: Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
| Returns |
| Type |
Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub.
|
listAnywhereCaches(request, options)
listAnywhereCaches(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IAnywhereCache[],
protos.google.storage.control.v2.IListAnywhereCachesRequest | null,
protos.google.storage.control.v2.IListAnywhereCachesResponse
]>;
Lists Anywhere Cache instances for a given bucket.
listAnywhereCaches(request, options, callback)
listAnywhereCaches(request: protos.google.storage.control.v2.IListAnywhereCachesRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>): void;
| Returns |
| Type |
Description |
void |
|
listAnywhereCaches(request, callback)
listAnywhereCaches(request: protos.google.storage.control.v2.IListAnywhereCachesRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>): void;
| Returns |
| Type |
Description |
void |
|
listAnywhereCachesAsync(request, options)
listAnywhereCachesAsync(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IAnywhereCache>;
Equivalent to listAnywhereCaches, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The bucket to which this cache belongs.
*/
// const parent = 'abc123'
/**
* Maximum number of caches to return in a single response.
* The service will use this parameter or 1,000 items, whichever is smaller.
*/
// const pageSize = 1234
/**
* A previously-returned page token representing part of the larger set of
* results to view.
*/
// const pageToken = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callListAnywhereCaches() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = storageControlClient.listAnywhereCachesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAnywhereCaches();
listAnywhereCachesStream(request, options)
listAnywhereCachesStream(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): Transform;
Equivalent to listAnywhereCaches, but returns a NodeJS Stream object.
| Returns |
| Type |
Description |
Transform |
{Stream} An object stream which emits an object representing AnywhereCache on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listAnywhereCachesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.
|
listBuckets(request, options)
listBuckets(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): Promise<[
protos.google.storage.v2.IBucket[],
protos.google.storage.v2.IListBucketsRequest | null,
protos.google.storage.v2.IListBucketsResponse
]>;
Retrieves a list of buckets for a given project, ordered lexicographically by name.
**IAM Permissions**:
Requires storage.buckets.list IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions:
- To list the IAM policies:
storage.buckets.getIamPolicy - To list the bucket IP filtering rules: storage.buckets.getIpFilter
| Parameters |
| Name |
Description |
request |
IListBucketsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
listBuckets(request, options, callback)
listBuckets(request: protos.google.storage.v2.IListBucketsRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.v2.IListBucketsRequest, protos.google.storage.v2.IListBucketsResponse | null | undefined, protos.google.storage.v2.IBucket>): void;
| Returns |
| Type |
Description |
void |
|
listBuckets(request, callback)
listBuckets(request: protos.google.storage.v2.IListBucketsRequest, callback: PaginationCallback<protos.google.storage.v2.IListBucketsRequest, protos.google.storage.v2.IListBucketsResponse | null | undefined, protos.google.storage.v2.IBucket>): void;
| Returns |
| Type |
Description |
void |
|
listBucketsAsync(request, options)
listBucketsAsync(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): AsyncIterable<protos.google.storage.v2.IBucket>;
Equivalent to listBuckets, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters |
| Name |
Description |
request |
IListBucketsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
| Returns |
| Type |
Description |
AsyncIterable<protos.google.storage.v2.IBucket> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project whose buckets we are listing.
*/
// const parent = 'abc123'
/**
* Optional. Maximum number of buckets to return in a single response. The
* service uses this parameter or `1,000` items, whichever is smaller. If
* `acl` is present in the `read_mask`, the service uses this parameter of
* `200` items, whichever is smaller.
*/
// const pageSize = 1234
/**
* Optional. A previously-returned page token representing part of the larger
* set of results to view.
*/
// const pageToken = 'abc123'
/**
* Optional. Filter results to buckets whose names begin with this prefix.
*/
// const prefix = 'abc123'
/**
* Mask specifying which fields to read from each result.
* If no mask is specified, it defaults to all fields except `items.
* owner`, `items.acl`, and `items.default_object_acl`.
* `*` might be used to mean "all fields".
*/
// const readMask = {}
/**
* Optional. Allows listing of buckets, even if there are buckets that are
* unreachable.
*/
// const returnPartialSuccess = true
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callListBuckets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = storageControlClient.listBucketsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListBuckets();
listBucketsStream(request, options)
listBucketsStream(request?: protos.google.storage.v2.IListBucketsRequest, options?: CallOptions): Transform;
Equivalent to listBuckets, but returns a NodeJS Stream object.
| Parameters |
| Name |
Description |
request |
IListBucketsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
| Returns |
| Type |
Description |
Transform |
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listBucketsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.
|
listFolders(request, options)
listFolders(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IFolder[],
protos.google.storage.control.v2.IListFoldersRequest | null,
protos.google.storage.control.v2.IListFoldersResponse
]>;
Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.
| Parameters |
| Name |
Description |
request |
IListFoldersRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
listFolders(request, options, callback)
listFolders(request: protos.google.storage.control.v2.IListFoldersRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>): void;
| Returns |
| Type |
Description |
void |
|
listFolders(request, callback)
listFolders(request: protos.google.storage.control.v2.IListFoldersRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>): void;
| Returns |
| Type |
Description |
void |
|
listFoldersAsync(request, options)
listFoldersAsync(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IFolder>;
Equivalent to listFolders, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
| Parameters |
| Name |
Description |
request |
IListFoldersRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
| Returns |
| Type |
Description |
AsyncIterable<protos.google.storage.control.v2.IFolder> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Folder. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the bucket in which to look for folders. The bucket must
* be a hierarchical namespace enabled bucket.
*/
// const parent = 'abc123'
/**
* Optional. Maximum number of folders to return in a single response. The
* service will use this parameter or 1,000 items, whichever is smaller.
*/
// const pageSize = 1234
/**
* Optional. A previously-returned page token representing part of the larger
* set of results to view.
*/
// const pageToken = 'abc123'
/**
* Optional. Filter results to folders whose names begin with this prefix.
* If set, the value must either be an empty string or end with a '/'.
*/
// const prefix = 'abc123'
/**
* Optional. If set, returns results in a directory-like mode. The results
* will only include folders that either exactly match the above prefix, or
* are one level below the prefix. The only supported value is '/'.
*/
// const delimiter = 'abc123'
/**
* Optional. Filter results to folders whose names are lexicographically equal
* to or after lexicographic_start. If lexicographic_end is also set, the
* folders listed have names between lexicographic_start (inclusive) and
* lexicographic_end (exclusive).
*/
// const lexicographicStart = 'abc123'
/**
* Optional. Filter results to folders whose names are lexicographically
* before lexicographic_end. If lexicographic_start is also set, the folders
* listed have names between lexicographic_start (inclusive) and
* lexicographic_end (exclusive).
*/
// const lexicographicEnd = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callListFolders() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = storageControlClient.listFoldersAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListFolders();
listFoldersStream(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): Transform;
Equivalent to listFolders, but returns a NodeJS Stream object.
| Parameters |
| Name |
Description |
request |
IListFoldersRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
| Returns |
| Type |
Description |
Transform |
{Stream} An object stream which emits an object representing Folder on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.
|
listManagedFolders(request, options)
listManagedFolders(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IManagedFolder[],
protos.google.storage.control.v2.IListManagedFoldersRequest | null,
protos.google.storage.control.v2.IListManagedFoldersResponse
]>;
Retrieves a list of managed folders for a given bucket.
listManagedFolders(request, options, callback)
listManagedFolders(request: protos.google.storage.control.v2.IListManagedFoldersRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>): void;
| Returns |
| Type |
Description |
void |
|
listManagedFolders(request, callback)
listManagedFolders(request: protos.google.storage.control.v2.IListManagedFoldersRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>): void;
| Returns |
| Type |
Description |
void |
|
listManagedFoldersAsync(request, options)
listManagedFoldersAsync(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IManagedFolder>;
Equivalent to listManagedFolders, but returns an iterable object.
for-await-of syntax is used with the iterable to get response elements on-demand.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the bucket this managed folder belongs to.
*/
// const parent = 'abc123'
/**
* Optional. Maximum number of managed folders to return in a single response.
* The service will use this parameter or 1,000 items, whichever is smaller.
*/
// const pageSize = 1234
/**
* Optional. A previously-returned page token representing part of the larger
* set of results to view.
*/
// const pageToken = 'abc123'
/**
* Optional. Filter results to match managed folders with name starting with
* this prefix.
*/
// const prefix = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callListManagedFolders() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = storageControlClient.listManagedFoldersAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListManagedFolders();
listManagedFoldersStream(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): Transform;
Equivalent to listManagedFolders, but returns a NodeJS Stream object.
| Returns |
| Type |
Description |
Transform |
{Stream} An object stream which emits an object representing ManagedFolder on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listManagedFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.
|
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
| Parameters |
| Name |
Description |
request |
ListOperationsRequest
The request object that will be sent.
|
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.
|
Example
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
lockBucketRetentionPolicy(request, options)
lockBucketRetentionPolicy(request?: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, options?: CallOptions): Promise<[
protos.google.storage.v2.IBucket,
protos.google.storage.v2.ILockBucketRetentionPolicyRequest | undefined,
{} | undefined
]>;
Permanently locks the retention policy that is currently applied to the specified bucket.
Caution: Locking a bucket is an irreversible action. Once you lock a bucket:
- You cannot remove the retention policy from the bucket. - You cannot decrease the retention period for the policy.
Once locked, you must delete the entire bucket in order to remove the bucket's retention policy. However, before you can delete the bucket, you must delete all the objects in the bucket, which is only possible if all the objects have reached the retention period set by the retention policy.
**IAM Permissions**:
Requires storage.buckets.update IAM permission on the bucket.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of a bucket.
*/
// const bucket = 'abc123'
/**
* Required. Makes the operation conditional on whether bucket's current
* metageneration matches the given value. Must be positive.
*/
// const ifMetagenerationMatch = 1234
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callLockBucketRetentionPolicy() {
// Construct request
const request = {
bucket,
ifMetagenerationMatch,
};
// Run request
const response = await storageControlClient.lockBucketRetentionPolicy(request);
console.log(response);
}
callLockBucketRetentionPolicy();
lockBucketRetentionPolicy(request, options, callback)
lockBucketRetentionPolicy(request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ILockBucketRetentionPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
lockBucketRetentionPolicy(request, callback)
lockBucketRetentionPolicy(request: protos.google.storage.v2.ILockBucketRetentionPolicyRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.ILockBucketRetentionPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
managedFolderPath(project, bucket, managedFolder)
managedFolderPath(project: string, bucket: string, managedFolder: string): string;
Return a fully-qualified managedFolder resource name string.
| Parameters |
| Name |
Description |
project |
string
|
bucket |
string
|
managedFolder |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName)
matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName: string): string | number;
Parse the anywhere_cache from AnywhereCache resource.
| Parameter |
| Name |
Description |
anywhereCacheName |
string
A fully-qualified path representing AnywhereCache resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the anywhere_cache.
|
matchBucketFromAnywhereCacheName(anywhereCacheName)
matchBucketFromAnywhereCacheName(anywhereCacheName: string): string | number;
Parse the bucket from AnywhereCache resource.
| Parameter |
| Name |
Description |
anywhereCacheName |
string
A fully-qualified path representing AnywhereCache resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the bucket.
|
matchBucketFromBucketName(bucketName)
matchBucketFromBucketName(bucketName: string): string | number;
Parse the bucket from Bucket resource.
| Parameter |
| Name |
Description |
bucketName |
string
A fully-qualified path representing Bucket resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the bucket.
|
matchBucketFromFolderName(folderName)
matchBucketFromFolderName(folderName: string): string | number;
Parse the bucket from Folder resource.
| Parameter |
| Name |
Description |
folderName |
string
A fully-qualified path representing Folder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the bucket.
|
matchBucketFromManagedFolderName(managedFolderName)
matchBucketFromManagedFolderName(managedFolderName: string): string | number;
Parse the bucket from ManagedFolder resource.
| Parameter |
| Name |
Description |
managedFolderName |
string
A fully-qualified path representing ManagedFolder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the bucket.
|
matchBucketFromStorageLayoutName(storageLayoutName)
matchBucketFromStorageLayoutName(storageLayoutName: string): string | number;
Parse the bucket from StorageLayout resource.
| Parameter |
| Name |
Description |
storageLayoutName |
string
A fully-qualified path representing StorageLayout resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the bucket.
|
matchCryptoKeyFromCryptoKeyName(cryptoKeyName)
matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the crypto_key from CryptoKey resource.
| Parameter |
| Name |
Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the crypto_key.
|
matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName)
matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string): string | number;
Parse the folder from FolderLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
folderLocationIntelligenceConfigName |
string
A fully-qualified path representing folder_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the folder.
|
matchFolderFromFolderName(folderName)
matchFolderFromFolderName(folderName: string): string | number;
Parse the folder from Folder resource.
| Parameter |
| Name |
Description |
folderName |
string
A fully-qualified path representing Folder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the folder.
|
matchKeyRingFromCryptoKeyName(cryptoKeyName)
matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the key_ring from CryptoKey resource.
| Parameter |
| Name |
Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the key_ring.
|
matchLocationFromCryptoKeyName(cryptoKeyName)
matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the location from CryptoKey resource.
| Parameter |
| Name |
Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the location.
|
matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName)
matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string): string | number;
Parse the location from FolderLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
folderLocationIntelligenceConfigName |
string
A fully-qualified path representing folder_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the location.
|
matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName)
matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string): string | number;
Parse the location from OrgLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
orgLocationIntelligenceConfigName |
string
A fully-qualified path representing org_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the location.
|
matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName)
matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string): string | number;
Parse the location from ProjectLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
projectLocationIntelligenceConfigName |
string
A fully-qualified path representing project_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the location.
|
matchManagedFolderFromManagedFolderName(managedFolderName)
matchManagedFolderFromManagedFolderName(managedFolderName: string): string | number;
Parse the managed_folder from ManagedFolder resource.
| Parameter |
| Name |
Description |
managedFolderName |
string
A fully-qualified path representing ManagedFolder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the managed_folder.
|
matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName)
matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string): string | number;
Parse the org from OrgLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
orgLocationIntelligenceConfigName |
string
A fully-qualified path representing org_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the org.
|
matchProjectFromAnywhereCacheName(anywhereCacheName)
matchProjectFromAnywhereCacheName(anywhereCacheName: string): string | number;
Parse the project from AnywhereCache resource.
| Parameter |
| Name |
Description |
anywhereCacheName |
string
A fully-qualified path representing AnywhereCache resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromBucketName(bucketName)
matchProjectFromBucketName(bucketName: string): string | number;
Parse the project from Bucket resource.
| Parameter |
| Name |
Description |
bucketName |
string
A fully-qualified path representing Bucket resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromCryptoKeyName(cryptoKeyName)
matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;
Parse the project from CryptoKey resource.
| Parameter |
| Name |
Description |
cryptoKeyName |
string
A fully-qualified path representing CryptoKey resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromFolderName(folderName)
matchProjectFromFolderName(folderName: string): string | number;
Parse the project from Folder resource.
| Parameter |
| Name |
Description |
folderName |
string
A fully-qualified path representing Folder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromManagedFolderName(managedFolderName)
matchProjectFromManagedFolderName(managedFolderName: string): string | number;
Parse the project from ManagedFolder resource.
| Parameter |
| Name |
Description |
managedFolderName |
string
A fully-qualified path representing ManagedFolder resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName)
matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string): string | number;
Parse the project from ProjectLocationIntelligenceConfig resource.
| Parameter |
| Name |
Description |
projectLocationIntelligenceConfigName |
string
A fully-qualified path representing project_location_intelligenceConfig resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
| Parameter |
| Name |
Description |
projectName |
string
A fully-qualified path representing Project resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
matchProjectFromStorageLayoutName(storageLayoutName)
matchProjectFromStorageLayoutName(storageLayoutName: string): string | number;
Parse the project from StorageLayout resource.
| Parameter |
| Name |
Description |
storageLayoutName |
string
A fully-qualified path representing StorageLayout resource.
|
| Returns |
| Type |
Description |
string | number |
{string} A string representing the project.
|
orgLocationIntelligenceConfigPath(org, location)
orgLocationIntelligenceConfigPath(org: string, location: string): string;
Return a fully-qualified orgLocationIntelligenceConfig resource name string.
| Parameters |
| Name |
Description |
org |
string
|
location |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
pauseAnywhereCache(request, options)
pauseAnywhereCache(request?: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IAnywhereCache,
protos.google.storage.control.v2.IPauseAnywhereCacheRequest | undefined,
{} | undefined
]>;
Pauses an Anywhere Cache instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
*/
// const name = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callPauseAnywhereCache() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.pauseAnywhereCache(request);
console.log(response);
}
callPauseAnywhereCache();
pauseAnywhereCache(request, options, callback)
pauseAnywhereCache(request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
pauseAnywhereCache(request, callback)
pauseAnywhereCache(request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
projectLocationIntelligenceConfigPath(project, location)
projectLocationIntelligenceConfigPath(project: string, location: string): string;
Return a fully-qualified projectLocationIntelligenceConfig resource name string.
| Parameters |
| Name |
Description |
project |
string
|
location |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
| Parameter |
| Name |
Description |
project |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
renameFolder(request, options)
renameFolder(request?: protos.google.storage.control.v2.IRenameFolderRequest, options?: CallOptions): Promise<[
LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.
| Parameters |
| Name |
Description |
request |
IRenameFolderRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the source folder being renamed.
* Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
*/
// const name = 'abc123'
/**
* Required. The destination folder ID, e.g. `foo/bar/`.
*/
// const destinationFolderId = 'abc123'
/**
* Makes the operation only succeed conditional on whether the source
* folder's current metageneration matches the given value.
*/
// const ifMetagenerationMatch = 1234
/**
* Makes the operation only succeed conditional on whether the source
* folder's current metageneration does not match the given value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callRenameFolder() {
// Construct request
const request = {
name,
destinationFolderId,
};
// Run request
const [operation] = await storageControlClient.renameFolder(request);
const [response] = await operation.promise();
console.log(response);
}
callRenameFolder();
renameFolder(request, options, callback)
renameFolder(request: protos.google.storage.control.v2.IRenameFolderRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
renameFolder(request, callback)
renameFolder(request: protos.google.storage.control.v2.IRenameFolderRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
resumeAnywhereCache(request, options)
resumeAnywhereCache(request?: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IAnywhereCache,
protos.google.storage.control.v2.IResumeAnywhereCacheRequest | undefined,
{} | undefined
]>;
Resumes a disabled or paused Anywhere Cache instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name field in the request should be:
* `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
*/
// const name = 'abc123'
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callResumeAnywhereCache() {
// Construct request
const request = {
name,
};
// Run request
const response = await storageControlClient.resumeAnywhereCache(request);
console.log(response);
}
callResumeAnywhereCache();
resumeAnywhereCache(request, options, callback)
resumeAnywhereCache(request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
resumeAnywhereCache(request, callback)
resumeAnywhereCache(request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
setIamPolicy(request, options)
setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.IPolicy,
protos.google.iam.v1.ISetIamPolicyRequest | undefined,
{} | undefined
]>;
Updates an IAM policy for the specified bucket. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.
| Parameters |
| Name |
Description |
request |
ISetIamPolicyRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* REQUIRED: The complete policy to be applied to the `resource`. The size of
* the policy is limited to a few 10s of KB. An empty policy is a
* valid policy but certain Cloud Platform services (such as Projects)
* might reject them.
*/
// const policy = {}
/**
* OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
* the fields in the mask will be modified. If no mask is provided, the
* following default mask is used:
* `paths: "bindings, etag"`
*/
// const updateMask = {}
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callSetIamPolicy() {
// Construct request
const request = {
resource,
policy,
};
// Run request
const response = await storageControlClient.setIamPolicy(request);
console.log(response);
}
callSetIamPolicy();
setIamPolicy(request, options, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
setIamPolicy(request, callback)
setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
storageLayoutPath(project, bucket)
storageLayoutPath(project: string, bucket: string): string;
Return a fully-qualified storageLayout resource name string.
| Parameters |
| Name |
Description |
project |
string
|
bucket |
string
|
| Returns |
| Type |
Description |
string |
{string} Resource name string.
|
testIamPermissions(request, options)
testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
protos.google.iam.v1.ITestIamPermissionsResponse,
protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
{} | undefined
]>;
Tests a set of permissions on the given bucket, object, or managed folder to see which, if any, are held by the caller. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, projects/_/buckets/{bucket}/objects/{object} for an object, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
*/
// const resource = 'abc123'
/**
* The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
*/
// const permissions = ['abc','def']
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callTestIamPermissions() {
// Construct request
const request = {
resource,
permissions,
};
// Run request
const response = await storageControlClient.testIamPermissions(request);
console.log(response);
}
callTestIamPermissions();
testIamPermissions(request, options, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
testIamPermissions(request, callback)
testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateAnywhereCache(request, options)
updateAnywhereCache(request?: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, options?: CallOptions): Promise<[
LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Updates an Anywhere Cache instance. Mutable fields include ttl and admission_policy.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The Anywhere Cache instance to be updated.
*/
// const anywhereCache = {}
/**
* Required. List of fields to be updated. Mutable fields of AnywhereCache
* include `ttl` and `admission_policy`.
* To specify ALL fields, specify a single field with the value `*`. Note: We
* recommend against doing this. If a new field is introduced at a later time,
* an older client updating with the `*` may accidentally reset the new
* field's value.
* Not specifying any fields is an error.
*/
// const updateMask = {}
/**
* Optional. A unique identifier for this request. UUID is the recommended
* format, but other formats are still accepted. This request is only
* idempotent if a `request_id` is provided.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateAnywhereCache() {
// Construct request
const request = {
anywhereCache,
updateMask,
};
// Run request
const [operation] = await storageControlClient.updateAnywhereCache(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateAnywhereCache();
updateAnywhereCache(request, options, callback)
updateAnywhereCache(request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateAnywhereCache(request, callback)
updateAnywhereCache(request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateBucket(request, options)
updateBucket(request?: protos.google.storage.v2.IUpdateBucketRequest, options?: CallOptions): Promise<[
protos.google.storage.v2.IBucket,
protos.google.storage.v2.IUpdateBucketRequest | undefined,
{} | undefined
]>;
Updates a bucket. Changes to the bucket are readable immediately after writing, but configuration changes might take time to propagate. This method supports patch semantics.
**IAM Permissions**:
Requires storage.buckets.update IAM permission on the bucket. Additionally, to enable specific bucket features, the authenticated user must have the following permissions:
- To set bucket IP filtering rules:
storage.buckets.setIpFilter - To update public access prevention policies or access control lists (ACLs): storage.buckets.setIamPolicy
| Parameters |
| Name |
Description |
request |
IUpdateBucketRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The bucket to update.
* The bucket's `name` field is used to identify the bucket.
*/
// const bucket = {}
/**
* If set, the request modifies the bucket if its metageneration matches this
* value.
*/
// const ifMetagenerationMatch = 1234
/**
* If set, the request modifies the bucket if its metageneration doesn't
* match this value.
*/
// const ifMetagenerationNotMatch = 1234
/**
* Optional. Apply a predefined set of access controls to this bucket.
* Valid values are `authenticatedRead`, `private`, `projectPrivate`,
* `publicRead`, or `publicReadWrite`.
*/
// const predefinedAcl = 'abc123'
/**
* Optional. Apply a predefined set of default object access controls to this
* bucket. Valid values are `authenticatedRead`, `bucketOwnerFullControl`,
* `bucketOwnerRead`, `private`, `projectPrivate`, or `publicRead`.
*/
// const predefinedDefaultObjectAcl = 'abc123'
/**
* Required. List of fields to be updated.
* To specify ALL fields, equivalent to the JSON API's "update" function,
* specify a single field with the value `*`. Note: not recommended. If a new
* field is introduced at a later time, an older client updating with the `*`
* might accidentally reset the new field's value.
* Not specifying any fields is an error.
*/
// const updateMask = {}
// Imports the Storage library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateBucket() {
// Construct request
const request = {
bucket,
updateMask,
};
// Run request
const response = await storageControlClient.updateBucket(request);
console.log(response);
}
callUpdateBucket();
updateBucket(request, options, callback)
updateBucket(request: protos.google.storage.v2.IUpdateBucketRequest, options: CallOptions, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IUpdateBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateBucket(request, callback)
updateBucket(request: protos.google.storage.v2.IUpdateBucketRequest, callback: Callback<protos.google.storage.v2.IBucket, protos.google.storage.v2.IUpdateBucketRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateFolderIntelligenceConfig(request, options)
updateFolderIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Updates the Folder scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The `IntelligenceConfig` resource to be updated.
*/
// const intelligenceConfig = {}
/**
* Required. The `update_mask` that specifies the fields within the
* `IntelligenceConfig` resource that should be modified by this update. Only
* the listed fields are updated.
*/
// const updateMask = {}
/**
* Optional. The ID that uniquely identifies the request, preventing duplicate
* processing.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateFolderIntelligenceConfig() {
// Construct request
const request = {
intelligenceConfig,
updateMask,
};
// Run request
const response = await storageControlClient.updateFolderIntelligenceConfig(request);
console.log(response);
}
callUpdateFolderIntelligenceConfig();
updateFolderIntelligenceConfig(request, options, callback)
updateFolderIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateFolderIntelligenceConfig(request, callback)
updateFolderIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateOrganizationIntelligenceConfig(request, options)
updateOrganizationIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Updates the Organization scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The `IntelligenceConfig` resource to be updated.
*/
// const intelligenceConfig = {}
/**
* Required. The `update_mask` that specifies the fields within the
* `IntelligenceConfig` resource that should be modified by this update. Only
* the listed fields are updated.
*/
// const updateMask = {}
/**
* Optional. The ID that uniquely identifies the request, preventing duplicate
* processing.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateOrganizationIntelligenceConfig() {
// Construct request
const request = {
intelligenceConfig,
updateMask,
};
// Run request
const response = await storageControlClient.updateOrganizationIntelligenceConfig(request);
console.log(response);
}
callUpdateOrganizationIntelligenceConfig();
updateOrganizationIntelligenceConfig(request, options, callback)
updateOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateOrganizationIntelligenceConfig(request, callback)
updateOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateProjectIntelligenceConfig(request, options)
updateProjectIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, options?: CallOptions): Promise<[
protos.google.storage.control.v2.IIntelligenceConfig,
(protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | undefined),
{} | undefined
]>;
Updates the Project scoped singleton IntelligenceConfig resource.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The `IntelligenceConfig` resource to be updated.
*/
// const intelligenceConfig = {}
/**
* Required. The `update_mask` that specifies the fields within the
* `IntelligenceConfig` resource that should be modified by this update. Only
* the listed fields are updated.
*/
// const updateMask = {}
/**
* Optional. The ID that uniquely identifies the request, preventing duplicate
* processing.
*/
// const requestId = 'abc123'
// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control');
// Instantiates a client
const storageControlClient = new StorageControlClient();
async function callUpdateProjectIntelligenceConfig() {
// Construct request
const request = {
intelligenceConfig,
updateMask,
};
// Run request
const response = await storageControlClient.updateProjectIntelligenceConfig(request);
console.log(response);
}
callUpdateProjectIntelligenceConfig();
updateProjectIntelligenceConfig(request, options, callback)
updateProjectIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|
updateProjectIntelligenceConfig(request, callback)
updateProjectIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
| Returns |
| Type |
Description |
void |
|