jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | google.storagebatchoperations.jobs |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Identifier. The resource name of the job. Format: projects/{project_id}/locations/global/jobs/{job_id}. For example: projects/123456/locations/global/jobs/job01. job_id is unique in a given project. |
bucketList | object | Specifies a list of buckets and their objects to be transformed. (id: BucketList) |
completeTime | string (google-datetime) | Output only. The time that the job was completed. |
counters | object | Output only. Information about the progress of the job. (id: Counters) |
createTime | string (google-datetime) | Output only. The time that the job was created. |
deleteObject | object | Delete objects. (id: DeleteObject) |
description | string | Optional. A user-provided description for the job. Maximum length: 1024 bytes when unicode-encoded. |
dryRun | boolean | Optional. If true, the job runs in dry run mode, returning the total object count and, if the object configuration is a prefix list, the bytes found from source. No transformations are performed. |
errorSummaries | array | Output only. Summarizes errors encountered with sample error log entries. |
isMultiBucketJob | boolean | Output only. If true, this job operates on multiple buckets. Multi-bucket jobs are subject to different quota limits than single-bucket jobs. |
loggingConfig | object | Optional. Logging configuration. (id: LoggingConfig) |
projectSource | object | Specifies a project source and filters to identify objects to be transformed. (id: ProjectSource) |
putMetadata | object | Updates object metadata. Allows updating fixed-key and custom metadata. For example, Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time, and Retention configuration. (id: PutMetadata) |
putObjectHold | object | Changes object hold status. (id: PutObjectHold) |
rewriteObject | object | Rewrite the object and updates metadata like KMS key. (id: RewriteObject) |
scheduleTime | string (google-datetime) | Output only. The time that the job was scheduled. |
setObjectAcls | object | Updates object ACLs. (id: SetObjectAcls) |
state | string | Output only. State of the job. (STATE_UNSPECIFIED, RUNNING, SUCCEEDED, CANCELED, FAILED, QUEUED) |
updateObjectCustomContext | object | Update object custom context. (id: UpdateObjectCustomContext) |
| Name | Datatype | Description |
|---|
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, jobsId | Gets a batch job. | |
list | select | projectsId, locationsId | filter, pageSize, orderBy, pageToken | Lists Jobs in a given project. |
create | insert | projectsId, locationsId | jobId, requestId | Creates a batch job. |
delete | delete | projectsId, locationsId, jobsId | requestId, force | Deletes a batch job. |
cancel | exec | projectsId, locationsId, jobsId | Cancels 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.
| Name | Datatype | Description |
|---|---|---|
jobsId | string | |
locationsId | string | |
projectsId | string | |
filter | string | |
force | boolean | |
jobId | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string |
SELECT examples
- get
- list
Gets a batch job.
SELECT
name,
bucketList,
completeTime,
counters,
createTime,
deleteObject,
description,
dryRun,
errorSummaries,
isMultiBucketJob,
loggingConfig,
projectSource,
putMetadata,
putObjectHold,
rewriteObject,
scheduleTime,
setObjectAcls,
state,
updateObjectCustomContext
FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND jobsId = '{{ jobsId }}' -- required
;
Lists Jobs in a given project.
SELECT
*
FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- create
- Manifest
Creates a batch job.
INSERT INTO google.storagebatchoperations.jobs (
data__updateObjectCustomContext,
data__setObjectAcls,
data__name,
data__putMetadata,
data__bucketList,
data__putObjectHold,
data__projectSource,
data__rewriteObject,
data__dryRun,
data__deleteObject,
data__description,
data__loggingConfig,
projectsId,
locationsId,
jobId,
requestId
)
SELECT
'{{ updateObjectCustomContext }}',
'{{ setObjectAcls }}',
'{{ name }}',
'{{ putMetadata }}',
'{{ bucketList }}',
'{{ putObjectHold }}',
'{{ projectSource }}',
'{{ rewriteObject }}',
{{ dryRun }},
'{{ deleteObject }}',
'{{ description }}',
'{{ loggingConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ jobId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the jobs resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the jobs resource.
- name: updateObjectCustomContext
description: |
Update object custom context.
value:
customContextUpdates:
keysToClear:
- "{{ keysToClear }}"
updates: "{{ updates }}"
clearAll: {{ clearAll }}
- name: setObjectAcls
description: |
Updates object ACLs.
value:
accessControlsUpdates:
removeEntities:
- "{{ removeEntities }}"
grants:
- entity: "{{ entity }}"
role: "{{ role }}"
- name: name
value: "{{ name }}"
description: |
Identifier. The resource name of the job. Format: `projects/{project_id}/locations/global/jobs/{job_id}`. For example: `projects/123456/locations/global/jobs/job01`. `job_id` is unique in a given project.
- name: putMetadata
description: |
Updates object metadata. Allows updating fixed-key and custom metadata. For example, `Cache-Control`, `Content-Disposition`, `Content-Encoding`, `Content-Language`, `Content-Type`, `Custom-Time`, and `Retention configuration`.
value:
objectRetention:
retainUntilTime: "{{ retainUntilTime }}"
retentionMode: "{{ retentionMode }}"
contentType: "{{ contentType }}"
contentDisposition: "{{ contentDisposition }}"
contentEncoding: "{{ contentEncoding }}"
contentLanguage: "{{ contentLanguage }}"
customTime: "{{ customTime }}"
customMetadata: "{{ customMetadata }}"
cacheControl: "{{ cacheControl }}"
- name: bucketList
description: |
Specifies a list of buckets and their objects to be transformed.
value:
buckets:
- bucket: "{{ bucket }}"
prefixList:
includedObjectPrefixes:
- "{{ includedObjectPrefixes }}"
manifest:
manifestLocation: "{{ manifestLocation }}"
- name: putObjectHold
description: |
Changes object hold status.
value:
eventBasedHold: "{{ eventBasedHold }}"
temporaryHold: "{{ temporaryHold }}"
- name: projectSource
description: |
Specifies a project source and filters to identify objects to be transformed.
value:
project: "{{ project }}"
bucketFilters:
title: "{{ title }}"
description: "{{ description }}"
expression: "{{ expression }}"
location: "{{ location }}"
dryRunJobId: "{{ dryRunJobId }}"
snapshotTime: "{{ snapshotTime }}"
insightsDatasetConfig: "{{ insightsDatasetConfig }}"
objectFilters:
title: "{{ title }}"
description: "{{ description }}"
expression: "{{ expression }}"
location: "{{ location }}"
targetLocations:
snapshotTime: "{{ snapshotTime }}"
locations:
- "{{ locations }}"
- name: rewriteObject
description: |
Rewrite the object and updates metadata like KMS key.
value:
kmsKey: "{{ kmsKey }}"
storageClass: "{{ storageClass }}"
- name: dryRun
value: {{ dryRun }}
description: |
Optional. If true, the job runs in dry run mode, returning the total object count and, if the object configuration is a prefix list, the bytes found from source. No transformations are performed.
- name: deleteObject
description: |
Delete objects.
value:
permanentObjectDeletionEnabled: {{ permanentObjectDeletionEnabled }}
- name: description
value: "{{ description }}"
description: |
Optional. A user-provided description for the job. Maximum length: 1024 bytes when unicode-encoded.
- name: loggingConfig
description: |
Optional. Logging configuration.
value:
logActions:
- "{{ logActions }}"
logActionStates:
- "{{ logActionStates }}"
- name: jobId
value: "{{ jobId }}"
- name: requestId
value: "{{ requestId }}"
DELETE examples
- delete
Deletes a batch job.
DELETE FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND jobsId = '{{ jobsId }}' --required
AND requestId = '{{ requestId }}'
AND force = '{{ force }}'
;
Lifecycle Methods
- cancel
Cancels a batch job.
EXEC google.storagebatchoperations.jobs.cancel
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@jobsId='{{ jobsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}'
;