pulsarctl
syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the pulsarctl reference documentation.
For installation instructions, see Installing pulsarctl.
pulsarctl
command from your terminal window:
resource
, command
, name
, and flags
are:
resource
: Specifies the resource type. Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms. For example, the following commands produce the same output:
command
: Specifies the operation that you want to perform one one or more resources, for example create
, get
, list
, delete
.
name
: Specifies the name of the resource. Names are case-sensitive.
flags
: Specifies optional flags. For example, you can use the -o
or --output
flags to specify the output format of a get
result.
pulsarctl help
from the terminal window.
resource
)resource
.
NAME | Description |
---|---|
bookkeeper | Operations about BookKeeper. In order to interact with the bookkeeper cluster, you need to specify --bookie-service-url when creating a context and make sure you are able to connect to the bookkeeper cluster via the specified service url. |
broker-stats | Operations to collect broker statistics |
brokers | Operations about broker(s) |
clusters | Operations about Pulsar cluster(s) |
topics | Operations about Pulsar topics |
completion | Generates shell completion scripts |
context | Interface for setting and managing Pulsar Context(s) |
functions | Interface for managing Pulsar Functions (lightweight, Lambda-style compute processes that work with Pulsar) |
function-worker | Operations to collect function-worker statistics |
namespaces | Operations about namespaces |
ns-isolation-policy | Operations about namespace isolation policy |
oauth2 | Operations about oauth2 |
package | Operations about packages |
plugin | Operations about plugins |
resource-quotas | Operations about resource quotas |
schemas | Operations related to Schemas associated with Pulsar topics |
sinks | Interface for managing Pulsar IO sinks (egress data from Pulsar) |
sources | Interface for managing Pulsar IO Sources (ingress data into Pulsar) |
status | Check service(broker or proxy) status |
subscriptions | Operations about subscription(s) |
tenants | Operations about tenant(s) |
token | Operations of token |
topics | Operations about topic(s) |
command
)create
, get
, delete
, update
, and list
.
To learn more about command operations, see the pulsarctl reference documentation.
name
)resource
. This argument is required.
name
is case-sensitive.pulsarctl topics list public/default
, where pulsar/default
is the namespace name.
flags
)-s
or --admin-service-url
flags to specify the address and port of the admin web service URL that pulsarctl connects to.
pulsarctl help
from the terminal window.pulsarctl
commands is the human readable plain-text format. To output details to your terminal window in a specific format, you can add either the -o
or --output
flags to a supported pulsarctl
command.
pulsarctl
operation, the following output formats are supported:
Output format | Description |
---|---|
-o json | Output a JSON formatted result. |
-o yaml | Output a YAML formatted result. |
-o text | Output a humand-readable result. |
pulsarctl completion zsh
. Sourcing the completion script in your shell enables pulsarctl autocompletion.
To configure your zsh shell, run:
pulsarctl completion bash
. Sourcing this script in your shell enables pulsarctl completion.
However, the pulsarctl completion script depends on bash-completion
which you thus have to previously install.
Warning: there are two versions of bash-completion, v1 and v2. V1 is for Bash 3.2 (which is the default on macOS), and v2 is for Bash 4.1+. The pulsarctl completion script doesn’t work correctly with bash-completion v1 and Bash 3.2. It requires bash-completion v2 and Bash 4.1+. Thus, to be able to correctly use pulsarctl completion on macOS, you have to install and use Bash 4.1+ (instructions). The following instructions assume that you use Bash 4.1+ (that is, any Bash version of 4.1 or newer).
Note: As mentioned, these instructions assume you use Bash 4.1+, which means you will install bash-completion v2 (in contrast to Bash 3.2 and bash-completion v1, in which case pulsarctl completion won’t work).You can test if you have bash-completion v2 already installed with
brew list | grep bash
. If not, you can install it with Homebrew:
bash
into the bash shell.Note: If you are using the bash shell, you can ignore it
/usr/local/etc/bash_completion.d
directory:~/.bashrc
file:pulsarctl
that also works with completion: