Skip to main content

endpoints

Creates, updates, deletes, gets or lists an endpoints resource.

Overview

Nameendpoints
TypeResource
Idaws.comprehend.endpoints

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestring (date-time)The creation date and time of the endpoint.
current_inference_unitsintegerThe number of inference units currently used by the model using this endpoint.
data_access_role_arnstringThe Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to trained custom models encrypted with a customer managed key (ModelKmsKeyId). (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>)
desired_data_access_role_arnstringData access role ARN to use in case the new model is encrypted with a customer KMS key. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>)
desired_inference_unitsintegerThe desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.
desired_model_arnstringARN of the new model to use for updating an existing endpoint. This ARN is going to be different from the model ARN when the update is in progress (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>)
endpoint_arnstringThe Amazon Resource Number (ARN) of the endpoint. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier-endpoint|entity-recognizer-endpoint)/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>)
flywheel_arnstringThe Amazon Resource Number (ARN) of the flywheel (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:flywheel/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>)
last_modified_timestring (date-time)The date and time that the endpoint was last modified.
messagestringSpecifies a reason for failure in cases of Failed status.
model_arnstringThe Amazon Resource Number (ARN) of the model to which the endpoint is attached. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>)
statusstringSpecifies the status of the endpoint. Because the endpoint updates and creation are asynchronous, so customers will need to wait for the endpoint to be Ready status before making inference requests. (CREATING, DELETING, FAILED, IN_SERVICE, UPDATING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_endpointselectregionGets the properties associated with a specific endpoint. Use this operation to get the status of an endpoint. For information about endpoints, see Managing endpoints.
list_endpointsselectregionGets a list of all existing endpoints that you've created. For information about endpoints, see Managing endpoints.
create_endpointinsertregion, EndpointName, DesiredInferenceUnitsCreates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints.
update_endpointupdateregion, EndpointArnUpdates information about the specified endpoint. For information about endpoints, see Managing endpoints.
delete_endpointdeleteregionDeletes a model-specific endpoint for a previously-trained custom model. All endpoints must be deleted in order for the model to be deleted. For information about endpoints, see Managing endpoints.
classify_documentexecregion, EndpointArnCreates a classification request to analyze a single document in real-time. ClassifyDocument supports the following model types: Custom classifier - a custom model that you have created and trained. For input, you can provide plain text, a single-page document (PDF, Word, or image), or Amazon Textract API output. For more information, see Custom classification in the Amazon Comprehend Developer Guide. Prompt safety classifier - Amazon Comprehend provides a pre-trained model for classifying input prompts for generative AI applications. For input, you provide English plain text input. For prompt safety classification, the response includes only the Classes field. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide. If the system detects errors while processing a page in the input document, the API response includes an Errors field that describes the errors. If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Gets the properties associated with a specific endpoint. Use this operation to get the status of an endpoint. For information about endpoints, see Managing endpoints.

SELECT
creation_time,
current_inference_units,
data_access_role_arn,
desired_data_access_role_arn,
desired_inference_units,
desired_model_arn,
endpoint_arn,
flywheel_arn,
last_modified_time,
message,
model_arn,
status
FROM aws.comprehend.endpoints
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints.

INSERT INTO aws.comprehend.endpoints (
EndpointName,
ModelArn,
DesiredInferenceUnits,
ClientRequestToken,
Tags,
DataAccessRoleArn,
FlywheelArn,
region
)
SELECT
'{{ EndpointName }}' /* required */,
'{{ ModelArn }}',
{{ DesiredInferenceUnits }} /* required */,
'{{ ClientRequestToken }}',
'{{ Tags }}',
'{{ DataAccessRoleArn }}',
'{{ FlywheelArn }}',
'{{ region }}'
RETURNING
endpoint_arn,
model_arn
;

UPDATE examples

Updates information about the specified endpoint. For information about endpoints, see Managing endpoints.

UPDATE aws.comprehend.endpoints
SET
EndpointArn = '{{ EndpointArn }}',
DesiredModelArn = '{{ DesiredModelArn }}',
DesiredInferenceUnits = {{ DesiredInferenceUnits }},
DesiredDataAccessRoleArn = '{{ DesiredDataAccessRoleArn }}',
FlywheelArn = '{{ FlywheelArn }}'
WHERE
region = '{{ region }}' --required
AND EndpointArn = '{{ EndpointArn }}' --required
RETURNING
desired_model_arn;

DELETE examples

Deletes a model-specific endpoint for a previously-trained custom model. All endpoints must be deleted in order for the model to be deleted. For information about endpoints, see Managing endpoints.

DELETE FROM aws.comprehend.endpoints
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Creates a classification request to analyze a single document in real-time. ClassifyDocument supports the following model types: Custom classifier - a custom model that you have created and trained. For input, you can provide plain text, a single-page document (PDF, Word, or image), or Amazon Textract API output. For more information, see Custom classification in the Amazon Comprehend Developer Guide. Prompt safety classifier - Amazon Comprehend provides a pre-trained model for classifying input prompts for generative AI applications. For input, you provide English plain text input. For prompt safety classification, the response includes only the Classes field. For more information about prompt safety classifiers, see Prompt safety classification in the Amazon Comprehend Developer Guide. If the system detects errors while processing a page in the input document, the API response includes an Errors field that describes the errors. If the system detects a document-level error in your input document, the API returns an InvalidRequestException error response. For details about this exception, see Errors in semi-structured documents in the Comprehend Developer Guide.

EXEC aws.comprehend.endpoints.classify_document
@region='{{ region }}' --required
@@json=
'{
"Text": "{{ Text }}",
"EndpointArn": "{{ EndpointArn }}",
"Bytes": "{{ Bytes }}",
"DocumentReaderConfig": "{{ DocumentReaderConfig }}"
}'
;