- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateEndpointCommand
Creates a model-specific endpoint for synchronous inference for a previously trained custom model For information about endpoints, see Managing endpoints .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ComprehendClient, CreateEndpointCommand } from "@aws-sdk/client-comprehend"; // ES Modules import
// const { ComprehendClient, CreateEndpointCommand } = require("@aws-sdk/client-comprehend"); // CommonJS import
const client = new ComprehendClient(config);
const input = { // CreateEndpointRequest
EndpointName: "STRING_VALUE", // required
ModelArn: "STRING_VALUE",
DesiredInferenceUnits: Number("int"), // required
ClientRequestToken: "STRING_VALUE",
Tags: [ // TagList
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE",
},
],
DataAccessRoleArn: "STRING_VALUE",
FlywheelArn: "STRING_VALUE",
};
const command = new CreateEndpointCommand(input);
const response = await client.send(command);
// { // CreateEndpointResponse
// EndpointArn: "STRING_VALUE",
// ModelArn: "STRING_VALUE",
// };
CreateEndpointCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DesiredInferenceUnits Required | number | undefined | The 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. |
EndpointName Required | string | undefined | This is the descriptive suffix that becomes part of the |
ClientRequestToken | string | undefined | An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a |
DataAccessRoleArn | string | undefined | The 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). |
FlywheelArn | string | undefined | The Amazon Resource Number (ARN) of the flywheel to which the endpoint will be attached. |
ModelArn | string | undefined | The Amazon Resource Number (ARN) of the model to which the endpoint will be attached. |
Tags | Tag[] | undefined | Tags to associate with the endpoint. A tag is a key-value pair that adds metadata to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint to indicate its use by the sales department. |
CreateEndpointCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
EndpointArn | string | undefined | The Amazon Resource Number (ARN) of the endpoint being created. |
ModelArn | string | undefined | The Amazon Resource Number (ARN) of the model to which the endpoint is attached. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServerException | server | An internal server error occurred. Retry your request. |
InvalidRequestException | client | The request is invalid. |
ResourceInUseException | client | The specified resource name is already in use. Use a different name and try your request again. |
ResourceLimitExceededException | client | The maximum number of resources per account has been exceeded. Review the resources, and then try your request again. |
ResourceNotFoundException | client | The specified resource ARN was not found. Check the ARN and try your request again. |
ResourceUnavailableException | client | The specified resource is not available. Check the resource and try your request again. |
TooManyRequestsException | client | The number of requests exceeds the limit. Resubmit your request later. |
TooManyTagsException | client | The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request. |
ComprehendServiceException | Base exception class for all service exceptions from Comprehend service. |