#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

description: |
  The `pulsar-admin` tool enables you to manage Pulsar installations, including clusters, brokers, namespaces, tenants, and more.
commands:
- name: broker-stats
  description: Operations to collect broker statistics
  subcommands:
  - name: allocator-stats
    description: Dump allocator stats
    argument: allocator-name
  - name: destinations
    deprecated: true
    description: Dump topic stats
    options:
    - flags: -i, --indent
      description: Indent JSON output
      default: 'false'
  - name: mbeans
    description: Dump Mbean stats
    options:
    - flags: -i, --indent
      description: Indent JSON output
      default: 'false'
  - name: monitoring-metrics
    description: dump metrics for Monitoring
    options:
    - flags: -i, --indent
      description: Indent JSON output
      default: 'false'
  - name: topics
    description: Dump topic stats
    options:
    - flags: -i, --indent
      description: Indent JSON output
      default: 'false'
- name: brokers
  description: Operations about brokers
  subcommands:
  - name: list
    description: List active brokers of the cluster
    argument: cluster-name
  - name: namespaces
    description: List namespaces owned by the broker
    argument: cluster-name
    options:
    - flags: --url
      description: The URL for the broker
  - name: update-dynamic-config
    description: Update a broker's dynamic service configuration
    options:
    - flags: --config
      description: Service configuration parameter name
    - flags: --value
      description: Value for the configuration parameter value specified using the `--config` flag
  - name: list-dynamic-config
    description: Get list of updatable configuration name
  - name: get-all-dynamic-config
    description: Get all overridden dynamic-configuration values
  - name: get-internal-config
    description: Get internal configuration information
- name: clusters
  description: Operations about clusters
  subcommands:
  - name: get
    description: Get the configuration data for the specified cluster
    argument: cluster-name
  - name: create
    description: Provisions a new cluster. This operation requires Pulsar super-user privileges.
    argument: cluster-name
    options:
    - flags: --broker-url
      description: The URL for the broker service.
    - flags: --broker-url-secure
      description: The broker service URL for a secure connection
    - flags: --url
      description: service-url
    - flags: --url-secure
      description: service-url for secure connection
  - name: update
    description: Update the configuration for a cluster
    argument: cluster-name
    options:
    - flags: --broker-url
      description: The URL for the broker service.
    - flags: --broker-url-secure
      description: The broker service URL for a secure connection
    - flags: --url
      description: service-url
    - flags: --url-secure
      description: service-url for secure connection
  - name: delete
    description: Deletes an existing cluster
    argument: cluster-name
  - name: list
    description: List the existing clusters
  - name: update-peer-clusters
    description: Update peer cluster names
    argument: peer-cluster-names
- name: functions
  description: A command-line interface for Pulsar Functions
  subcommands:
  - name: localrun
    description: Run a Pulsar Function locally
    options:
    - flags: --cpu
      description: The CPU to allocate to each function instance (in number of cores)
    - flags: --ram
      description: The RAM to allocate to each function instance (in bytes)
    - flags: --disk
      description: The disk space to allocate to each function instance (in bytes)
    - flags: --brokerServiceUrl
      description: The URL of the Pulsar broker
    - flags: --className
      description: The name of the function's class
    - flags: --customSerdeInputs
      description: A map of the input topic to SerDe name
    - flags: --functionConfigFile
      description: The path of the YAML config file used to configure the function
    - flags: --inputs
      description: The input topics for the function (as a comma-separated list if more than one topic is desired)
    - flags: --logTopic
      description: The topic to which logs from this function are published
    - flags: --jar
      description: A path to the JAR file for the function (if the function is written in Java)
    - flags: --name
      description: The name of the function
      default: The value specified by `--className`
    - flags: --namespace
      description: The function's namespace
    - flags: --output
      description: The name of the topic to which the function publishes its output (if any)
    - flags: --outputSerdeClassName
      description: The SerDe class used for the function's output
    - flags: --parallelism
      description: The function's parallelism factor, i.e. the number of instances of the function to run
      default: 1
    - flags: --processingGuarantees
      description: "The processing guarantees applied to the function. Can be one of: `ATLEAST_ONCE`, `ATMOST_ONCE`, or `EFFECTIVELY_ONCE`"
      default: ATLEAST_ONCE
    - flags: --py
      description: The path of the Python file containing the function's processing logic (if the function is written in Python)
    - flags: --stateStorageServiceUrl
      description: The service URL for the function's state storage (if the function uses a storage system different from the Apache BookKeeper cluster used by Pulsar)
    - flags: --subscriptionType
      description: The subscription type used by the function when consuming messages on the input topic(s). Can be either `SHARED` or `EXCLUSIVE`
      default: SHARED
    - flags: --tenant
      description: The function's tenant
    - flags: --userConfig
      description: A user-supplied config value, set as a key/value pair. You can set multiple user config values.
  - name: create
    description: Creates a new Pulsar Function on the target infrastructure
    options:
    - flags: --cpu
      description: The CPU to allocate to each function instance (in number of cores)
    - flags: --ram
      description: The RAM to allocate to each function instance (in bytes)
    - flags: --disk
      description: The disk space to allocate to each function instance (in bytes)
    - flags: --className
      description: The name of the function's class
    - flags: --customSerdeInputs
      description: A map of the input topic to SerDe name
    - flags: --functionConfigFile
      description: The path of the YAML config file used to configure the function
    - flags: --inputs
      description: The input topics for the function (as a comma-separated list if more than one topic is desired)
    - flags: --jar
      description: A path to the JAR file for the function (if the function is written in Java)
    - flags: --name
      description: The name of the function
      default: The value specified by `--className`
    - flags: --namespace
      description: The function's namespace
    - flags: --logTopic
      description: The topic to which logs from this function are published
    - flags: --output
      description: The name of the topic to which the function publishes its output (if any)
    - flags: --outputSerdeClassName
      description: The SerDe class used for the function's output
    - flags: --parallelism
      description: The function's parallelism factor, i.e. the number of instances of the function to run
      default: 1
    - flags: --processingGuarantees
      description: "The processing guarantees applied to the function. Can be one of: `ATLEAST_ONCE`, `ATMOST_ONCE`, or `EFFECTIVELY_ONCE`"
      default: ATLEAST_ONCE
    - flags: --py
      description: The path of the Python file containing the function's processing logic (if the function is written in Python)
    - flags: --subscriptionType
      description: The subscription type used by the function when consuming messages on the input topic(s). Can be either `SHARED` or `EXCLUSIVE`
      default: SHARED
    - flags: --tenant
      description: The function's tenant
    - flags: --userConfig
      description: A user-supplied config value, set as a key/value pair. You can set multiple user config values.
  - name: delete
    description: Deletes an existing Pulsar Function
    options:
    - flags: --name
      description: The name of the function to delete
    - flags: --namespace
      description: The namespace of the function to delete
    - flags: --tenant
      description: The tenant of the function to delete
  - name: update
    description: Updates an existing Pulsar Function
    options:
    - flags: --className
      description: The name of the function's class
    - flags: --customSerdeInputs
      description: A map of the input topic to SerDe name
    - flags: --functionConfigFile
      description: The path of the YAML config file used to configure the function
    - flags: --inputs
      description: The input topics for the function (as a comma-separated list if more than one topic is desired)
    - flags: --jar
      description: A path to the JAR file for the function (if the function is written in Java)
    - flags: --name
      description: The name of the function
      default: The value specified by `--className`
    - flags: --namespace
      description: The function's namespace
    - flags: --logTopic
      description: The topic to which logs from this function are published
    - flags: --output
      description: The name of the topic to which the function publishes its output (if any)
    - flags: --outputSerdeClassName
      description: The SerDe class used for the function's output
    - flags: --parallelism
      description: The function's parallelism factor, i.e. the number of instances of the function to run
      default: 1
    - flags: --processingGuarantees
      description: "The processing guarantees applied to the function. Can be one of: `ATLEAST_ONCE`, `ATMOST_ONCE`, or `EFFECTIVELY_ONCE`"
      default: ATLEAST_ONCE
    - flags: --py
      description: The path of the Python file containing the function's processing logic (if the function is written in Python)
    - flags: --subscriptionType
      description: The subscription type used by the function when consuming messages on the input topic(s). Can be either `SHARED` or `EXCLUSIVE`
      default: SHARED
    - flags: --tenant
      description: The function's tenant
    - flags: --userConfig
      description: A user-supplied config value, set as a key/value pair. You can set multiple user config values.
  - name: get
    description: Fetch information about an existing Pulsar Function
    options:
    - flags: --name
      description: The name of the function about which you want to fetch information
    - flags: --namespace
      description: The namespace of the function about which you want to fetch information
    - flags: --tenant
      description: The tenant of the function about which you want to fetch information
  - name: getstatus
    description: Get the status of an existing Pulsar Function
    options:
    - flags: --name
      description: The name of the function about which you want to fetch status information
    - flags: --namespace
      description: The namespace of the function about which you want to fetch status information
    - flags: --tenant
      description: The tenant of the function about which you want to fetch status information
  - name: list
    description: List all Pulsar Functions for a specific tenant and namespace
    options:
    - flags: --namespace
      description: The namespace of the functions you want to list
    - flags: --tenant
      description: The tenant of the functions you want to list
  - name: querystate
    description: Retrieve the current state of a Pulsar Function by key
    options:
    - flags: -k, --key
      description: The key for the state you want to fetch
    - flags: --name
      description: The name of the function whose state you want to query
    - flags: --namespace
      description: The namespace of the function whose state you want to query
    - flags: --tenant
      description: The tenant of the function whose state you want to query
    - flags: -u, --storage-service-url
      description: The service URL for the function's state storage (if the function uses a storage system different from the Apache BookKeeper cluster used by Pulsar)
    - flags: -w, --watch
      description: If set, watching for state changes is enabled
      default: "false"
  - name: trigger
    description: Triggers the specified Pulsar Function with a supplied value or file data
    options:
    - flags: --name
      description: The name of the Pulsar Function to trigger
    - flags: --namespace
      description: The namespace of the Pulsar Function to trigger
    - flags: --tenant
      description: The tenant of the Pulsar Function to trigger
    - flags: --triggerFile
      description: The path to the file containing the data with which the Pulsar Function is to be triggered
    - flags: --triggerValue
      description: The value with which the Pulsar Function is to be triggered
- name: namespaces
  description: Operations for managing namespaces
  subcommands:
  - name: list
    description: Get the namespaces for a tenant
    argument: tenant-name
  - name: list-cluster
    description: Get the namespaces for a tenant in the cluster
    argument: tenant/cluster
  - name: destinations
    description: Get the destinations for a namespace
    argument: tenant/cluster/namespace
  - name: policies
    description: Get the policies of a namespace
    argument: tenant/cluster/namespace
  - name: create
    description: Create a new namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -b, --bundles
      description: The number of bundles to activate
      default: 0
  - name: delete
    description: Deletes a namespace
    argument: tenant/cluster/namespace
  - name: set-deduplication
    description: Enable or disable message deduplication on a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: --enable, -e
      description: Enable message deduplication on the specified namespace
      default: 'false'
    - flags: --disable, -d
      description: Disable message deduplication on the specified namespace
      default: 'false'
  - name: permissions
    description: Get the permissions on a namespace
    argument: tenant/cluster/namespace
  - name: grant-permission
    description: Grant permissions on a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: --actions
      description: Actions to be granted (`produce` or `consume`)
    - flags: --role
      description: The client role to which to grant the permissions
  - name: revoke-permission
    description: Revoke permissions on a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: --role
      description: The client role from which to revoke the permissions
  - name: set-clusters
    description: Set replication clusters for a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -c, --clusters
      description: Replication clusters ID list (comma-separated values)
  - name: get-clusters
    description: Get replication clusters for a namespace
    argument: tenant/cluster/namespace
  - name: get-backlog-quotas
    description: Get the backlog quota policies for a namespace
    argument: tenant/cluster/namespace
  - name: set-backlog-quota
    description: Set a backlog quota for a namespace
    argument: tenant/cluster/namespace
    example: |
      pulsar-admin namespaces set-backlog-quota my-prop/my-cluster/my-ns \
      --limit 2G \
      --policy producer_request_hold
    options:
    - flags: -l, --limit
      description: The backlog size limit (for example `10M` or `16G`)
    - flags: -p, --policy
      description: |
        The retention policy to enforce when the limit is reached. The valid options are:
        * `producer_request_hold`
        * `producer_exception`
        * `consumer_backlog_eviction`
  - name: remove-backlog-quota
    description: Remove a backlog quota policy from a namespace
    argument: tenant/cluster/namespace
  - name: get-persistence
    description: Get the persistence policies for a namespace
    argument: tenant/cluster/namespace
  - name: set-persistence
    description: Set the persistence policies for a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -a, --bookkeeper-ack-quorom
      description: The number of acks (guaranteed copies) to wait for each entry
      default: 0
    - flags: -e, --bookkeeper-ensemble
      description: The number of bookies to use for a topic
      default: 0
    - flags: -w, --bookkeeper-write-quorum
      description: How many writes to make of each entry
      default: 0
    - flags: -r, --ml-mark-delete-max-rate
      description: Throttling rate of mark-delete operation (0 means no throttle)
  - name: get-message-ttl
    description: Get the message TTL for a namespace
    argument: tenant/cluster/namespace
  - name: set-message-ttl
    description: Set the message TTL for a namespace
    options:
    - flags: -ttl, --messageTTL
      description: Message TTL in seconds
      default: 0
  - name: get-retention
    description: Get the retention policy for a namespace
    argument: tenant/cluster/namespace
  - name: set-retention
    description: Set the retention policy for a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -s, --size
      description: The retention size limits (for example `10M`, `16G` or `3T`). 0 or less than 1MB means no retention and -1 means infinite size retention
    - flags: -t, --time
      description: "The retention time in minutes, hours, days, or weeks. Examples: `100m`, `13h`, `2d`, `5w`. 0 means no retention and -1 means infinite time retention"
  - name: unload
    description: Unload a namespace or namespace bundle from the current serving broker.
    argument: tenant/cluster/namespace
    options:
    - flags: -b, --bundle
      description: # `{start_boundary}_{end_boundary}`
  - name: clear-backlog
    description: Clear the backlog for a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -b, --bundle
      description: # `{start_boundary}_{end_boundary}`
    - flags: -f, --force
      description: Whether to force a clear backlog without prompt
      default: 'false'
    - flags: -s, --sub
      description: The subscription name
  - name: unsubscribe
    description: Unsubscribe the given subscription on all destinations on a namespace
    argument: tenant/cluster/namespace
    options:
    - flags: -b, --bundle
      description: # `{start_boundary}_{end_boundary}`
    - flags: -s, --sub
      description: The subscription name
  - name: get-compaction-threshold
    description: Get compactionThreshold for a namespace
    argument: tenant/namespace
  - name: set-compaction-threshold
    description: Set compactionThreshold for a namespace
    argument: tenant/namespace
    options:
      - flags: -t, --threshold
        description: "Maximum number of bytes in a topic backlog before compaction is triggered (eg: 10M, 16G, 3T). 0 disables automatic compaction"
        default: '0'
  - name: get-offload-threshold
    description: Get offloadThreshold for a namespace
    argument: tenant/namespace
  - name: set-offload-threshold
    description: Set offloadThreshold for a namespace
    argument: tenant/namespace
    options:
      - flags: -s, --size
        description: "Maximum number of bytes stored in the pulsar cluster for a topic before data will start being automatically offloaded to longterm storage (eg: 10M, 16G, 3T, 100). Negative values disable automatic offload. 0 triggers offloading as soon as possible."
        default: '-1'

- name: ns-isolation-policy
  description: Operations for managing namespace isolation policies.
  subcommands:
  - name: set
    description: Create/update a namespace isolation policy for a cluster. This operation requires Pulsar superuser privileges.
    argument: cluster-name policy-name
    options:
    - flags: --auto-failover-policy-params
      description: Comma-separated `name=value` auto failover policy parameters
      default: '[]'
    - flags: --auto-failover-policy-type
      description: "Auto failover policy type name. Currently available options: `min_available`."
      default: '[]'
    - flags: --namespaces
      description: Comma-separated namespaces regex list
      default: '[]'
    - flags: --primary
      description: Comma-separated primary broker regex list
      default: '[]'
    - flags: --secondary
      description: Comma-separated secondary broker regex list
      default: '[]'
  - name: get
    description: Get the namespace isolation policy of a cluster. This operation requires Pulsar superuser privileges.
    argument: cluster-name policy-name
  - name: list
    description: List all namespace isolation policies of a cluster. This operation requires Pulsar superuser privileges.
    argument: cluster-name
  - name: delete
    description: Delete namespace isolation policy of a cluster. This operation requires superuser privileges.
- name: sink
  description: An interface for managing Pulsar IO sinks (egress data from Pulsar)
  subcommands:
  - name: create
    description: Submit a Pulsar IO sink connector to run in a Pulsar cluster
    options:
    - flags: --className
      description: The sink's Java class name
    - flags: --cpu
      description: The CPU (in cores) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --customSerdeInputs
      description: The map of input topics to SerDe class names (as a JSON string)
    - flags: --disk
      description: The disk (in bytes) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --inputs
      description: The sink's input topic(s) (multiple topics can be specified as a comma-separated list)
    - flags: --jar
      description: Path to the Java jar file for the sink
    - flags: --name
      description: The sink's name
    - flags: --namespace
      description: The sink's namespace
    - flags: --parallelism
      description: |
        "The sink's parallelism factor (i.e. the number of sink instances to run)."
    - flags: --processingGuarantees
      description: |
        "The processing guarantees (aka delivery semantics) applied to the sink. Available values: `ATLEAST_ONCE`, `ATMOST_ONCE`, `EFFECTIVELY_ONCE`."
    - flags: --ram
      description: The RAM (in bytes) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --sinkConfig
      description: Sink config key/values
    - flags: --sinkConfigFile
      description: The path to a YAML config file specifying the sink's configuration
    - flags: --tenant
      description: The sink's tenant
  - name: delete
    description: Stops a Pulsar IO sink
    options:
    - flags: --name
      description: The name of the sink
    - flags: --namespace
      description: The namespace of the sink
    - flags: --tenant
      description: The tenant of the sink
  - name: localrun
    description: Run the Pulsar sink locally (rather than in the Pulsar cluster)
    options:
    - flags: --brokerServiceUrl
      description: The URL for the Pulsar broker
    - flags: --className
      description: The sink's Java class name
    - flags: --cpu
      description: The CPU (in cores) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --customSerdeInputs
      description: The map of input topics to SerDe class names (as a JSON string)
    - flags: --disk
      description: The disk (in bytes) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --inputs
      description: The sink's input topic(s) (multiple topics can be specified as a comma-separated list)
    - flags: --jar
      description: Path to the Java jar file for the sink
    - flags: --name
      description: The sink's name
    - flags: --namespace
      description: The sink's namespace
    - flags: --parallelism
      description: |
        "The sink's parallelism factor (i.e. the number of sink instances to run)."
    - flags: --processingGuarantees
      description: |
        "The processing guarantees (aka delivery semantics) applied to the sink. Available values: `ATLEAST_ONCE`, `ATMOST_ONCE`, `EFFECTIVELY_ONCE`."
    - flags: --ram
      description: The RAM (in bytes) that needs to be allocated per sink instance (applicable only to the Docker runtime)
    - flags: --sinkConfig
      description: Sink config key/values
    - flags: --sinkConfigFile
      description: The path to a YAML config file specifying the sink's configuration
    - flags: --tenant
      description: The sink's tenant
- name: source
  description: An interface for managing Pulsar IO sources (ingress data into Pulsar)
  subcommands:
  - name: create
    description: Submit a Pulsar IO source connector to run in a Pulsar cluster
    options:
    - flags: --className
      description: The source's Java class name
    - flags: --cpu
      description: The CPU (in cores) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --deserializationClassName
      description: The SerDe classname for the source
    - flags: --destinationTopicName
      description: The Pulsar topic to which data is sent
    - flags: --disk
      description: The disk (in bytes) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --jar
      description: Path to the Java jar file for the source
    - flags: --name
      description: The source's name
    - flags: --namespace
      description: The source's namespace
    - flags: --parallelism
      description: |
        The source's parallelism factor (i.e. the number of source instances to run).
    - flags: --processingGuarantees
      description: |
        "The processing guarantees (aka delivery semantics) applied to the source. Available values: `ATLEAST_ONCE`, `ATMOST_ONCE`, `EFFECTIVELY_ONCE`."
    - flags: --ram
      description: The RAM (in bytes) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --sourceConfig
      description: Source config key/values
    - flags: --sourceConfigFile
      description: The path to a YAML config file specifying the source's configuration
    - flags: --tenant
      description: The source's tenant
  - name: delete
    description: Stops a Pulsar IO source
    options:
    - flags: --name
      description: The name of the source
    - flags: --namespace
      description: The namespace of the source
    - flags: --tenant
      description: The tenant of the source
  - name: localrun
    description: Run the Pulsar source locally (rather than in the Pulsar cluster)
    options:
    - flags: --className
      description: The source's Java class name
    - flags: --cpu
      description: The CPU (in cores) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --deserializationClassName
      description: The SerDe classname for the source
    - flags: --destinationTopicName
      description: The Pulsar topic to which data is sent
    - flags: --disk
      description: The disk (in bytes) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --jar
      description: Path to the Java jar file for the source
    - flags: --name
      description: The source's name
    - flags: --namespace
      description: The source's namespace
    - flags: --parallelism
      description: |
        The source's parallelism factor (i.e. the number of source instances to run).
    - flags: --processingGuarantees
      description: |
        "The processing guarantees (aka delivery semantics) applied to the source. Available values: `ATLEAST_ONCE`, `ATMOST_ONCE`, `EFFECTIVELY_ONCE`."
    - flags: --ram
      description: The RAM (in bytes) that needs to be allocated per source instance (applicable only to the Docker runtime)
    - flags: --sourceConfig
      description: Source config key/values
    - flags: --sourceConfigFile
      description: The path to a YAML config file specifying the source's configuration
    - flags: --tenant
      description: The source's tenant
- name: topics
  description: Operations for managing Pulsar topics (both persistent and non persistent)
  subcommands:
  - name: compact
    description: Run compaction on the specified topic (persistent topics only)
    argument: persistent://tenant/namespace/topic
  - name: compaction-status
    description: Check the status of a topic compaction (persistent topics only)
    argument: persistent://tenant/namespace/topic
    options:
    - flags: -w, --wait-complete
      description: Wait for compaction to complete
      default: 'false'
  - name: offload
    description: Trigger offload of data from a topic to long-term storage (e.g. Amazon S3)
    argument: "persistent://tenant/namespace/topic"
    options:
    - flags: -s, --size-threshold
      description: The maximum amount of data to keep in BookKeeper for the specific topic
  - name: offload-status
    description: Check the status of data offloading from a topic to long-term storage
    argument: "persistent://tenant/namespace/topic"
    options:
    - flags: -w, --wait-complete
      description: Wait for offloading to complete
      default: false
  - name: create-partitioned-topic
    description: Create a partitioned topic. A partitioned topic must be created before producers can publish to it.
    argument: "{persistent|non-persistent}://tenant/namespace/topic"
    options:
    - flags: -p, --partitions
      description: The number of partitions for the topic
      default: 0
  - name: delete-partitioned-topic
    description: Delete a partitioned topic. This will also delete all the partitions of the topic if they exist.
    argument: "{persistent|non-persistent}://tenant/namespace/topic"
  - name: get-partitioned-topic-metadata
    description: Get the partitioned topic metadata. If the topic is not created or is a non-partitioned topic, this will return an empty topic with zero partitions.
    argument: "{persistent|non-persistent}://tenant/namespace/topic"
  - name: list
    description: Get the list of topics under a namespace
    argument: tenant/cluster/namespace
  - name: list-in-bundle
    description: Get a list of non-persistent topics present under a namespace bundle
    argument: tenant/namespace
    options:
    - flags: -b, --bundle
      description: The bundle range
  - name: terminate
    description: Terminate a topic (disallow further messages from being published on the topic)
    argument: "{persistent|non-persistent}://tenant/namespace/topic"
  - name: permissions
    description: Get the permissions on a topic. Retrieve the effective permissions for a desination. These permissions are defined by the permissions set at the namespace level combined (union) with any eventual specific permissions set on the topic.
    argument: topic
  - name: grant-permission
    description: Grant a new permission to a client role on a single topic
    argument: "{persistent|non-persistent}://tenant/namespace/topic"
    options:
    - flags: --actions
      description: Actions to be granted (`produce` or `consume`)
    - flags: --role
      description: The client role to which permissions are to be granted
  - name: revoke-permission
    description: Revoke permissions to a client role on a single topic. If the permission was not set at the topic level, but rather at the namespace level, this operation will return an error (HTTP status code 412).
    argument: topic
  - name: lookup
    description: Look up a topic from the current serving broker
    argument: topic
  - name: bundle-range
    description: Get the namespace bundle which contains the given topic
    argument: topic
  - name: delete
    description: Delete a topic. The topic cannot be deleted if there are any active subscriptions or producers connected to the topic.
    argument: topic
  - name: unload
    description: Unload a topic
    argument: topic
  - name: subscriptions
    description: Get the list of subscriptions on the topic
    argument: topic
  - name: unsubscribe
    description: Delete a durable subscriber from a topic
    argument: topic
    options:
    - flags: -s, --subscription
      description: The subscription to delete
  - name: stats
    description: Get the stats for the topic and its connected producers and consumers. All rates are computed over a 1-minute window and are relative to the last completed 1-minute period.
    argument: topic
  - name: stats-internal
    description: Get the internal stats for the topic
    argument: topic
  - name: info-internal
    description: Get the internal metadata info for the topic
    argument: topic
  - name: partitioned-stats
    description: Get the stats for the partitioned topic and its connected producers and consumers. All rates are computed over a 1-minute window and are relative to the last completed 1-minute period.
    argument: topic
    options:
    - flags: --per-partition
      description: Get per-partition stats
      default: 'false'
  - name: skip
    description: Skip some messages for the subscription
    argument: topic
    options:
    - flags: -n, --count
      description: The number of messages to skip
      default: 0
    - flags: -s, --subscription
      description: The subscription on which to skip messages
  - name: skip-all
    description: Skip all the messages for the subscription
    argument: topic
    options:
    - flags: -s, --subscription
      description: The subscription to clear
  - name: expire-messages
    description: Expire messages that are older than the given expiry time (in seconds) for the subscription.
    argument: topic
    options:
    - flags: -t, --expireTime
      description: Expire messages older than the time (in seconds)
      default: 0
    - flags: -s, --subscription
      description: The subscription to skip messages on
  - name: expire-messages-all-subscriptions
    description: Expire messages older than the given expiry time (in seconds) for all subscriptions
    argument: topic
    options:
    - flags: -t, --expireTime
      description: Expire messages older than the time (in seconds)
      default: 0
  - name: peek-messages
    description: Peek some messages for the subscription.
    argument: topic
    options:
    - flags: -n, --count
      description: The number of messages
      default: 1
    - flags: -s, --subscription
      description: Subscription to get messages from
  - name: reset-cursor
    description: Reset position for subscription to closest to timestamp
    argument: topic
    options:
    - flags: -s, --subscription
      description: Subscription to reset position on
    - flags: -t, --time
      description: "The time, in minutes, to reset back to (or minutes, hours, days, weeks, etc.). Examples: `100m`, `3h`, `2d`, `5w`."
- name: tenants
  description: Operations for managing tenants
  subcommands:
  - name: list
    description: List the existing tenants
  - name: get
    description: Gets the configuration of a tenant
    argument: tenant-name
  - name: create
    description: Creates a new tenant
    argument: tenant-name
    options:
    - flags: -r, --admin-roles
      description: Comma-separated admin roles
    - flags: -c, --allowed-clusters
      description: Comma-separated allowed clusters
  - name: update
    description: Updates a tenant
    argument: tenant-name
    options:
    - flags: -r, --admin-roles
      description: Comma-separated admin roles
    - flags: -c, --allowed-clusters
      description: Comma-separated allowed clusters
  - name: delete
    description: Deletes an existing tenant
    argument: tenant-name
- name: resource-quotas
  description: Operations for managing resource quotas
  subcommands:
  - name: get
    description: Get the resource quota for a specified namespace bundle, or default quota if no namespace/bundle is specified.
    options:
    - flags: -b, --bundle
      description: A bundle of the form `{start-boundary}_{end_boundary}`. This must be specified together with `-n`/`--namespace`.
    - flags: -n, --namespace
      description: The namespace
      argument: tenant/namespace
  - name: set
    description: Set the resource quota for the specified namespace bundle, or default quota if no namespace/bundle is specified.
    options:
    - flags: -bi, --bandwidthIn
      description: The expected inbound bandwidth (in bytes/second)
      default: 0
    - flags: -bo, --bandwidthOut
      description: Expected outbound bandwidth (in bytes/second)
      default: 0
    - flags: -b, --bundle
      description: A bundle of the form `{start-boundary}_{end_boundary}`. This must be specified together with `-n`/`--namespace`.
    - flags: -d, --dynamic
      description: Allow to be dynamically re-calculated (or not)
      default: 'false'
    - flags: -mem, --memory
      description: Expectred memory usage (in megabytes)
      default: 0
    - flags: -mi, --msgRateIn
      description: Expected incoming messages per second
      default: 0
    - flags: -mo, --msgRateOut
      description: Expected outgoing messages per second
      default: 0
    - flags: -n, --namespace
      description: The namespace as `tenant/namespace`, for example `my-tenant/my-ns`. Must be specified together with `-b`/`--bundle`.
  - name: reset-namespace-bundle-quota
    description: Reset the specifed namespace bundle's resource quota to a default value.
    options:
    - flags: -b, --bundle
      description: A bundle of the form `{start-boundary}_{end_boundary}`.
    - flags: -n, --namespace
      description: The namespace as `property/cluster/namespace`, for example `my-prop/my-cluster/my-ns`.
- name: schemas
  description: Operations related to Schemas associated with Pulsar topics.
  subcommands:
  - name: upload
    description: Upload the schema definition for a topic
    argument: persistent://tenant/namespace/topic
    options:
    - flags: --filename
      description: The path to the schema definition file. An example schema file is available under `conf` directory.
  - name: delete
    description: Delete the schema definition associated with a topic
    argument: persistent://tenant/namespace/topic
  - name: get
    description: Retrieve the schema definition assoicated with a topic (at a given version if version is supplied).
    argument: persistent://tenant/namespace/topic
    options:
    - flags: --version
      description: The version of the schema definition to retrive for a topic.

