command
module
Version:
v0.0.0-...-89397e2
Opens a new window with list of versions in this module.
Published: Apr 15, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Overview
The pulsarctl is a CLI tool written by Golang language for the Apache Pulsar project.
Prerequisites
More information reference to here.
Example
Connect to cluster through OAuth2 authentication plugin
pulsarctl supports to connect to Pulsar cluster through the OAuth2 authentication plugin in the following two ways.
-
Get the Web service URLs. For details, see Get Pulsar service URLs.
-
Get the Oauth2 authentication parameters. For details, see Get Oauth2 authentication parameters.
-
Activate an account with Oauth2 key file.
pulsarctl oauth2 activate \
--issuer-endpoint https://streamnative.cloud \
--client-id abcdefghigk0123456789 \
--audience urn:sn:pulsar:pulsar-instance-ns:pulsar-instance-name \
--key-file /path/to/private/key/file.json
Output:
Logged in as cloud@streamnative.cloud.
Welcome to Pulsar!
-
Use pulsarctl to get Pulsar resources.
pulsarctl namespaces list public \
--admin-service-url https://streamnative.cloud:443 \
--issuer-endpoint https://streamnative.cloud \
--client-id abcdefghigk0123456789 \
--audience urn:sn:pulsar:pulsar-instance-ns:pulsar-instance-name \
--key-file /path/to/private/key/file.json
Output:
+----------------+
| NAMESPACE NAME |
+----------------+
| public/default |
+----------------+
Use Go Admin API
-
Get the Web service URLs. For details, see Get Pulsar service URLs.
-
Get the Oauth2 authentication parameters. For details, see Get Oauth2 authentication parameters.
-
Connect to the Pulsar cluster through the Oauth2 authentication plugin.
go build pulsarctl ConnectByOAuth2.go
./pulsarctl -webServiceURL https://streamnative.cloud:443 \
-privateKeyFile /path/to/private/key/file.json\
-audience urn:sn:pulsar:pulsar-instance-ns:pulsar-instance-name\
-issuerUrl https://streamnative.cloud\
-clientId abcdefghigk0123456789
Output:
the namespace is: [public/default]
Connect to cluster through Token authentication plugin
-
Get the Web service URLs. For details, see Get Pulsar service URLs.
-
Get the Token authentication parameters. For details, see Get Token authentication parameters.
-
Connect to the Pulsar cluster through the Token authentication plugin.
pulsarctl \
--admin-service-url WEB_SERVICE_URL \
--token AUTH_PARAMS \
tenants list
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.