UpdateCheckpoint インターフェースは、指定されたプロジェクトと Logstore のコンシューマーグループのシャードのチェックポイントを更新します。

例:
POST /logstores/{logstoreName}/consumergroups/{consumerGroupName}? forceSuccess={forceSuccess}&type=checkpoint&consumer={consumer}

リクエスト構文

POST /logstores/<logstoreName>/consumergroups/<consumerGroupName>? forceSuccess=<forceSuccess>&type=checkpoint&consumer=<consumer> HTTP/1.1
Authorization: <AuthorizationString>
x-log-bodyrawsize: 0
User-Agent: <UserAgent>
x-log-apiversion: 0.6.0
Host: <Project Endpoint>
x-log-signaturemethod: hmac-sha1
Date: <GMT Date>
Content-Type: application/json
Content-Length: <ContentLength>
Connection: Keep-Alive
{
  "shard": <shardID>,
  "checkpoint": <checkpoint>
}

リクエストパラメーター

名前 パラメーター 必須/省略可能 説明
logstoreName string 必須 コンシューマーグループの Logstore 名
consumerGroup string 必須 コンシューマーグループ名
forceSuccess bool 省略可能 強制的に更新するかどうか
consumer string 省略可能 コンシューマー
シャード integer 必須 シャード ID
checkpoint string 必須 チェックポイント値
リクエストヘッダー

UpdateCheckpoint インターフェースには特別なリクエストヘッダーはありません。 Log Service API のパブリックリクエストヘッダーの詳細については、パブリックリクエストヘッダー をご参照ください。

レスポンスヘッダー

UpdateCheckpoint インターフェースには特別なレスポンスヘッダーはありません。 Log Service API のパブリックレスポンスヘッダーの詳細については、パブリックレスポンスヘッダー をご参照ください。

レスポンス要素

システムは HTTP ステータスコード 200 を返します。

エラーコード

インターフェースは Log Service API の 一般的なエラー コード に加えて以下のエラーコードを返す場合があります。

HTTP ステータスコード エラーコード エラーメッセージ
400 InvalidShardCheckPoint shard checkpoint not encoded by base64
404 ProjectNotExist The Project does not exist : {Project}
404 LogStoreNotExist logstore {logstoreName} dose not exist
404 ConsumerGroupNotExist consumer group not exist
404 ShardNotExist shard not exist
500 InternalServerError Specified Server Error Message
詳細な説明

コンシューマーが指定されていない場合、チェックポイントは forceSuccess が true に設定されている場合のみ更新できます。

リクエスト例:
POST /logstores/logstore-4/consumergroups/consumer_group_test? forceSuccess=false&type=checkpoint&consumer=consumer_1 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-shanghai.log.aliyuncs.com
x-log-signaturemethod: hmac-sha1
Date: Sun, 06 May 2018 09:14:53 GMT
Content-Type: application/json
Content-MD5: 59457BAFB3F85A5117BDE243947583B0
Content-Length: 55
Connection: keep-alive
{
  "shardId": 0,
  "checkpoint": "MTUyNDE1NTM3OTM3MzkwODQ5Ng=="
}
レスポンス例:
HTTP/1.1 200
Server: nginx/1.12.1
Content-Length: 0
Connection: close
Access-Control-Allow-Origin: *
Date: Sun, 06 May 2018 09:14:54 GMT
x-log-requestid: 5AEEC78E1FFC0366B24F1C63