Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idgoogle.storagebatchoperations.jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the Job. job_id is unique within the project, that is either set by the customer or defined by the service. Format: projects/{project}/locations/global/jobs/{job_id} . For example: "projects/123456/locations/global/jobs/job01".
bucketListobjectSpecifies a list of buckets and their objects to be transformed. (id: BucketList)
completeTimestring (google-datetime)Output only. The time that the job was completed.
countersobjectOutput only. Information about the progress of the job. (id: Counters)
createTimestring (google-datetime)Output only. The time that the job was created.
deleteObjectobjectDelete objects. (id: DeleteObject)
descriptionstringOptional. A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.
errorSummariesarrayOutput only. Summarizes errors encountered with sample error log entries.
loggingConfigobjectOptional. Logging configuration. (id: LoggingConfig)
putMetadataobjectUpdates object metadata. Allows updating fixed-key and custom metadata and fixed-key metadata i.e. Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time. (id: PutMetadata)
putObjectHoldobjectChanges object hold status. (id: PutObjectHold)
rewriteObjectobjectRewrite the object and updates metadata like KMS key. (id: RewriteObject)
scheduleTimestring (google-datetime)Output only. The time that the job was scheduled.
statestringOutput only. State of the job.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, jobsIdGets a batch job.
listselectprojectsId, locationsIdfilter, pageSize, pageToken, orderByLists Jobs in a given project.
createinsertprojectsId, locationsIdjobId, requestIdCreates a batch job.
deletedeleteprojectsId, locationsId, jobsIdrequestIdDeletes a batch job.
cancelexecprojectsId, locationsId, jobsIdCancels a batch job.

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
jobsIdstring
locationsIdstring
projectsIdstring
filterstring
jobIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples

Gets a batch job.

SELECT
name,
bucketList,
completeTime,
counters,
createTime,
deleteObject,
description,
errorSummaries,
loggingConfig,
putMetadata,
putObjectHold,
rewriteObject,
scheduleTime,
state
FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND jobsId = '{{ jobsId }}' -- required;

INSERT examples

Creates a batch job.

INSERT INTO google.storagebatchoperations.jobs (
data__name,
data__description,
data__bucketList,
data__putObjectHold,
data__deleteObject,
data__putMetadata,
data__rewriteObject,
data__loggingConfig,
projectsId,
locationsId,
jobId,
requestId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ bucketList }}',
'{{ putObjectHold }}',
'{{ deleteObject }}',
'{{ putMetadata }}',
'{{ rewriteObject }}',
'{{ loggingConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ jobId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a batch job.

DELETE FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND jobsId = '{{ jobsId }}' --required
AND requestId = '{{ requestId }}';

Lifecycle Methods

Cancels a batch job.

EXEC google.storagebatchoperations.jobs.cancel 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@jobsId='{{ jobsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}';