Storage Transfer Service and its protos. Transfers data between between Google Cloud Storage buckets or from a data source external to Google to a Cloud Storage bucket. v1
Package
@google-cloud/storage-transferConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of StorageTransferServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
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.
storageTransferServiceStub
storageTransferServiceStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
agentPoolsPath(projectId, agentPoolId)
agentPoolsPath(projectId: string, agentPoolId: string): string;
Return a fully-qualified agentPools resource name string.
Parameters | |
---|---|
Name | Description |
projectId |
string
|
agentPoolId |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): 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 | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkRunTransferJobProgress(name)
checkRunTransferJobProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.storagetransfer.v1.TransferOperation>>;
Check the status of the long running operation returned by runTransferJob()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.storagetransfer.v1.TransferOperation>> | {Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* 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 transfer job.
*/
// const jobName = 'abc123'
/**
* Required. The ID of the Google Cloud project that owns the transfer
* job.
*/
// const projectId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callRunTransferJob() {
// Construct request
const request = {
jobName,
projectId,
};
// Run request
const [operation] = await storagetransferClient.runTransferJob(request);
const [response] = await operation.promise();
console.log(response);
}
callRunTransferJob();
close()
close(): Promise<void>;
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. |
createAgentPool(request, options)
createAgentPool(request?: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.ICreateAgentPoolRequest | undefined,
{} | undefined
]>;
Creates an agent pool resource.
Parameters | |
---|---|
Name | Description |
request |
ICreateAgentPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.ICreateAgentPoolRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 ID of the Google Cloud project that owns the
* agent pool.
*/
// const projectId = 'abc123'
/**
* Required. The agent pool to create.
*/
// const agentPool = {}
/**
* Required. The ID of the agent pool to create.
* The `agent_pool_id` must meet the following requirements:
* * Length of 128 characters or less.
* * Not start with the string `goog`.
* * Start with a lowercase ASCII character, followed by:
* * Zero or more: lowercase Latin alphabet characters, numerals,
* hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`).
* * One or more numerals or lowercase ASCII characters.
* As expressed by the regular expression:
* `^(?!goog)a-z(a-z0-9-._~*a-z0-9)?$`.
*/
// const agentPoolId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callCreateAgentPool() {
// Construct request
const request = {
projectId,
agentPool,
agentPoolId,
};
// Run request
const response = await storagetransferClient.createAgentPool(request);
console.log(response);
}
callCreateAgentPool();
createAgentPool(request, options, callback)
createAgentPool(request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.ICreateAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateAgentPoolRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.ICreateAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createAgentPool(request, callback)
createAgentPool(request: protos.google.storagetransfer.v1.ICreateAgentPoolRequest, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.ICreateAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateAgentPoolRequest
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.ICreateAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createTransferJob(request, options)
createTransferJob(request?: protos.google.storagetransfer.v1.ICreateTransferJobRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.ICreateTransferJobRequest | undefined,
{} | undefined
]>;
Creates a transfer job that runs periodically.
Parameters | |
---|---|
Name | Description |
request |
ICreateTransferJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.ICreateTransferJobRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 job to create.
*/
// const transferJob = {}
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callCreateTransferJob() {
// Construct request
const request = {
transferJob,
};
// Run request
const response = await storagetransferClient.createTransferJob(request);
console.log(response);
}
callCreateTransferJob();
createTransferJob(request, options, callback)
createTransferJob(request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.ICreateTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateTransferJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.ICreateTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createTransferJob(request, callback)
createTransferJob(request: protos.google.storagetransfer.v1.ICreateTransferJobRequest, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.ICreateTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
ICreateTransferJobRequest
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.ICreateTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteAgentPool(request, options)
deleteAgentPool(request?: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | undefined,
{} | undefined
]>;
Deletes an agent pool.
Parameters | |
---|---|
Name | Description |
request |
IDeleteAgentPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* 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 agent pool to delete.
*/
// const name = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callDeleteAgentPool() {
// Construct request
const request = {
name,
};
// Run request
const response = await storagetransferClient.deleteAgentPool(request);
console.log(response);
}
callDeleteAgentPool();
deleteAgentPool(request, options, callback)
deleteAgentPool(request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteAgentPoolRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteAgentPool(request, callback)
deleteAgentPool(request: protos.google.storagetransfer.v1.IDeleteAgentPoolRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteAgentPoolRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): 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 | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<protos.google.protobuf.Empty> |
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
deleteTransferJob(request, options)
deleteTransferJob(request?: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.storagetransfer.v1.IDeleteTransferJobRequest | undefined,
{} | undefined
]>;
Deletes a transfer job. Deleting a transfer job sets its status to .
Parameters | |
---|---|
Name | Description |
request |
IDeleteTransferJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
protos.google.storagetransfer.v1.IDeleteTransferJobRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* 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 job to delete.
*/
// const jobName = 'abc123'
/**
* Required. The ID of the Google Cloud project that owns the
* job.
*/
// const projectId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callDeleteTransferJob() {
// Construct request
const request = {
jobName,
projectId,
};
// Run request
const response = await storagetransferClient.deleteTransferJob(request);
console.log(response);
}
callDeleteTransferJob();
deleteTransferJob(request, options, callback)
deleteTransferJob(request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteTransferJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteTransferJob(request, callback)
deleteTransferJob(request: protos.google.storagetransfer.v1.IDeleteTransferJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IDeleteTransferJobRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IDeleteTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getAgentPool(request, options)
getAgentPool(request?: protos.google.storagetransfer.v1.IGetAgentPoolRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.IGetAgentPoolRequest | undefined,
{} | undefined
]>;
Gets an agent pool.
Parameters | |
---|---|
Name | Description |
request |
IGetAgentPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.IGetAgentPoolRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 agent pool to get.
*/
// const name = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callGetAgentPool() {
// Construct request
const request = {
name,
};
// Run request
const response = await storagetransferClient.getAgentPool(request);
console.log(response);
}
callGetAgentPool();
getAgentPool(request, options, callback)
getAgentPool(request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetAgentPoolRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getAgentPool(request, callback)
getAgentPool(request: protos.google.storagetransfer.v1.IGetAgentPoolRequest, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetAgentPoolRequest
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IGetAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getGoogleServiceAccount(request, options)
getGoogleServiceAccount(request?: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.IGoogleServiceAccount,
(protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | undefined),
{} | undefined
]>;
Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.
Parameters | |
---|---|
Name | Description |
request |
IGetGoogleServiceAccountRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.IGoogleServiceAccount,
(protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing GoogleServiceAccount. Please see the documentation for more details and examples. |
/**
* 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 ID of the Google Cloud project that the Google service
* account is associated with.
*/
// const projectId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callGetGoogleServiceAccount() {
// Construct request
const request = {
projectId,
};
// Run request
const response = await storagetransferClient.getGoogleServiceAccount(request);
console.log(response);
}
callGetGoogleServiceAccount();
getGoogleServiceAccount(request, options, callback)
getGoogleServiceAccount(request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.IGoogleServiceAccount, protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetGoogleServiceAccountRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.IGoogleServiceAccount, protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getGoogleServiceAccount(request, callback)
getGoogleServiceAccount(request: protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest, callback: Callback<protos.google.storagetransfer.v1.IGoogleServiceAccount, protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetGoogleServiceAccountRequest
|
callback |
Callback<protos.google.storagetransfer.v1.IGoogleServiceAccount, protos.google.storagetransfer.v1.IGetGoogleServiceAccountRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): 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 | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
Returns | |
---|---|
Type | Description |
Promise<[protos.google.longrunning.Operation]> |
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
getProjectId()
getProjectId(): Promise<string>;
Returns | |
---|---|
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter | |
---|---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns | |
---|---|
Type | Description |
void |
getTransferJob(request, options)
getTransferJob(request?: protos.google.storagetransfer.v1.IGetTransferJobRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.IGetTransferJobRequest | undefined,
{} | undefined
]>;
Gets a transfer job.
Parameters | |
---|---|
Name | Description |
request |
IGetTransferJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.IGetTransferJobRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 job to get.
*/
// const jobName = 'abc123'
/**
* Required. The ID of the Google Cloud project that owns the
* job.
*/
// const projectId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callGetTransferJob() {
// Construct request
const request = {
jobName,
projectId,
};
// Run request
const response = await storagetransferClient.getTransferJob(request);
console.log(response);
}
callGetTransferJob();
getTransferJob(request, options, callback)
getTransferJob(request: protos.google.storagetransfer.v1.IGetTransferJobRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IGetTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetTransferJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IGetTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getTransferJob(request, callback)
getTransferJob(request: protos.google.storagetransfer.v1.IGetTransferJobRequest, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IGetTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IGetTransferJobRequest
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IGetTransferJobRequest | null | undefined, {} | null | undefined>
|
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. |
listAgentPools(request, options)
listAgentPools(request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.IAgentPool[],
protos.google.storagetransfer.v1.IListAgentPoolsRequest | null,
protos.google.storagetransfer.v1.IListAgentPoolsResponse
]>;
Lists agent pools.
Parameters | |
---|---|
Name | Description |
request |
IListAgentPoolsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.IAgentPool[],
protos.google.storagetransfer.v1.IListAgentPoolsRequest | null,
protos.google.storagetransfer.v1.IListAgentPoolsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listAgentPools(request, options, callback)
listAgentPools(request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, options: CallOptions, callback: PaginationCallback<protos.google.storagetransfer.v1.IListAgentPoolsRequest, protos.google.storagetransfer.v1.IListAgentPoolsResponse | null | undefined, protos.google.storagetransfer.v1.IAgentPool>): void;
Parameters | |
---|---|
Name | Description |
request |
IListAgentPoolsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.storagetransfer.v1.IListAgentPoolsRequest, protos.google.storagetransfer.v1.IListAgentPoolsResponse | null | undefined, protos.google.storagetransfer.v1.IAgentPool>
|
Returns | |
---|---|
Type | Description |
void |
listAgentPools(request, callback)
listAgentPools(request: protos.google.storagetransfer.v1.IListAgentPoolsRequest, callback: PaginationCallback<protos.google.storagetransfer.v1.IListAgentPoolsRequest, protos.google.storagetransfer.v1.IListAgentPoolsResponse | null | undefined, protos.google.storagetransfer.v1.IAgentPool>): void;
Parameters | |
---|---|
Name | Description |
request |
IListAgentPoolsRequest
|
callback |
PaginationCallback<protos.google.storagetransfer.v1.IListAgentPoolsRequest, protos.google.storagetransfer.v1.IListAgentPoolsResponse | null | undefined, protos.google.storagetransfer.v1.IAgentPool>
|
Returns | |
---|---|
Type | Description |
void |
listAgentPoolsAsync(request, options)
listAgentPoolsAsync(request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, options?: CallOptions): AsyncIterable<protos.google.storagetransfer.v1.IAgentPool>;
Equivalent to listAgentPools
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListAgentPoolsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.storagetransfer.v1.IAgentPool> | {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. |
/**
* 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 ID of the Google Cloud project that owns the job.
*/
// const projectId = 'abc123'
/**
* An optional list of query parameters specified as JSON text in the
* form of:
* `{"agentPoolNames":"agentpool1","agentpool2",... }`
* Since `agentPoolNames` support multiple values, its values must be
* specified with array notation. When the filter is either empty or not
* provided, the list returns all agent pools for the project.
*/
// const filter = 'abc123'
/**
* The list page size. The max allowed value is `256`.
*/
// const pageSize = 1234
/**
* The list page token.
*/
// const pageToken = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callListAgentPools() {
// Construct request
const request = {
projectId,
};
// Run request
const iterable = await storagetransferClient.listAgentPoolsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAgentPools();
listAgentPoolsStream(request, options)
listAgentPoolsStream(request?: protos.google.storagetransfer.v1.IListAgentPoolsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListAgentPoolsRequest
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 |
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;
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. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.longrunning.ListOperationsResponse> | {Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
listTransferJobs(request, options)
listTransferJobs(request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.ITransferJob[],
protos.google.storagetransfer.v1.IListTransferJobsRequest | null,
protos.google.storagetransfer.v1.IListTransferJobsResponse
]>;
Lists transfer jobs.
Parameters | |
---|---|
Name | Description |
request |
IListTransferJobsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.ITransferJob[],
protos.google.storagetransfer.v1.IListTransferJobsRequest | null,
protos.google.storagetransfer.v1.IListTransferJobsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listTransferJobs(request, options, callback)
listTransferJobs(request: protos.google.storagetransfer.v1.IListTransferJobsRequest, options: CallOptions, callback: PaginationCallback<protos.google.storagetransfer.v1.IListTransferJobsRequest, protos.google.storagetransfer.v1.IListTransferJobsResponse | null | undefined, protos.google.storagetransfer.v1.ITransferJob>): void;
Parameters | |
---|---|
Name | Description |
request |
IListTransferJobsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.storagetransfer.v1.IListTransferJobsRequest, protos.google.storagetransfer.v1.IListTransferJobsResponse | null | undefined, protos.google.storagetransfer.v1.ITransferJob>
|
Returns | |
---|---|
Type | Description |
void |
listTransferJobs(request, callback)
listTransferJobs(request: protos.google.storagetransfer.v1.IListTransferJobsRequest, callback: PaginationCallback<protos.google.storagetransfer.v1.IListTransferJobsRequest, protos.google.storagetransfer.v1.IListTransferJobsResponse | null | undefined, protos.google.storagetransfer.v1.ITransferJob>): void;
Parameters | |
---|---|
Name | Description |
request |
IListTransferJobsRequest
|
callback |
PaginationCallback<protos.google.storagetransfer.v1.IListTransferJobsRequest, protos.google.storagetransfer.v1.IListTransferJobsResponse | null | undefined, protos.google.storagetransfer.v1.ITransferJob>
|
Returns | |
---|---|
Type | Description |
void |
listTransferJobsAsync(request, options)
listTransferJobsAsync(request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, options?: CallOptions): AsyncIterable<protos.google.storagetransfer.v1.ITransferJob>;
Equivalent to listTransferJobs
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
IListTransferJobsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.storagetransfer.v1.ITransferJob> | {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. |
/**
* 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. A list of query parameters specified as JSON text in the form of:
* `{"projectId":"my_project_id",
* "jobNames":"jobid1","jobid2",...,
* "jobStatuses":"status1","status2",... }`
* Since `jobNames` and `jobStatuses` support multiple values, their values
* must be specified with array notation. `projectId` is required.
* `jobNames` and `jobStatuses` are optional. The valid values for
* `jobStatuses` are case-insensitive:
* ENABLED google.storagetransfer.v1.TransferJob.Status.ENABLED,
* DISABLED google.storagetransfer.v1.TransferJob.Status.DISABLED, and
* DELETED google.storagetransfer.v1.TransferJob.Status.DELETED.
*/
// const filter = 'abc123'
/**
* The list page size. The max allowed value is 256.
*/
// const pageSize = 1234
/**
* The list page token.
*/
// const pageToken = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callListTransferJobs() {
// Construct request
const request = {
filter,
};
// Run request
const iterable = await storagetransferClient.listTransferJobsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListTransferJobs();
listTransferJobsStream(request, options)
listTransferJobsStream(request?: protos.google.storagetransfer.v1.IListTransferJobsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
IListTransferJobsRequest
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 |
matchAgentPoolIdFromAgentPoolsName(agentPoolsName)
matchAgentPoolIdFromAgentPoolsName(agentPoolsName: string): string | number;
Parse the agent_pool_id from AgentPools resource.
Parameter | |
---|---|
Name | Description |
agentPoolsName |
string
A fully-qualified path representing agentPools resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the agent_pool_id. |
matchProjectIdFromAgentPoolsName(agentPoolsName)
matchProjectIdFromAgentPoolsName(agentPoolsName: string): string | number;
Parse the project_id from AgentPools resource.
Parameter | |
---|---|
Name | Description |
agentPoolsName |
string
A fully-qualified path representing agentPools resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project_id. |
pauseTransferOperation(request, options)
pauseTransferOperation(request?: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.storagetransfer.v1.IPauseTransferOperationRequest | undefined),
{} | undefined
]>;
Pauses a transfer operation.
Parameters | |
---|---|
Name | Description |
request |
IPauseTransferOperationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.storagetransfer.v1.IPauseTransferOperationRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* 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 transfer operation.
*/
// const name = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callPauseTransferOperation() {
// Construct request
const request = {
name,
};
// Run request
const response = await storagetransferClient.pauseTransferOperation(request);
console.log(response);
}
callPauseTransferOperation();
pauseTransferOperation(request, options, callback)
pauseTransferOperation(request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IPauseTransferOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IPauseTransferOperationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IPauseTransferOperationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
pauseTransferOperation(request, callback)
pauseTransferOperation(request: protos.google.storagetransfer.v1.IPauseTransferOperationRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IPauseTransferOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IPauseTransferOperationRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IPauseTransferOperationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
resumeTransferOperation(request, options)
resumeTransferOperation(request?: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.storagetransfer.v1.IResumeTransferOperationRequest | undefined),
{} | undefined
]>;
Resumes a transfer operation that is paused.
Parameters | |
---|---|
Name | Description |
request |
IResumeTransferOperationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.protobuf.IEmpty,
(protos.google.storagetransfer.v1.IResumeTransferOperationRequest | undefined),
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples. |
/**
* 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 transfer operation.
*/
// const name = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callResumeTransferOperation() {
// Construct request
const request = {
name,
};
// Run request
const response = await storagetransferClient.resumeTransferOperation(request);
console.log(response);
}
callResumeTransferOperation();
resumeTransferOperation(request, options, callback)
resumeTransferOperation(request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IResumeTransferOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IResumeTransferOperationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IResumeTransferOperationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
resumeTransferOperation(request, callback)
resumeTransferOperation(request: protos.google.storagetransfer.v1.IResumeTransferOperationRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IResumeTransferOperationRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IResumeTransferOperationRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.IResumeTransferOperationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
runTransferJob(request, options)
runTransferJob(request?: protos.google.storagetransfer.v1.IRunTransferJobRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Starts a new operation for the specified transfer job. A TransferJob
has a maximum of one active TransferOperation
. If this method is called while a TransferOperation
is active, an error is returned.
Parameters | |
---|---|
Name | Description |
request |
IRunTransferJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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 transfer job.
*/
// const jobName = 'abc123'
/**
* Required. The ID of the Google Cloud project that owns the transfer
* job.
*/
// const projectId = 'abc123'
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callRunTransferJob() {
// Construct request
const request = {
jobName,
projectId,
};
// Run request
const [operation] = await storagetransferClient.runTransferJob(request);
const [response] = await operation.promise();
console.log(response);
}
callRunTransferJob();
runTransferJob(request, options, callback)
runTransferJob(request: protos.google.storagetransfer.v1.IRunTransferJobRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IRunTransferJobRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
runTransferJob(request, callback)
runTransferJob(request: protos.google.storagetransfer.v1.IRunTransferJobRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IRunTransferJobRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.storagetransfer.v1.ITransferOperation>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateAgentPool(request, options)
updateAgentPool(request?: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | undefined,
{} | undefined
]>;
Updates an existing agent pool resource.
Parameters | |
---|---|
Name | Description |
request |
IUpdateAgentPoolRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.IAgentPool,
protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 agent pool to update. `agent_pool` is expected to specify
* following fields:
* * name google.storagetransfer.v1.AgentPool.name
* * display_name google.storagetransfer.v1.AgentPool.display_name
* * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit
* An `UpdateAgentPoolRequest` with any other fields is rejected
* with the error INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT.
*/
// const agentPool = {}
/**
* The field mask
* (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf)
* of the fields in `agentPool` to update in this request.
* The following `agentPool` fields can be updated:
* * display_name google.storagetransfer.v1.AgentPool.display_name
* * bandwidth_limit google.storagetransfer.v1.AgentPool.bandwidth_limit
*/
// const updateMask = {}
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callUpdateAgentPool() {
// Construct request
const request = {
agentPool,
};
// Run request
const response = await storagetransferClient.updateAgentPool(request);
console.log(response);
}
callUpdateAgentPool();
updateAgentPool(request, options, callback)
updateAgentPool(request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateAgentPoolRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateAgentPool(request, callback)
updateAgentPool(request: protos.google.storagetransfer.v1.IUpdateAgentPoolRequest, callback: Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateAgentPoolRequest
|
callback |
Callback<protos.google.storagetransfer.v1.IAgentPool, protos.google.storagetransfer.v1.IUpdateAgentPoolRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateTransferJob(request, options)
updateTransferJob(request?: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, options?: CallOptions): Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.IUpdateTransferJobRequest | undefined,
{} | undefined
]>;
Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.
**Note:** The job's field can be modified using this RPC (for example, to set a job's status to , , or ).
Parameters | |
---|---|
Name | Description |
request |
IUpdateTransferJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.storagetransfer.v1.ITransferJob,
protos.google.storagetransfer.v1.IUpdateTransferJobRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples. |
/**
* 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 job to update.
*/
// const jobName = 'abc123'
/**
* Required. The ID of the Google Cloud project that owns the
* job.
*/
// const projectId = 'abc123'
/**
* Required. The job to update. `transferJob` is expected to specify one or
* more of five fields:
* description google.storagetransfer.v1.TransferJob.description,
* transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec,
* notification_config google.storagetransfer.v1.TransferJob.notification_config,
* logging_config google.storagetransfer.v1.TransferJob.logging_config, and
* status google.storagetransfer.v1.TransferJob.status. An
* `UpdateTransferJobRequest` that specifies other fields are rejected with
* the error INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT. Updating a
* job status to
* DELETED google.storagetransfer.v1.TransferJob.Status.DELETED requires
* `storagetransfer.jobs.delete` permission.
*/
// const transferJob = {}
/**
* The field mask of the fields in `transferJob` that are to be updated in
* this request. Fields in `transferJob` that can be updated are:
* description google.storagetransfer.v1.TransferJob.description,
* transfer_spec google.storagetransfer.v1.TransferJob.transfer_spec,
* notification_config google.storagetransfer.v1.TransferJob.notification_config,
* logging_config google.storagetransfer.v1.TransferJob.logging_config, and
* status google.storagetransfer.v1.TransferJob.status. To update the
* `transfer_spec` of the job, a complete transfer specification must be
* provided. An incomplete specification missing any required fields is
* rejected with the error
* INVALID_ARGUMENT google.rpc.Code.INVALID_ARGUMENT.
*/
// const updateTransferJobFieldMask = {}
// Imports the Storagetransfer library
const {StorageTransferServiceClient} = require('@google-cloud/storage-transfer').v1;
// Instantiates a client
const storagetransferClient = new StorageTransferServiceClient();
async function callUpdateTransferJob() {
// Construct request
const request = {
jobName,
projectId,
transferJob,
};
// Run request
const response = await storagetransferClient.updateTransferJob(request);
console.log(response);
}
callUpdateTransferJob();
updateTransferJob(request, options, callback)
updateTransferJob(request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, options: CallOptions, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IUpdateTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateTransferJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IUpdateTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
updateTransferJob(request, callback)
updateTransferJob(request: protos.google.storagetransfer.v1.IUpdateTransferJobRequest, callback: Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IUpdateTransferJobRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
IUpdateTransferJobRequest
|
callback |
Callback<protos.google.storagetransfer.v1.ITransferJob, protos.google.storagetransfer.v1.IUpdateTransferJobRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |