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.
Syntax
Use the following syntax to runpulsarctl 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 examplecreate,get,list,delete. -
name: Specifies the name of the resource. Names are case-sensitive. -
flags: Specifies optional flags. For example, you can use the-oor--outputflags to specify the output format of agetresult.
pulsarctl help from the terminal window.
Resource types (resource)
The following table includes a list of all the supported resource types and their descriptions.
The following table includes the descriptions for resource.
Operations (command)
Specifies the operation to be performed on one or more resources. This argument is required. Common operations include create, get, delete, update, and list.
To learn more about command operations, see the pulsarctl reference documentation.
Resource Name (name)
Specifies the name of the resource. This argument is required.
name is case-sensitive.pulsarctl topics list public/default, where pulsar/default is the namespace name.
Flags (flags)
Specifies the flags. This argument is optional.
For example, you can use the -s or --admin-service-url flags to specify the address and port of the admin web service URL that pulsarctl connects to.
Flags that you specify from the command line override the default values and corresponding environment variables.
Output options
Use the following sections for information about how you can format the output of certain commands. For details about which commands support the various output options, see the pulsarctl reference documentation.Formatting output
The default output format for allpulsarctl 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.
Syntax
pulsarctl operation, the following output formats are supported:
Enabling shell autocompletion
pulsarctl provides autocompletion support for Bash, Zsh, and Fish, which can save you a lot of typing.Zsh
The pulsarctl completion script for Zsh can be generated with the commandpulsarctl completion zsh. Sourcing the completion script in your shell enables pulsarctl autocompletion.
To configure your zsh shell, run:
Bash
Introduction
The pulsarctl completion script for Bash can be generated withpulsarctl 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).
Install bash-completion
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:
Enable pulsarctl autocompletion
You now have to ensure that the pulsarctl completion script gets sourced in all your shell sessions. There are multiple ways to achieve this:- First, you can use
bashinto the bash shell.
Note: If you are using the bash shell, you can ignore it
- Add the completion script to the
/usr/local/etc/bash_completion.ddirectory:
- Source the completion script in your
~/.bashrcfile:
pulsarctl that also works with completion: