StartEventsDetectionJobCommand

Starts an asynchronous event detection job for a collection of documents.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ComprehendClient, StartEventsDetectionJobCommand } from "@aws-sdk/client-comprehend"; // ES Modules import
// const { ComprehendClient, StartEventsDetectionJobCommand } = require("@aws-sdk/client-comprehend"); // CommonJS import
const client = new ComprehendClient(config);
const input = { // StartEventsDetectionJobRequest
  InputDataConfig: { // InputDataConfig
    S3Uri: "STRING_VALUE", // required
    InputFormat: "ONE_DOC_PER_FILE" || "ONE_DOC_PER_LINE",
    DocumentReaderConfig: { // DocumentReaderConfig
      DocumentReadAction: "TEXTRACT_DETECT_DOCUMENT_TEXT" || "TEXTRACT_ANALYZE_DOCUMENT", // required
      DocumentReadMode: "SERVICE_DEFAULT" || "FORCE_DOCUMENT_READ_ACTION",
      FeatureTypes: [ // ListOfDocumentReadFeatureTypes
        "TABLES" || "FORMS",
      ],
    },
  },
  OutputDataConfig: { // OutputDataConfig
    S3Uri: "STRING_VALUE", // required
    KmsKeyId: "STRING_VALUE",
  },
  DataAccessRoleArn: "STRING_VALUE", // required
  JobName: "STRING_VALUE",
  LanguageCode: "en" || "es" || "fr" || "de" || "it" || "pt" || "ar" || "hi" || "ja" || "ko" || "zh" || "zh-TW", // required
  ClientRequestToken: "STRING_VALUE",
  TargetEventTypes: [ // TargetEventTypes // required
    "STRING_VALUE",
  ],
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE",
    },
  ],
};
const command = new StartEventsDetectionJobCommand(input);
const response = await client.send(command);
// { // StartEventsDetectionJobResponse
//   JobId: "STRING_VALUE",
//   JobArn: "STRING_VALUE",
//   JobStatus: "SUBMITTED" || "IN_PROGRESS" || "COMPLETED" || "FAILED" || "STOP_REQUESTED" || "STOPPED",
// };

StartEventsDetectionJobCommand Input

Parameter
Type
Description
DataAccessRoleArn
Required
string | undefined

The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.

InputDataConfig
Required
InputDataConfig | undefined

Specifies the format and location of the input data for the job.

LanguageCode
Required
LanguageCode | undefined

The language code of the input documents.

OutputDataConfig
Required
OutputDataConfig | undefined

Specifies where to send the output files.

TargetEventTypes
Required
string[] | undefined

The types of events to detect in the input documents.

ClientRequestToken
string | undefined

An unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.

JobName
string | undefined

The identifier of the events detection job.

Tags
Tag[] | undefined

Tags to associate with the events detection job. A tag is a key-value pair that adds metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

StartEventsDetectionJobCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
JobArn
string | undefined

The Amazon Resource Name (ARN) of the events detection job. It is a unique, fully qualified identifier for the job. It includes the Amazon Web Services account, Amazon Web Services Region, and the job ID. The format of the ARN is as follows:

arn::comprehend:::events-detection-job/

The following is an example job ARN:

arn:aws:comprehend:us-west-2:111122223333:events-detection-job/1234abcd12ab34cd56ef1234567890ab

JobId
string | undefined

An unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.

JobStatus
JobStatus | undefined

The status of the events detection job.

Throws

Name
Fault
Details
InternalServerException
server

An internal server error occurred. Retry your request.

InvalidRequestException
client

The request is invalid.

KmsKeyValidationException
client

The KMS customer managed key (CMK) entered cannot be validated. Verify the key and re-enter it.

ResourceInUseException
client

The specified resource name is already in use. Use a different name 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.