Querying a Stream List

Initialize a DIS client as instructed in Initializing a DIS SDK Client Instance.

Use the DIS SDK to query active streams.

Use the setLimit method to set the number of streams returned each time. If setLimit is not specified, a maximum of 10 streams are returned by default.

 String startStreamName = "XXX";
         int? limit=10;
            var dic = new DISIngestionClient();
            var request = new DescribeStreamRequest();
            if (!string.IsNullOrWhiteSpace(startStreamName))
            {
//Name of the DIS stream to start the stream list with. The returned stream list does not contain this DIS stream name.
                request.StartStreamName = startStreamName;
            }

            if (limit != null)
            {
//Max. number of DIS streams to list in a single API call.
                request.Limit = limit.Value;
            }

After configuring DescribeStreamRequest, you can query the stream list by calling DescribeStreamList.

            response = dic.DescribeStreamList(request);
            var reqJson = JsonConvert.SerializeObject(response);
            Console.WriteLine(reqJson);
            return response;

Viewing Execution Results

Press Ctrl+F5. Information similar to the following is displayed:

{"total_number":12,"stream_names":["dis-2TbN","dis-RVGG","dis-VKGL","dis-c-test-partition-1","dis-m8lK","dis-shawobs2","dis-shawobsfile","dis-test-stream","dis_CSV","dis_JSON","dis_bl","dis_file"],"has_more_streams":false}
Table 1 Description of response parameter DescribeStreamListResult

Parameter

Type

Description

total_number

int

Total number of all the DIS streams created by the current user.

stream_names

List<string>

Name of the list of the streams meeting the current requests.

has_more_streams

bool

Specify whether there are more matching DIS streams to list. Possible values: