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
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Immutable. The resource name of the processor. Format: projects/{project}/locations/{location}/processors/{processor} |
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. |
type | string | The processor type, such as: OCR_PROCESSOR , INVOICE_PROCESSOR . To get a list of processor types, see FetchProcessorTypes. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Output only. Immutable. The resource name of the processor. Format: projects/{project}/locations/{location}/processors/{processor} |
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. |
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 | pageSize , pageToken | 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_process | exec | projectsId , locationsId , processorsId | Processes a single document. | |
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_enable | exec | projectsId , locationsId , processorsId | Enables a processor | |
projects_locations_processors_disable | exec | projectsId , locationsId , processorsId | Disables a processor | |
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. |
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,
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,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
FROM google.documentai.processors
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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__type,
data__displayName,
data__defaultProcessorVersion,
data__kmsKeyName,
projectsId,
locationsId
)
SELECT
'{{ type }}',
'{{ displayName }}',
'{{ defaultProcessorVersion }}',
'{{ kmsKeyName }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
defaultProcessorVersion,
displayName,
kmsKeyName,
processEndpoint,
processorVersionAliases,
satisfiesPzi,
satisfiesPzs,
state,
type
;
# Description fields are for documentation purposes
- name: processors
props:
- name: projectsId
value: string
description: Required parameter for the processors resource.
- name: locationsId
value: string
description: Required parameter for the processors resource.
- name: type
value: string
description: >
The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`. To get a list of processor types, see FetchProcessorTypes.
- name: displayName
value: string
description: >
The display name of the processor.
- name: defaultProcessorVersion
value: string
description: >
The default processor version.
- name: kmsKeyName
value: string
description: >
The [KMS key](https://cloud.google.com/security-key-management) used for encryption and decryption in CMEK scenarios.
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_process
- projects_locations_processors_batch_process
- projects_locations_processors_enable
- projects_locations_processors_disable
- projects_locations_processors_set_default_processor_version
Processes a single document.
EXEC google.documentai.processors.projects_locations_processors_process
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@processorsId='{{ processorsId }}' --required
@@json=
'{
"inlineDocument": "{{ inlineDocument }}",
"rawDocument": "{{ rawDocument }}",
"gcsDocument": "{{ gcsDocument }}",
"skipHumanReview": {{ skipHumanReview }},
"fieldMask": "{{ fieldMask }}",
"processOptions": "{{ processOptions }}",
"labels": "{{ labels }}",
"imagelessMode": {{ imagelessMode }}
}';
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 }}",
"documentOutputConfig": "{{ documentOutputConfig }}",
"skipHumanReview": {{ skipHumanReview }},
"processOptions": "{{ processOptions }}",
"labels": "{{ labels }}"
}';
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;
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 }}"
}';