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
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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". |
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 description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded. |
errorSummaries | array | Output only. Summarizes errors encountered with sample error log entries. |
loggingConfig | object | Optional. Logging configuration. (id: LoggingConfig) |
putMetadata | object | Updates 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) |
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. |
state | string | Output only. State of the job. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. 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". |
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 description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded. |
errorSummaries | array | Output only. Summarizes errors encountered with sample error log entries. |
loggingConfig | object | Optional. Logging configuration. (id: LoggingConfig) |
putMetadata | object | Updates 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) |
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. |
state | string | Output only. State of the job. |
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 , pageToken , orderBy | Lists Jobs in a given project. |
create | insert | projectsId , locationsId | jobId , requestId | Creates a batch job. |
delete | delete | projectsId , locationsId , jobsId | requestId | 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 | |
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,
errorSummaries,
loggingConfig,
putMetadata,
putObjectHold,
rewriteObject,
scheduleTime,
state
FROM google.storagebatchoperations.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND jobsId = '{{ jobsId }}' -- required;
Lists Jobs in a given project.
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 filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}';
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: projectsId
value: string
description: Required parameter for the jobs resource.
- name: locationsId
value: string
description: Required parameter for the jobs resource.
- name: name
value: string
description: >
Identifier. 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".
- name: description
value: string
description: >
Optional. A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded.
- name: bucketList
value: object
description: >
Specifies a list of buckets and their objects to be transformed.
- name: putObjectHold
value: object
description: >
Changes object hold status.
- name: deleteObject
value: object
description: >
Delete objects.
- name: putMetadata
value: object
description: >
Updates 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.
- name: rewriteObject
value: object
description: >
Rewrite the object and updates metadata like KMS key.
- name: loggingConfig
value: object
description: >
Optional. Logging configuration.
- name: jobId
value: string
- name: requestId
value: string
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 }}';
Lifecycle Methods
- cancel
Cancels a batch job.
EXEC google.storagebatchoperations.jobs.cancel
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@jobsId='{{ jobsId }}' --required
@@json=
'{
"requestId": "{{ requestId }}"
}';