Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 2.27 KB

File metadata and controls

70 lines (51 loc) · 2.27 KB

Form {product} HTTP requests

You can use the {devops-api}s and {pulsar-reg} REST APIs to programmatically interact with your tenants and related {product} configurations. Each API supports different functionalities.

Depending on the API you use, you need certain information to form HTTP requests:

  • To use the {product} {pulsar-short} Admin API and {pulsar-short} REST APIs, you need the tenant’s Web Service URL and {pulsar-short} token.

  • To use the {devops-api}s, you need an {astra-db} application token.

Get the tenant web service URL

  1. In the {astra-ui} navigation menu, click Streaming, and then select your tenant.

  2. Click the Connect tab.

  3. Locate the Tenant Details section. Here you can find the essential information you need to communicate with your {pulsar-short} tenant, including the Web Service URL.

    Tenant details in {product}

    Tip

    The Web Service URL is not the same as the {pulsar-short} Broker Service URL.

    Web Service URLs start with http. Broker Service URLs start with pulsar(+ssl).

Create an {product} {pulsar-short} token

Important

An {astra-db} application token is not the same as a {pulsar-short} token.

For information about creating {pulsar-short} tokens, see operations:astream-token-gen.adoc.

Make a request

  1. Set your environment variables:

    PULSAR_TOKEN="PULSAR_TOKEN"
    WEB_SERVICE_URL="TENANT_WEB_SERVICE_URL"
  2. Run a curl command. The following example lists built-in sink connectors.

    curl -sS --location -X GET "$WEB_SERVICE_URL/admin/v3/sinks/builtinsinks" \
    --header "Authorization: $PULSAR_TOKEN" \
    --header "Content-Type: application/json"

Format responses

The default response is a single JSON string.

You can use modifications like | jq . or | python3 -mjson.tool to format the output for easier reading.

See also

  • streaming-learning:pulsar-io:connectors/index.adoc

  • developing:astream-functions.adoc