Queries the status of the shipping tasks in a Logstore within a specified time range.
Request syntax
aliyunlog log get_shipper_tasks --project_name=<value> --logstore_name=<value> --shipper_name=<value> --start_time=<value> --end_time=<value> [--status_type=<value>] [--offset=<value>] [--size=<value>] [--access-id=<value>] [--access-key=<value>] [--sts-token=<value>] [--region-endpoint=<value>] [--client-name=<value>] [--jmes-filter=<value>] [--format-output=<value>] [--decode-output=<value>]
Request parameters
The following table describes the required and specific parameters of the get_shipper_tasks
command.
For information about the global parameters of the Log Service command-line interface
(CLI), see Global variables.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
--project_name | String | Yes | aliyun-test-project | The name of the project. |
--logstore_name | String | Yes | logstore-a | The name of the Logstore. |
--shipper_name | String | Yes | sls-doc-testshippername | The name of the shipping task. |
--start_time | Integer | Yes | 1622607139 | The start time of the time range to query. The time follows the UNIX time format. |
--end_time | Integer | Yes | 1622625139 | The end time of the time range to query. The time follows the UNIX time format. |
--status_type | String | No | success | The status of the shipping task. Valid values:
|
--offset | Integer | No | 0 | The start position of entries to return. Default value: 0. |
--size | Integer | No | 3 | The maximum number of entries to return on each page. Maximum value: 500. |
Examples
- Sample requests
Query the status of the shipping tasks in a Logstore within a specified time range. Run the following command:
aliyunlog log get_shipper_tasks --project_name="aliyun-test-project" --logstore_name="logstore-a" --shipper_name="sls-doc-testshippername" --start_time="1622607139" --end_time=1622625139 --status_type=true --offset=0 --size=3
- Sample responses
{ "count": 3, "statistics": { "fail": 8, "running": 0, "success": 31 }, "tasks": [ { "id": "d3342056eee7d7aaf4d1b451efca425f", "taskCode": "", "taskCreateTime": 1622618077, "taskDataLines": 2220, "taskFinishTime": 1622624458, "taskLastDataReceiveTime": 1622618077, "taskMessage": "", "taskStatus": "success" }, { "id": "489c80695e119ef04e7db014492d3b17", "taskCode": "", "taskCreateTime": 1622618485, "taskDataLines": 1846, "taskFinishTime": 1622624893, "taskLastDataReceiveTime": 1622618485, "taskMessage": "", "taskStatus": "success" }, { "id": "d15fe8224b5c97a8c6279e0bc90fefcb", "taskCode": "", "taskCreateTime": 1622618853, "taskDataLines": 2991, "taskFinishTime": 1622625254, "taskLastDataReceiveTime": 1622618853, "taskMessage": "", "taskStatus": "success" } ], "total": 39 }
Error codes
If an error message is returned, fix the error based on the error codes of the related API operation. For more information, see Error codes of GetShipperStatus.