Help Center> Data Ingestion Service> API Reference> API Description> Viewing Details of a DIS Stream

Viewing Details of a DIS Stream

Function

This API is used to query details about a specified stream.

  • You need to specify the name of the stream to be queried.
  • You need to specify the partition from which the partition list is returned and the maximum number of partitions returned in a single request.

URI

  • URI format

    GET /v2/{project_id}/streams/{stream_name}

  • Parameter description

    None

Request

  • Example request
    GET https://{endpoint}/v2/{project_id}/streams/stream_test?start_partitionId=shardId-0000000000&limit_partitions=100
  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    stream_name

    Yes

    String

    Name of the DIS stream to be queried.

    start_partitionId

    No

    String

    ID of the partition to start the partition list with. The returned partition list does not contain this partition ID.

    limit_partitions

    No

    Int

    Maximum number of partitions to list in a single API call.

    Value range: 1–1000

    Default value: 100

Response

  • Example response
    {
      "stream_name": "stream_test",
      "stream_id": "U7v0U582F8ccXyErJKC",
      "create_time": 1504679587519,
      "last_modified_time": 1504679587519,
      "retention_period": 24,
      "status": "RUNNING",
      "stream_type": "COMMON",
      "data_type": "JSON",
      "writable_partition_count": 3,
      "readable_partition_count": 5,
      "partitions": [
        {
         "status": "ACTIVE",
         "partition_id": "shardId-0000000000",
          "hash_range": "[0 : 9223372036854775807]",
           "sequence_number_range": "[0 : 200]"
        }
     ],
     "data_schema":{
    	"type": "record",
    	"name": "RecordName",
    	"fields": [{
    		"name": "id",
    		"type": "string",
    		"doc": "Type inferred from '\"1\"'"
                    }, {
    		"name": "detail",
    		"type": {
    			"type": "record",
    			"name": "detail",
    			"fields": [{
    				"name": "detID",
    				"type": "string",
    				"doc": "Type inferred from '\"05790110000000000103\"'"
    			}, {
    				"name": "endTime",
    				"type": "string",
    				"doc": "Type inferred from '\"2018/10/07 13:26:35\"'"
    			}]
    		},
    		"doc": "Type inferred from '{\"detID\":\"05790110000000000103\",\"endTime\":\"2018/10/07 13:26:35\"}'"
    	}]
       },
      "has_more_partitions": false,
       "tags": []
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Type

    Description

    stream_name

    String

    Name of the DIS stream.

    stream_id

    String

    Unique ID of each stream.

    create_time

    Long

    Timestamp at which the DIS stream was created.

    last_modified_time

    Long

    Timestamp at which the DIS stream was most recently modified.

    retention_period

    Int

    Period for storing data in units of hours.

    status

    String

    The stream status is one of the following:

    • CREATING
    • RUNNING
    • TERMINATING
    • TERMINATED

    stream_type

    String

    Partition type.

    data_type

    String

    Type of the source data.

    data_schema

    String

    Source data structure that defines JSON and CSV formats. It is described in the syntax of the Avro schema. For details about Avro, see http://avro.apache.org/docs/current/#schemas.

    writable_partition_count

    Int

    Total number of writable partitions (including partitions in ACTIVE state only).

    readable_partition_count

    Int

    Total number of readable partitions (including partitions in ACTIVE and DELETED state).

    tags

    List<Tag>

    Label of the stream.

    partitions

    List<PartitionResult>

    A list of partitions that comprise the DIS stream. For more information, see Table 3.

    has_more_partitions

    Boolean

    Specify whether there are more matching partitions of the DIS stream to list.

    • true: There are more partitions.
    • false: There are no more partitions.
    Table 3 partitions parameter description

    Parameter

    Type

    Description

    status

    String

    Current status of each partition.

    • CREATING
    • ACTIVE
    • DELETED
    • EXPIRED

    partition_id

    String

    Unique identifier of the partition.

    hash_range

    String

    Possible value range of the hash key used by each partition.

    sequence_number_range

    String

    Sequence number range of each partition.

    Table 4 tags parameter description

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Key. A tag key cannot contain special characters such as =*<>\,|/ or start or end with a space.

    value

    Yes

    String

    Value. A tag value cannot contain special characters such as =*<>\,|/ or start or end with a space.

Status Code

  • Normal

    200 OK

  • Failed

    For more information, see Error Codes.