GET /v3/clusters/{string: cluster_id}/topics/{string: topic_name}/partitions

Retrieves a list of partitions for the topic within a cluster.

Description

The behavior of the information retrieved depends on the configuration. See streams.default.stream in Configuration Parameters.
Table 1. Response Behavior
Parameters Defined Response
streams.default.stream is defined Gets metadata about specific HPE Ezmeral Data Fabric Streams partitions within a topic on this cluster. The user could pass fully qualified topic name or not. If a fully qualified topic name is not used, metadata is retrieved and appended to the default stream path.
streams.default.stream is not defined Gets metadata about specific HPE Ezmeral Data Fabric Streams partitions within topic on this cluster. The user could only pass fully qualified topic name that contains stream path.
Table 2. Parameters
Parameters Description
cluster_id (string) Cluster’s id.
topic_name (string) Name of the topic.

Syntax

http://<host>:8082/v3/clusters/<cluster_id>/topics/<topic_name>/partitions

Request Example

$ curl -X GET -H "Content-Type: application/json" "http://localhost:8082/v3/clusters/682798077049224619/topics/tp-2/partitions"

Response Example

{
  "kind":"KafkaPartitionList",
  "metadata":
    {
      "self":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/tp-2/partitions",
      "next":null
    },
  "data":
    [
        {
          "kind":"KafkaPartition",
          "metadata":
            {
              "self":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/0",
              "resource_name":"crn:///kafka=682798077049224619/topic=str:tp-2/partition=0"
            },
          "cluster_id":"682798077049224619",
          "topic_name":"/str:tp-2",
          "partition_id":0,
          "leader":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/0/replicas/0"
            },
          "replicas":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/0/replicas"
            },
          "reassignment":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/0/reassignment"
            }
        },
        {
          "kind":"KafkaPartition",
          "metadata":
            {
              "self":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/1",
              "resource_name":"crn:///kafka=682798077049224619/topic=str:tp-2/partition=1"
            },
          "cluster_id":"682798077049224619",
          "topic_name":"/str:tp-2",
          "partition_id":1,
          "leader":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/1/replicas/0"
            },
          "replicas":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/1/replicas"
            },
          "reassignment":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/1/reassignment"
            }
        },
        {
          "kind":"KafkaPartition",
          "metadata":
            {
              "self":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/2",
              "resource_name":"crn:///kafka=682798077049224619/topic=str:tp-2/partition=2"
            },
          "cluster_id":"682798077049224619",
          "topic_name":"/str:tp-2",
          "partition_id":2,
          "leader":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/2/replicas/0"
            },
          "replicas":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/2/replicas"
            },
          "reassignment":
            {
              "related":"http://node1.cluster.com:8082/v3/clusters/682798077049224619/topics/str:tp-2/partitions/2/reassignment"
            }
        }
    ]
}