Skip to main content

transfer_jobs

Creates, updates, deletes, gets or lists a transfer_jobs resource.

Overview

Nametransfer_jobs
TypeResource
Idgoogle.storagetransfer.transfer_jobs

Fields

NameDatatypeDescription
namestringA unique name (within the transfer project) assigned when the job is created. If this field is empty in a CreateTransferJobRequest, Storage Transfer Service assigns a unique name. Otherwise, the specified name is used as the unique name for this job. If the specified name is in use by a job, the creation request fails with an ALREADYEXISTS error. This name must start with "transferJobs/" prefix and end with a letter or a number, and should be no more than 128 characters. For transfers involving PosixFilesystem, this name must start with transferJobs/OPI specifically. For all other transfer types, this name must not start with transferJobs/OPI. Non-PosixFilesystem example: `"transferJobs/^(?!OPI)[A-Za-z0-9-.~][A-Za-z0-9]$"PosixFilesystem example:"transferJobs/OPI^[A-Za-z0-9-._~][A-Za-z0-9]$"` Applications must not rely on the enforcement of naming requirements involving OPI. Invalid job names fail with an INVALID_ARGUMENT error.
descriptionstringA description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.
creationTimestringOutput only. The time that the transfer job was created.
deletionTimestringOutput only. The time that the transfer job was deleted.
eventStreamobjectSpecifies the Event-driven transfer options. Event-driven transfers listen to an event stream to transfer updated files.
lastModificationTimestringOutput only. The time that the transfer job was last modified.
latestOperationNamestringThe name of the most recently started TransferOperation of this JobConfig. Present if a TransferOperation has been created for this JobConfig.
loggingConfigobjectSpecifies the logging behavior for transfer operations. Logs can be sent to Cloud Logging for all transfer types. See Read transfer logs for details.
notificationConfigobjectSpecification to configure notifications published to Pub/Sub. Notifications are published to the customer-provided topic using the following PubsubMessage.attributes: "eventType": one of the EventType values "payloadFormat": one of the PayloadFormat values "projectId": the project_id of the TransferOperation "transferJobName": the transfer_job_name of the TransferOperation * "transferOperationName": the name of the TransferOperation The PubsubMessage.data contains a TransferOperation resource formatted according to the specified PayloadFormat.
projectIdstringThe ID of the Google Cloud project that owns the job.
replicationSpecobjectSpecifies the configuration for running a replication job.
scheduleobjectTransfers can be scheduled to recur or to run just once.
statusstringStatus of the job. This value MUST be specified for CreateTransferJobRequests. Note: The effect of the new job status takes place during a subsequent job run. For example, if you change the job status from ENABLED to DISABLED, and an operation spawned by the transfer is running, the status change would not affect the current operation.
transferSpecobjectConfiguration for running a transfer.

Methods

NameAccessible byRequired ParamsDescription
getSELECTprojectId, transferJobsIdGets a transfer job.
listSELECTfilterLists transfer jobs.
createINSERTCreates a transfer job that runs periodically.
deleteDELETEprojectId, transferJobsIdDeletes a transfer job. Deleting a transfer job sets its status to DELETED.
patchUPDATEtransferJobsIdUpdates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Note: The job's status field can be modified using this RPC (for example, to set a job's status to DELETED, DISABLED, or ENABLED).
runEXECtransferJobsIdStarts 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.

SELECT examples

Lists transfer jobs.

SELECT
name,
description,
creationTime,
deletionTime,
eventStream,
lastModificationTime,
latestOperationName,
loggingConfig,
notificationConfig,
projectId,
replicationSpec,
schedule,
status,
transferSpec
FROM google.storagetransfer.transfer_jobs
WHERE filter = '{{ filter }}';

INSERT example

Use the following StackQL query and manifest file to create a new transfer_jobs resource.

/*+ create */
INSERT INTO google.storagetransfer.transfer_jobs (
name,
description,
projectId,
transferSpec,
replicationSpec,
notificationConfig,
loggingConfig,
schedule,
eventStream,
status,
latestOperationName
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ projectId }}',
'{{ transferSpec }}',
'{{ replicationSpec }}',
'{{ notificationConfig }}',
'{{ loggingConfig }}',
'{{ schedule }}',
'{{ eventStream }}',
'{{ status }}',
'{{ latestOperationName }}'
;

UPDATE example

Updates a transfer_jobs resource.

/*+ update */
UPDATE google.storagetransfer.transfer_jobs
SET
projectId = '{{ projectId }}',
transferJob = '{{ transferJob }}',
updateTransferJobFieldMask = '{{ updateTransferJobFieldMask }}'
WHERE
transferJobsId = '{{ transferJobsId }}';

DELETE example

Deletes the specified transfer_jobs resource.

/*+ delete */
DELETE FROM google.storagetransfer.transfer_jobs
WHERE projectId = '{{ projectId }}'
AND transferJobsId = '{{ transferJobsId }}';