processors
Creates, updates, deletes, gets or lists a processors resource.
Overview
| Name | processors |
| Type | Resource |
| Id | google.documentai.processors |
Fields
The following fields are returned by SELECT queries:
- projects_locations_processors_get
- projects_locations_processors_list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Immutable. The resource name of the processor. Format: projects/{project}/locations/{location}/processors/{processor} |
activeSchemaVersion | string | Optional. SchemaVersion used by the Processor. It is the same as Processor's DatasetSchema.schema_version Format is `projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version}. |
createTime | string (google-datetime) | Output only. The time the processor was created. |
defaultProcessorVersion | string | The default processor version. |
displayName | string | The display name of the processor. |
kmsKeyName | string | The KMS key used for encryption and decryption in CMEK scenarios. |
processEndpoint | string | Output only. Immutable. The http endpoint that can be called to invoke processing. |
processorVersionAliases | array | Output only. The processor version aliases. |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
state | string | Output only. The state of the processor. (STATE_UNSPECIFIED, ENABLED, DISABLED, ENABLING, DISABLING, CREATING, FAILED, DELETING) |
type | string | The processor type, such as: OCR_PROCESSOR, INVOICE_PROCESSOR. To get a list of processor types, see FetchProcessorTypes. |
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. Immutable. The resource name of the processor. Format: projects/{project}/locations/{location}/processors/{processor} |
activeSchemaVersion | string | Optional. SchemaVersion used by the Processor. It is the same as Processor's DatasetSchema.schema_version Format is `projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version}. |
createTime | string (google-datetime) | Output only. The time the processor was created. |
defaultProcessorVersion | string | The default processor version. |
displayName | string | The display name of the processor. |
kmsKeyName | string | The KMS key used for encryption and decryption in CMEK scenarios. |
processEndpoint | string | Output only. Immutable. The http endpoint that can be called to invoke processing. |
processorVersionAliases | array | Output only. The processor version aliases. |
satisfiesPzi | boolean | Output only. Reserved for future use. |
satisfiesPzs | boolean | Output only. Reserved for future use. |
state | string | Output only. The state of the processor. (STATE_UNSPECIFIED, ENABLED, DISABLED, ENABLING, DISABLING, CREATING, FAILED, DELETING) |
type | string | The processor type, such as: OCR_PROCESSOR, INVOICE_PROCESSOR. To get a list of processor types, see FetchProcessorTypes. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_processors_get | select | projectsId, locationsId, processorsId | Gets a processor detail. | |
projects_locations_processors_list | select | projectsId, locationsId | pageToken, pageSize | Lists all processors which belong to this project. |
projects_locations_processors_create | insert | projectsId, locationsId | Creates a processor from the ProcessorType provided. The processor will be at ENABLED state by default after its creation. Note that this method requires the documentai.processors.create permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project. | |
projects_locations_processors_delete | delete | projectsId, locationsId, processorsId | Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor. | |
projects_locations_processors_batch_process | exec | projectsId, locationsId, processorsId | LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format. | |
projects_locations_processors_set_default_processor_version | exec | projectsId, locationsId, processorsId | Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments. | |
projects_locations_processors_process | exec | projectsId, locationsId, processorsId | Processes a single document. | |
projects_locations_processors_enable | exec | projectsId, locationsId, processorsId | Enables a processor | |
projects_locations_processors_disable | exec | projectsId, locationsId, processorsId | Disables a processor |
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 |
|---|---|---|
locationsId | string | |
processorsId | string | |
projectsId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT examples
- projects_locations_processors_get
- projects_locations_processors_list
Gets a processor detail.
SELECT
name,
activeSchemaVersion,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND processorsId = '{{ processorsId }}' -- required
;
Lists all processors which belong to this project.
SELECT
name,
activeSchemaVersion,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- projects_locations_processors_create
- Manifest
Creates a processor from the ProcessorType provided. The processor will be at ENABLED state by default after its creation. Note that this method requires the documentai.processors.create permission on the project, which is highly privileged. A user or service account with this permission can create new processors that can interact with any gcs bucket in your project.
INSERT INTO google.documentai.processors (
data__defaultProcessorVersion,
data__displayName,
data__kmsKeyName,
data__activeSchemaVersion,
data__type,
projectsId,
locationsId
)
SELECT
'{{ defaultProcessorVersion }}',
'{{ displayName }}',
'{{ kmsKeyName }}',
'{{ activeSchemaVersion }}',
'{{ type }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
activeSchemaVersion,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
;
# Description fields are for documentation purposes
- name: processors
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the processors resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the processors resource.
- name: defaultProcessorVersion
value: "{{ defaultProcessorVersion }}"
description: |
The default processor version.
- name: displayName
value: "{{ displayName }}"
description: |
The display name of the processor.
- name: kmsKeyName
value: "{{ kmsKeyName }}"
description: |
The [KMS key](https://cloud.google.com/security-key-management) used for encryption and decryption in CMEK scenarios.
- name: activeSchemaVersion
value: "{{ activeSchemaVersion }}"
description: |
Optional. SchemaVersion used by the Processor. It is the same as Processor's DatasetSchema.schema_version Format is `projects/{project}/locations/{location}/schemas/{schema}/schemaVersions/{schema_version}.
- name: type
value: "{{ type }}"
description: |
The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. To get a list of processor types, see FetchProcessorTypes.
DELETE examples
- projects_locations_processors_delete
Deletes the processor, unloads all deployed model artifacts if it was enabled and then deletes all artifacts associated with this processor.
DELETE FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND processorsId = '{{ processorsId }}' --required
;
Lifecycle Methods
- projects_locations_processors_batch_process
- projects_locations_processors_set_default_processor_version
- projects_locations_processors_process
- projects_locations_processors_enable
- projects_locations_processors_disable
LRO endpoint to batch process many documents. The output is written to Cloud Storage as JSON in the [Document] format.
EXEC google.documentai.processors.projects_locations_processors_batch_process
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
@@json=
'{
"inputDocuments": "{{ inputDocuments }}",
"skipHumanReview": {{ skipHumanReview }},
"processOptions": "{{ processOptions }}",
"labels": "{{ labels }}",
"documentOutputConfig": "{{ documentOutputConfig }}"
}'
;
Set the default (active) version of a Processor that will be used in ProcessDocument and BatchProcessDocuments.
EXEC google.documentai.processors.projects_locations_processors_set_default_processor_version
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
@@json=
'{
"defaultProcessorVersion": "{{ defaultProcessorVersion }}"
}'
;
Processes a single document.
EXEC google.documentai.processors.projects_locations_processors_process
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
@@json=
'{
"inlineDocument": "{{ inlineDocument }}",
"labels": "{{ labels }}",
"fieldMask": "{{ fieldMask }}",
"skipHumanReview": {{ skipHumanReview }},
"processOptions": "{{ processOptions }}",
"imagelessMode": {{ imagelessMode }},
"rawDocument": "{{ rawDocument }}",
"gcsDocument": "{{ gcsDocument }}"
}'
;
Enables a processor
EXEC google.documentai.processors.projects_locations_processors_enable
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
;
Disables a processor
EXEC google.documentai.processors.projects_locations_processors_disable
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
;