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

The following fields are returned by SELECT queries:

Successful response

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 ALREADY_EXISTS 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.
creationTimestring (google-datetime)Output only. The time that the transfer job was created.
deletionTimestring (google-datetime)Output only. The time that the transfer job was deleted.
descriptionstringA description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.
eventStreamobjectSpecifies the event stream for the transfer job for event-driven transfers. When EventStream is specified, the Schedule fields are ignored. (id: EventStream)
lastModificationTimestring (google-datetime)Output 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.
loggingConfigobjectLogging configuration. (id: LoggingConfig)
notificationConfigobjectNotification configuration. (id: NotificationConfig)
projectIdstringThe ID of the Google Cloud project that owns the job.
replicationSpecobjectReplication specification. (id: ReplicationSpec)
scheduleobjectSpecifies schedule for the transfer job. This is an optional field. When the field is not set, the job never executes a transfer, unless you invoke RunTransferJob or update the job to have a non-empty schedule. (id: Schedule)
serviceAccountstringOptional. The user-managed service account to which to delegate service agent permissions. You can grant Cloud Storage bucket permissions to this service account instead of to the Transfer Service service agent. Format is projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID Either the service account email (SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com) or the unique ID (123456789012345678901) are accepted in the string. The - wildcard character is required; replacing it with a project ID is invalid. See https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions for required permissions.
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.
transferSpecobjectTransfer specification. (id: TransferSpec)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttransferJobsId, projectIdGets a transfer job.
listselectfilterpageSize, pageTokenLists transfer jobs.
createinsertCreates a transfer job that runs periodically.
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).
deletedeletetransferJobsId, projectIdDeletes a transfer job. Deleting a transfer job sets its status to DELETED.
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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
filterstring
projectIdstring
transferJobsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a transfer job.

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

INSERT examples

Creates a transfer job that runs periodically.

INSERT INTO google.storagetransfer.transfer_jobs (
data__name,
data__description,
data__projectId,
data__serviceAccount,
data__transferSpec,
data__replicationSpec,
data__notificationConfig,
data__loggingConfig,
data__schedule,
data__eventStream,
data__status,
data__latestOperationName
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ projectId }}',
'{{ serviceAccount }}',
'{{ transferSpec }}',
'{{ replicationSpec }}',
'{{ notificationConfig }}',
'{{ loggingConfig }}',
'{{ schedule }}',
'{{ eventStream }}',
'{{ status }}',
'{{ latestOperationName }}'
RETURNING
name,
creationTime,
deletionTime,
description,
eventStream,
lastModificationTime,
latestOperationName,
loggingConfig,
notificationConfig,
projectId,
replicationSpec,
schedule,
serviceAccount,
status,
transferSpec
;

UPDATE examples

Updates 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).

UPDATE google.storagetransfer.transfer_jobs
SET
data__projectId = '{{ projectId }}',
data__transferJob = '{{ transferJob }}',
data__updateTransferJobFieldMask = '{{ updateTransferJobFieldMask }}'
WHERE
transferJobsId = '{{ transferJobsId }}' --required
RETURNING
name,
creationTime,
deletionTime,
description,
eventStream,
lastModificationTime,
latestOperationName,
loggingConfig,
notificationConfig,
projectId,
replicationSpec,
schedule,
serviceAccount,
status,
transferSpec;

DELETE examples

Deletes a transfer job. Deleting a transfer job sets its status to DELETED.

DELETE FROM google.storagetransfer.transfer_jobs
WHERE transferJobsId = '{{ transferJobsId }}' --required
AND projectId = '{{ projectId }}' --required;

Lifecycle Methods

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.

EXEC google.storagetransfer.transfer_jobs.run 
@transferJobsId='{{ transferJobsId }}' --required
@@json=
'{
"projectId": "{{ projectId }}"
}';