Queries the server time based on the cursor.

Request syntax

GET /logstores/{logstoreName}/shards/{shard}? cursor={cursor}&type=cursor_time 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 GetCursorTime 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
    Parameter Type Required Example Description
    logstoreName string Yes internal-operation_log The name of the Logstore.
    shard int Yes 0 The ID of the shard.
    cursor string Yes MTU0NzQ3MDY4MjM3NjUxMzQ0Ng%3D%3D The cursor that is used to query a timestamp.
    type string Yes cursor_time The type of data to be queried. Default value: cursor_time.

Response parameters

  • Response headers

    The GetCursorTime 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 GetCursorTime request succeeds, the response body obtains the server time. The following example show a cursor time:
    { 
       "cursor_time": 1554260243 
    }

Examples

  • Sample requests
    GET /logstores/internal-operation_log/shards/0? cursor=MTU0NzQ3MDY4MjM3NjUxMzQ0Ng%3D%3D&type=cursor_time HTTP/1.1 
    
    Authorization: LOG <yourAccessKeyId>:<yourSignature> 
    x-log-bodyrawsize: 0 
    User-Agent: sls-java-sdk-v-0.6.1 
    x-log-apiversion: 0.6.0 
    Host: my-project.cn-hangzhou.sls.aliyuncs.com 
    x-log-signaturemethod: hmac-sha1 
    Date: Wed, 03 Apr 2019 02:57:23 GMT 
    Content-Type: application/x-protobuf 
    Connection: Keep-Alive
  • Sample success responses
    HTTP/1.1 200 
    Server: nginx 
    Content-Type: application/json 
    Content-Length: 26 
    Connection: close 
    Access-Control-Allow-Origin: * 
    Date: Wed, 03 Apr 2019 02:57:23 GMT 
    x-log-requestid: 5CA42113D2F00378A74B9051 
    { 
      "cursor_time": 1554260243 
    }

Error codes

HTTP status code Error code Error message Description
404 LogStoreNotExist Logstore {Name} does not exist. The error message returned because the specified Logstore does not exist.
400 ParameterInvalid Parameter From is not valid. The error message returned because a parameter value is invalid.
400 ShardNotExist Shard {ShardID} does not exist. The error message returned because the specified shard does not exist.
500 InternalServerError Specified Server Error Message. The error message returned because an internal server error has occurred.
400 LogStoreWithoutShard the logstore has no shard. The error message returned because no shards exist in the Logstore.

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