All Products
Search
Document Center

:GetShipperStatus

更新時間:Oct 26, 2023

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 HTTP/1.1
Authorization: LOG yourAccessKeyId:yourSignature 
Date: GMT Date
Host: ProjectName.Endpoint
x-log-apiversion: 0.6.0
x-log-signaturemethod: hmac-sha1

The value of the Host parameter consists of a project name and an endpoint. You must specify a project name for the Host parameter.

Request parameters

  • Request headers

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

  • Parameters
    ParameterTypeRequiredExampleDescription
    projectNameStringYesali-test-projectThe name of the project.
    logstoreNameStringYestest-logstoreThe name of the Logstore.
    shipperNameStringYestest-shipperThe name of the LogShipper task.
    startTimeIntegerYes1448748198The timestamp when the LogShipper task begins. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
    endTimeIntegerYes1448948198The timestamp when the LogShipper task ends. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
    statusTypeStringNosuccessThe default value is empty. It indicates that all LogShipper tasks are returned. These tasks can be in the success, fail, or running state.
    offsetIntegerNo0The line from which the query starts. Default value: 0.
    sizeIntegerNo100The number of lines to return on each page in a paged query. Default value: 100. Maximum value: 500.

Response parameters

  • Response headers

    The GetShipperStatus operation 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 HTTP status code 200 is returned, the request is successful. The response body contains a list of specified LogShipper tasks. The following table describes the parameters of the response body.
    ParameterTypeExampleDescription
    countInteger10The number of returned tasks on the current page.
    totalInteger20The total number of tasks.
    statisticsJsonNoneThe statistics of task status within a specified time range. For more information, see the table that describes the elements of the statistics parameter.
    tasksArrayNoneThe details of LogShipper tasks. For more information, see the table that describes the elements of the tasks parameter
    The following table describes the elements of the statistics parameter.
    ParameterTypeExampleDescription
    runningInteger0The number of tasks that are in the running state.
    successInteger20The number of tasks that are in the success state.
    failInteger0The number of tasks that are in the fail state.
    The following table describes the elements of the tasks parameter.
    ParameterTypeExampleDescription
    idStringabcdefghijkThe unique ID of the LogShipper task.
    taskStatusStringsuccessThe status of the LogShipper task. The task can be in the running, success, or fail state.
    taskMessageStringNoneThe error message that is returned if a LogShipper task fails.
    taskCreateTimeInteger1448925013The timestamp when the LogShipper task was created. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
    taskLastDataReceiveTimeInteger1448915013The timestamp when the server receives the last log of a LogShipper task. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
    taskFinishTimeInteger1448926013The timestamp when the LogShipper task ends. The timestamp follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.

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 codeError codeError messageDescription
404ProjectNotExistProject ProjectName does not exist.The error message returned because the specified project does not exist.
404LogStoreNotExistLogstore logstoreName does not exist.The error message returned because the specified Logstore does not exist.
400ShipperNotExistShipper shipperName does not exist.The error message returned because the specified LogShipper task does not exist.
500InternalServerErrorInternal server error.The error message returned because an internal server error has occurred.
400ParameterInvalidStart time must be earlier than end time.The error message returned because the start time is later than or equal to the end time.
400ParameterInvalidOnly 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.
400ParameterInvalidStatus 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 a list of error codes, see Common error codes.