• Data Ingestion Service

dis
  1. Help Center
  2. Data Ingestion Service
  3. API Reference
  4. API Description
  5. Adding a Checkpoint

Adding a Checkpoint

Function

This API is used to add a checkpoint.

URL

  • URL format

    POST /v2/{project_id}/checkpoints

  • Parameter description

    None

Request

  • Example request
    POST https://{ip}{endpoint}:{port}/v2/6352bba7aaab443aa1d9943efc586a68/checkpoints
    
    Request Header: 
    Content-Type: application/json 
    X-Sdk-Date: 20180820T024248Z 
    Authorization: SDK-HMAC-SHA256 Credential=QRUP2R3QFNAOVAWMYHZW/20180820/eu-de/test/sdk_request,  
    SignedHeaders=host;x-sdk-date,  
    Signature=9d8b56b055c0e1f7a9498d881a7cb726be91b4f0cde1773b0b1557e987a480ce
    
    {
     "stream_name": "stream_name_test1",
      "app_name": "app_name1",
      "partition_id": "shardId-0000000000",
      "sequence_number": "10",
      "metadata": "metadata",
      "checkpoint_type": "LAST_READ"
    }
  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    stream_name

    Yes

    String

    Name of the DIS stream whose data record will have a checkpoint.

    A stream name is 1 to 64 characters long. Only letters, digits, hyphens (-), and underscores (_) are allowed.

    app_name

    Yes

    String

    Unique name of the consumer application that will read data from the chosen DIS stream.

    An application name must contain 1 to 50 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.

    partition_id

    Yes

    String

    Unique ID of the partition.

    sequence_number

    Yes

    String

    Unique sequence number of the record for which a checkpoint will be added.

    metadata

    No

    String

    Metadata of the consumer application.

    The maximum metadata length is 1000 characters.

    checkpoint_type

    Yes

    String

    Type of the checkpoint.

    The checkpoint type LAST_READ indicates that only sequence numbers are recorded into the database.

Response

  • If the DIS stream was successfully created, a 201 response with an empty response body is returned.
  • If the DIS stream failed to be created, identify the failure cause according to the response body and the instructions in Error Codes.

Status Code

  • Normal

    201 Created

  • Failed

    For more information, see Error Codes.