Context / Paginator / ListTasks
ListTasks¶
- class Context.Paginator.ListTasks¶
paginator = client.get_paginator('list_tasks')
- paginate(**kwargs)¶
Creates an iterator that will paginate through responses from
Context.Client.list_tasks().See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate( agentContextId='string', status='PENDING'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'CANCELLING'|'CANCELLED', type='IMPORT_DATA_DICTIONARY'|'IMPORT_VERIFIED_QUERIES'|'IMPORT_ONTOLOGY', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } )
- Parameters:
agentContextId (string) –
[REQUIRED]
The agent context, as an ID or ARN.
status (string) – Specify a status to list only the tasks with that status.
type (string) – Specify a type to list only the tasks of that type.
PaginationConfig (dict) –
A dictionary that provides parameters to control pagination.
MaxItems (integer) –
The total number of items to return. If the total number of items available is more than the value specified in max-items then a
NextTokenwill be provided in the output that you can use to resume pagination.PageSize (integer) –
The size of each page.
StartingToken (string) –
A token to specify where to start paginating. This is the
NextTokenfrom a previous response.
- Return type:
dict
- Returns:
Response Syntax
{ 'items': [ { 'id': 'string', 'arn': 'string', 'agentContextId': 'string', 'type': 'IMPORT_DATA_DICTIONARY'|'IMPORT_VERIFIED_QUERIES'|'IMPORT_ONTOLOGY', 'status': 'PENDING'|'IN_PROGRESS'|'COMPLETED'|'FAILED'|'CANCELLING'|'CANCELLED', 'description': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1), 'statusReasonCode': 'GRAPH_NOT_ACTIVE'|'ONTOLOGY_INVALID'|'ONTOLOGY_IMPORT_UNAVAILABLE'|'ONTOLOGY_ALREADY_IMPORTED', 'statusMessage': 'string', 'statistics': { 'numberOfDocumentsAnalyzed': 123, 'numberOfChangeSetsCreated': 123, 'numberOfChangeSetsAutoApproved': 123 } }, ], 'NextToken': 'string' }
Response Structure
(dict) –
items (list) –
The tasks. Always present, and empty when there are none.
(dict) –
Summary information about a task, as returned by ListTasks: its ID, ARN, agent context, type, status, description, timestamps, status reason code and message, and statistics. It omits the task’s input configuration and outputs, which GetTask returns.
id (string) –
The ID of the task. Pass it as
taskIdto GetTask or CancelTask.arn (string) –
The Amazon Resource Name (ARN) of the task.
agentContextId (string) –
The agent context’s ID.
type (string) –
The type of the task. It is set by the
inputConfigurationmember that the task was started with:IMPORT_DATA_DICTIONARY,IMPORT_VERIFIED_QUERIES, orIMPORT_ONTOLOGY.status (string) –
The status of the task. A task moves from
PENDINGtoIN_PROGRESSand endsCOMPLETED,FAILED, orCANCELLED. After CancelTask, it isCANCELLINGuntil it stops.description (string) –
The description of the task, as given to StartTask.
createdAt (datetime) –
The date and time when the task was created.
updatedAt (datetime) –
The date and time when the task was last updated, such as when its status changed. Equal to
createdAtuntil the task first changes.statusReasonCode (string) –
The code for why the task failed. Present only when
statusisFAILED.Valid values:
GRAPH_NOT_ACTIVE- The agent context was deleted, or was not yet available, while the task ran.ONTOLOGY_INVALID- An ontology is missing, has no loadable source, or its source is unsafe or too large.ONTOLOGY_IMPORT_UNAVAILABLE- An ontology couldn’t be imported because of a temporary problem. Start a new task.ONTOLOGY_ALREADY_IMPORTED- This ontology version is already imported into the agent context.
statusMessage (string) –
The reason the task failed. Present only when status is FAILED.
statistics (dict) –
Counts of the documents that the task analyzed and the change sets that it created. The counts are final once the task is
COMPLETED,FAILED, orCANCELLED.numberOfDocumentsAnalyzed (integer) –
The number of input documents that the task has analyzed.
numberOfChangeSetsCreated (integer) –
The number of change sets that the task has created.
numberOfChangeSetsAutoApproved (integer) –
The number of change sets that the agent context’s curation policies published without review.
NextToken (string) –
A token to resume pagination.