Queries the status of LogShipper tasks.

Description

You can only query the status of LogShipper tasks that were performed within the last 48 hours.

Request syntax

GET /logstores/{logstoreName}/shipper/{shipperName}/tasks? from=1448748198&to=1448948198&status=success&offset=0&size=100 HTTP/1.1
Authorization: <AuthorizationString> 
Date: <GMT Date>
Host: <Project Endpoint>
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

Request parameters

  • Request headers

    The GetShipperStatus does not have operation-specific request headers. For information about the common request headers of Log Service API operations, see Common request headers.

  • Parameters
    Parameter Type Required Example Description
    logstoreName string Yes test-logstore The name of the Logstore. The name must be unique in a project.
    shipperName string Yes test-shipper The name of the LogShipper rule. The name must be unique in a Logstore.
    from int Yes 1448748198 The time when the LogShipper task begins.
    to int Yes 1448948198 The time when the LogShipper task ends.
    status string No success The default value is empty, indicating that all LogShipper tasks are returned. These tasks can be in the success, fail, or running state.
    offset int No 0 The start position of LogShipper tasks to return within a specified time range. Default value: 0.
    size int No 100 The number of LogShipper tasks to return within a specified time range. Default value: 100. Maximum value: 500.

Response parameters

  • Response headers

    The GetShipperStatus does not have operation-specific response headers. For information about the common response headers of Log Service API operations, see Common response headers.

  • Response elements
    If the request succeeds, the HTTP status code 200 is returned. The response body contains a list of specified LogShipper tasks. The following table describes the parameters of the response body.
    Parameter Type Example Description
    count int 10 The number of returned tasks.
    total int 20 The total number of tasks within a specified time range.
    statistics json None. The statistics of task status within a specified time range. For more information, see the "statistics" table.
    tasks array None. The details of LogShipper tasks within a specified time range. For more information, see the "tasks" table.
    Statistics
    Parameter Type Example Description
    running int 0 The number of tasks in the Running state.
    success int 20 The number of tasks in the Success state.
    fail int 0 The number of tasks in the Fail state.
    Tasks
    Parameter Type Example Description
    id string abcdefghijk The unique ID of the LogShipper task.
    taskStatus string success The status of the LogShipper task. The task can be in the running, success, or fail state.
    taskMessage string None. The error message that is returned if a LogShipper task fails.
    taskCreateTime int 1448925013 The time when the LogShipper task begins.
    taskLastDataReceiveTime int 1448915013 The time when the server receives the last log of a LogShipper task.
    taskFinishTime int 1448926013 The time when the LogShipper task ends.

Examples

  • Sample requests
    GET /logstores/test-logstore/shipper/test-shipper/tasks? from=1448748198&to=1448948198&status=success&offset=0&size=100 HTTP/1.1
    Header:
    {
    x-log-apiversion=0.6.0, 
    Authorization=LOG <yourAccessKeyId>:<yourSignature>, 
    Host=ali-test-project.cn-hangzhou-devcommon-intranet.sls.aliyuncs.com, 
    Date=Wed, 11 Nov 2015 08:28:19 GMT, 
    Content-Length=55, 
    x-log-signaturemethod=hmac-sha1, 
    Content-MD5=757C60FC41CC7D3F60B88E0D916D051E, 
    User-Agent=sls-java-sdk-v-0.6.0, 
    Content-Type=application/json
    }
  • Sample success responses
    HTTP/1.1 200 OK
    Header:
    {
    Date=Wed, 11 Nov 2015 08:28:20 GMT, 
    Content-Length=0, 
    x-log-requestid=5642FC2399248C8F7B0145FD, 
    Connection=close, 
    Server=nginx/1.6.1
    }
    Body:
    {
        "count" : 10,
        "total" : 20,
        "statistics" : {
            "running" : 0,
            "success" : 20,
            "fail" : 0 
        }
        "tasks" : [
            {
                "id" : "abcdefghijk",
                "taskStatus" : "success",
                "taskMessage" : "",
                "taskCreateTime" : 1448925013,
                "taskLastDataReceiveTime" : 1448915013,
                "taskFinishTime" : 1448926013
            }
        ]
    }

Error codes

HTTP status code Error code Error message Description
404 ProjectNotExist Project {ProjectName} does not exist. The error message returned because the specified project does not exist.
404 LogStoreNotExist logstore {logstoreName} does not exist. The error message returned because the specified Logstore does not exist.
400 ShipperNotExist shipper {logstoreName} does not exist. The error message returned because the specified LogShipper task does not exist.
500 InternalServerError internal server error. The error message returned because an internal server error has occurred.
400 ParameterInvalid start time must be earlier than end time. The error message returned because the start time is later than or equal to the end time.
400 ParameterInvalid only support query last 48 hours task status. The error message returned because the specified time range is invalid. You can query the status of the tasks that were performed within only the last 48 hours.
400 ParameterInvalid status only contains success/running/fail. The error message returned because the specified status is invalid. The task can be in the success, running, or fail state.

For more information about the error codes, see Common error codes.