- Operating StreamNative Platform
- Protocols
Configure Message Rest API
Set up Message REST API
Before using Rest API, you need to complete the following setup steps.
Step 1: Create a service account
Note
Currently, you can't edit a service account. If you need a service account to have Super Admin access, make sure to enable it when creating the service account. By default, service accounts do not have Super Admin enabled.
To create a service account, follow these steps.
On the left navigation pane, click Service Accounts.
Click Create Service Account.
(Optional) Select Super Admin to grant the service account with Super admin access to a namespace or tenant.
Enter a name for the service account, and then click Confirm.
Step 2: Create an API key of your service account
Note
Before using an API key, verify that the service account is authorized to access the resources, such as tenants, namespaces, and topics.
You can follow the instructions to create an API key for the service account you choose to use.
Step 3: Grant service account permissions
Note
If you use a Super Admin service account, you can skip this step because a Super Admin service account has the required permissions already.
On the left navigation pane, in the Admin section, click Tenants/Namespaces.
Select the Public tenant, then select the Default namespace under the tenant.
Select the POLICY tab.
In the Authorization area, click ADD ROLE, and select the name of the service account you just created in the previous section.
In the Authorization area, on the drop-down menu below the service name you just added, select the consume and produce roles. The roles are added to your service account.
Step 4: Get the HTTP Service URL of your StreamNative cluster
To get the service URL of a Pulsar cluster through the StreamNative Console, follow these steps.
On the left navigation pane, in the Admin area, click Pulsar Clusters.
Select the Details tab, and in the Access Points area, click Copy at the end of the row of the service URL.
Enable Message Rest API
To enable the message Rest API on StreamNative Platform, you can set broker.pulsarRestMessaging.enabled
to true
and then use the helm upgrade
command to update the configuration.
broker:
pulsarRestMessaging:
enabled: true
Note
The message Rest API is enabled on the Pulsar broker. To access the message Rest API outside a Kubernetes cluster, you need to expose the Pulsar proxy service and access the exposed proxy endpoint. The Pulsar proxy will forward the message Rest API requests to the Pulsar broker. For more details, see configure networking.