GetCursorGetCursor 操作を呼び出して、サーバー時間に基づいてカーソルを照会することができます。 対照的に、GetCursorTime 操作を呼び出して、カーソルに基づいてサーバー時間をクエリすることができます。
リクエスト構文
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
リクエストパラメーター
パラメーター | タイプ | 必須項目 | 説明 |
---|---|---|---|
logstoreName | String | はい | Logstore の名前です。 |
shard | Integer | はい | シャードの ID です。 |
cursor | String | はい | timestamp のクエリに使用されるカーソルです。 |
type | String | はい | 照会されるログのタイプです。 このパラメーターを cursor_time に設定します。 |
リクエストヘッダーフィールド
この操作では、特別なリクエストヘッダーフィールドは必要ありません。 Log Service 操作の一般的なリクエストヘッダー フィールドの詳細については、「一般的なリクエストヘッダーフィールド」をご参照ください。
レスポンスヘッダーフィールド
この操作は、特別なレスポンスヘッダーフィールドを返しません。 log Service 操作の一般的なレスポンスヘッダーフィールドの詳細については、「一般的なレスポンスヘッダーフィールド」をご参照ください。
レスポンスパラメーター
{
"cursor_time": 1554260243
}
エラーコード
Log Service 操作の一般的なエラーに加えて、この操作は次の表に示すように、いくつかの特定のエラーを返します。
HTTP ステータスコード | エラーコード | エラーメッセージ |
---|---|---|
404 | LogStoreNotExist | logstore {Name} does not exist. |
400 | ParameterInvalid | Parameter From is not valid |
400 | ShardNotExist | Shard {ShardID} does not exist |
500 | InternalServerError | Specified Server Error Message |
400 | LogStoreWithoutShard | the logstore has no shard |
例
リクエスト例
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
成功レスポンス例
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
}