Listing Streams

List streams in the Streaming service.

For stream pools, see Listing Stream Pools.

    1. Open the navigation menu  and select Analytics & AI. Under Messaging, select Streaming.
    2. To view the streams in a different compartment, use the Compartment filter to switch compartments.
      You must have permission to work in a compartment to see the resources in it. If you're not sure which compartment to use, contact an administrator. For more information, see Understanding Compartments.
    A list of existing streams is displayed.
  • Use the oci streaming admin stream list command and required parameters to list streams:

    oci streaming admin stream list [OPTIONS]

    By default, the first 10 streams are returned.

    You can list streams by compartment or by stream pool.

    Compartment example:

    oci streaming admin stream list --compartment-id ocid1.tenancy.oc1..exampleuniqueID
    {
      "data": [
        {
          "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID",
          "defined-tags": {},
          "freeform-tags": {},
          "id": "ocid1.stream.oc1.phx.exampleuniqueID",
          "lifecycle-state": "ACTIVE",
          "messages-endpoint": "https://cell-1.streaming.us-phoenix-1.oci.oraclecloud.com",
          "name": "example_stream_2",
          "partitions": 1,
          "stream-pool-id": "ocid1.streampool.oc1.phx.exampleuniqueID",
          "time-created": "2020-08-21T21:19:35.707000+00:00"
        },
        {
          "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID",
          "defined-tags": {},
          "freeform-tags": {},
          "id": "ocid1.stream.oc1.phx.exampleuniqueID",
          "lifecycle-state": "DELETED",
          "messages-endpoint": "https://cell-1.streaming.us-phoenix-1.oci.oraclecloud.com",
          "name": "example_stream_1",
          "partitions": 5,
          "stream-pool-id": "ocid1.streampool.oc1.phx.exampleuniqueID",
          "time-created": "2020-07-16T20:59:32.904000+00:00"
        }
      ]
    }

    Stream pool example:

    oci streaming admin stream list --stream-pool-id ocid1.streampool.oc1.phx.exampleuniqueID
    {
      "data": [
        {
          "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID",
          "defined-tags": {},
          "freeform-tags": {},
          "id": "ocid1.stream.oc1.phx.exampleuniqueID",
          "lifecycle-state": "ACTIVE",
          "messages-endpoint": "https://cell-1.streaming.us-phoenix-1.oci.oraclecloud.com",
          "name": "example_stream_2",
          "partitions": 1,
          "stream-pool-id": "ocid1.streampool.oc1.phx.exampleuniqueID",
          "time-created": "2020-08-21T21:19:35.707000+00:00"
        },
        {
          "compartment-id": "ocid1.tenancy.oc1..exampleuniqueID",
          "defined-tags": {},
          "freeform-tags": {},
          "id": "ocid1.stream.oc1.phx.exampleuniqueID",
          "lifecycle-state": "DELETED",
          "messages-endpoint": "https://cell-1.streaming.us-phoenix-1.oci.oraclecloud.com",
          "name": "example_stream_1",
          "partitions": 5,
          "stream-pool-id": "ocid1.streampool.oc1.phx.exampleuniqueID",
          "time-created": "2020-07-16T20:59:32.904000+00:00"
        }
      ]
    }

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the ListStreams operation to list streams.

Using OCI SDKs

Use the listStreams method to return a list of streams for the specified compartment or stream pool.

For detailed SDK examples, see Developer Guide to Streaming.

Using Resource Manager and Terraform

Use the oci_streaming_streams data source to list streams in a compartment.

For example:

data "oci_streaming_streams" "test_streams" {

    #Optional
    compartment_id = var.compartment_id
    id = var.stream_id
    name = var.stream_name
    state = var.stream_state
    stream_pool_id = oci_streaming_stream_pool.test_stream_pool.id
}

Example representation of a stream (a oci_streaming_stream resource):

resource oci_streaming_stream export_example_stream {
  compartment_id = var.compartment_ocid
  defined_tags = {
  }
  freeform_tags = {
  }
  name               = "example_stream"
  partitions         = "1"
  retention_in_hours = "24"
  #stream_pool_id = <<Optional value not found in discovery>>
}
About Resource Manager and Terraform

Resource Manager is an Oracle Cloud Infrastructure (OCI) service that allows you to automate the process of provisioning your OCI resources. Using Terraform, Resource Manager helps you install, configure, and manage resources through the "infrastructure-as-code" model.

A Terraform configuration codifies your infrastructure in declarative configuration files. The configuration defines the resources you intend to provision, variables, and specific instructions for provisioning the resources

You can use Resource Manager or the Terraform CLI with the OCI Terraform provider to see how your streams and stream pools are represented in Terraform configuration files.

For more information about writing configurations for use with Resource Manager, see Terraform Configurations for Resource Manager and Terraform Configuration.