DescribeImportTaskBatches - Amazon CloudWatch Logs

DescribeImportTaskBatches

Gets detailed information about the individual batches within an import task, including their status and any error messages. For CloudTrail Event Data Store sources, a batch refers to a subset of stored events grouped by their eventTime.

Request Syntax

{ "batchImportStatus": [ "string" ], "importId": "string", "limit": number, "nextToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

batchImportStatus

Optional filter to list import batches by their status. Accepts multiple status values: IN_PROGRESS, CANCELLED, COMPLETED and FAILED.

Type: Array of strings

Valid Values: IN_PROGRESS | CANCELLED | COMPLETED | FAILED

Required: No

importId

The ID of the import task to get batch information for.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [\-a-zA-Z0-9]+

Required: Yes

limit

The maximum number of import batches to return in the response. Default: 10

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 50.

Required: No

nextToken

The pagination token for the next set of results.

Type: String

Length Constraints: Minimum length of 1.

Required: No

Response Syntax

{ "importBatches": [ { "batchId": "string", "errorMessage": "string", "status": "string" } ], "importId": "string", "importSourceArn": "string", "nextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

importBatches

The list of import batches that match the request filters.

Type: Array of ImportBatch objects

importId

The ID of the import task.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [\-a-zA-Z0-9]+

importSourceArn

The ARN of the source being imported from.

Type: String

nextToken

The token to use when requesting the next set of results. Not present if there are no additional results to retrieve.

Type: String

Length Constraints: Minimum length of 1.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You don't have sufficient permissions to perform this action.

HTTP Status Code: 400

InvalidOperationException

The operation is not valid on the specified resource.

HTTP Status Code: 400

InvalidParameterException

A parameter is specified incorrectly.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 400

ThrottlingException

The request was throttled because of quota limits.

HTTP Status Code: 400

Examples

To describe import task batches

The following example retrieves batch-level details for an import task with status filtering.

Sample Request

POST / HTTP/1.1 Host: logs.<region>.<domain> X-Amz-Target: Logs_20140328.DescribeImportTaskBatches { "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "batchImportStatus": ["IN_PROGRESS", "COMPLETED"], "limit": 25, "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjF9" }

Sample Response

HTTP/1.1 200 OK { "importSourceArn": "arn:aws:cloudtrail:us-west-2:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb", "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "importBatches": [ { "batchId": "b1c2d3e4-f5g6-7890-hijk-lm1234567890", "status": "COMPLETED" }, { "batchId": "c2d3e4f5-g6h7-8901-ijkl-mn2345678901", "status": "IN_PROGRESS" }, { "batchId": "d3e4f5g6-h7i8-9012-jklm-no3456789012", "status": "FAILED", "errorMessage": "Access denied to CloudTrail event data store" } ], "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjJ9" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: