Skip to content

Conversation

@zymap
Copy link
Member

@zymap zymap commented Sep 5, 2019

Master issue: #2

Modifications

Add commands topic create, delete, update, get-metadata, list.

TODO
need add test for these commands.

OUTPUT

  • create *
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic create -h
USED FOR:
    This command is used for creating topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Create non-partitioned topic <topic-name>
    pulsarctl topics create <topic-name> 0

    #Create topic <topic-name> with <partitions-num> partitions
    pulsarctl topics create <topic-name> <partition-num>

OUTPUT:
    #normal output
    Create topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the topic has been created
    [✖]  code: 409 reason: Partitioned topic already exists

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics create [flags]

Aliases: create, c
  • delete *
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic delete -h
USED FOR:
    This command is used for deleting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Delete a partitioned topic <topic-name>
    pulsarctl topics delete <topic-name>

    #Delete a non-partitioned topic <topic-name>
    pulsarctl topics delete --non-partitioned <topic-name>

OUTPUT:
    #normal output
    Delete topic <topic-name> successfully

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the partitioned topic does not exist
    [✖]  code: 404 reason: Partitioned topic does not exist

    #the non-partitioned topic does not exist
    [✖]  code: 404 reason: Topic not found

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics delete [flags]

Aliases: delete, d
  • get-metadata *
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic get-metadata -h
USED FOR:
    This command is used for getting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Get an exist topic <topic-name> metadata
    pulsarctl topics get-metadata <topic-name>

OUTPUT:
    #normal output
    {
      "partitions": "<partitions>"
    }

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics get-metadata [flags]

Aliases: get-metadata, gm
  • list *
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic list -h
USED FOR:
    This command is used for listing all exist topics under the specified namespace.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #List all exist topics under the namespace <tenant/namespace>
    pulsarctl topics list <tenant/namespace>

OUTPUT:
    #normal output
    +--------------------------------+--------------------------------+
    |   PUBLIC/DEFAULT PARTITIONED   | PUBLIC/DEFAULT NON-PARTITIONED |
    |             TOPICS             |             TOPICS             |
    +--------------------------------+--------------------------------+
    |                                |                                |
    +--------------------------------+--------------------------------+

    #the namespace is not specified
    [✖]  only one argument is allowed to be used as a name

    #the tenant of the namespace is not exist
    [✖]  code: 404 reason: Tenant does not exist

    #the namespace is not exist
    [✖]  code: 404 reason: Namespace does not exist

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics list [flags]

Aliases: list, lp
  • update *
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic update -h
USED FOR:
    This command is used for updating an exist topic with new partition number.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #
    pulsarctl topics update <topic-name> <partition-num>

OUTPUT:
    #normal output
    Update topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the partitions number is invalid
    [✖]  invalid partition number '<number>'

    #the topic is not exist
    [✖]  code: 409 reason: Topic is not partitioned topic

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics update [flags]

Aliases: update, up

@zymap zymap self-assigned this Sep 5, 2019
@zymap zymap added this to the 0.0.1 milestone Sep 5, 2019
@zymap zymap requested review from sijie and wolfstudy and removed request for wolfstudy September 5, 2019 15:05
@sijie sijie mentioned this pull request Sep 5, 2019
29 tasks
@sijie
Copy link
Member

sijie commented Sep 5, 2019

please avoid coupling refactoring with other changes. so revert the refactor please.

also as discussed, lets unify partitioned topic and topic into one set of commands.

@zymap zymap force-pushed the topic-partitioned-commands branch from 383dac2 to f70a8ec Compare September 7, 2019 06:35
@zymap
Copy link
Member Author

zymap commented Sep 7, 2019

@sijie PTAL

Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the help output for the added commands in the description.

@zymap zymap force-pushed the topic-partitioned-commands branch from d4986f6 to b213f04 Compare September 9, 2019 15:48
return err
}

partitions, err := strconv.Atoi(vc.NameArgs[1])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only checking two args. Please be more specific. SetRunFuncWithTwoNameArgs

@zymap
Copy link
Member Author

zymap commented Sep 10, 2019

@sijie PTAL

@sijie sijie merged commit c32980a into master Sep 10, 2019
@wolfstudy wolfstudy deleted the topic-partitioned-commands branch October 11, 2019 06:26
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
Master issue: streamnative/pulsarctl#2 

*Modifications*

Add commands topic `create`, `delete`, `update`, `get-metadata`, `list`.


*TODO*
need add test for these commands.

## OUTPUT

* create *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic create -h
USED FOR:
    This command is used for creating topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Create non-partitioned topic <topic-name>
    pulsarctl topics create <topic-name> 0

    #Create topic <topic-name> with <partitions-num> partitions
    pulsarctl topics create <topic-name> <partition-num>

OUTPUT:
    #normal output
    Create topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the topic has been created
    [✖]  code: 409 reason: Partitioned topic already exists

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics create [flags]

Aliases: create, c
```

* delete *

```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic delete -h
USED FOR:
    This command is used for deleting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Delete a partitioned topic <topic-name>
    pulsarctl topics delete <topic-name>

    #Delete a non-partitioned topic <topic-name>
    pulsarctl topics delete --non-partitioned <topic-name>

OUTPUT:
    #normal output
    Delete topic <topic-name> successfully

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the partitioned topic does not exist
    [✖]  code: 404 reason: Partitioned topic does not exist

    #the non-partitioned topic does not exist
    [✖]  code: 404 reason: Topic not found

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics delete [flags]

Aliases: delete, d
```

* get-metadata *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic get-metadata -h
USED FOR:
    This command is used for getting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Get an exist topic <topic-name> metadata
    pulsarctl topics get-metadata <topic-name>

OUTPUT:
    #normal output
    {
      "partitions": "<partitions>"
    }

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics get-metadata [flags]

Aliases: get-metadata, gm
```

* list *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic list -h
USED FOR:
    This command is used for listing all exist topics under the specified namespace.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #List all exist topics under the namespace <tenant/namespace>
    pulsarctl topics list <tenant/namespace>

OUTPUT:
    #normal output
    +--------------------------------+--------------------------------+
    |   PUBLIC/DEFAULT PARTITIONED   | PUBLIC/DEFAULT NON-PARTITIONED |
    |             TOPICS             |             TOPICS             |
    +--------------------------------+--------------------------------+
    |                                |                                |
    +--------------------------------+--------------------------------+

    #the namespace is not specified
    [✖]  only one argument is allowed to be used as a name

    #the tenant of the namespace is not exist
    [✖]  code: 404 reason: Tenant does not exist

    #the namespace is not exist
    [✖]  code: 404 reason: Namespace does not exist

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics list [flags]

Aliases: list, lp
```

* update *

```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic update -h
USED FOR:
    This command is used for updating an exist topic with new partition number.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #
    pulsarctl topics update <topic-name> <partition-num>

OUTPUT:
    #normal output
    Update topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the partitions number is invalid
    [✖]  invalid partition number '<number>'

    #the topic is not exist
    [✖]  code: 409 reason: Topic is not partitioned topic

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics update [flags]

Aliases: update, up
```
tisonkun pushed a commit to apache/pulsar-client-go that referenced this pull request Aug 16, 2023
Master issue: streamnative/pulsarctl#2 

*Modifications*

Add commands topic `create`, `delete`, `update`, `get-metadata`, `list`.


*TODO*
need add test for these commands.

## OUTPUT

* create *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic create -h
USED FOR:
    This command is used for creating topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Create non-partitioned topic <topic-name>
    pulsarctl topics create <topic-name> 0

    #Create topic <topic-name> with <partitions-num> partitions
    pulsarctl topics create <topic-name> <partition-num>

OUTPUT:
    #normal output
    Create topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the topic has been created
    [✖]  code: 409 reason: Partitioned topic already exists

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics create [flags]

Aliases: create, c
```

* delete *

```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic delete -h
USED FOR:
    This command is used for deleting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Delete a partitioned topic <topic-name>
    pulsarctl topics delete <topic-name>

    #Delete a non-partitioned topic <topic-name>
    pulsarctl topics delete --non-partitioned <topic-name>

OUTPUT:
    #normal output
    Delete topic <topic-name> successfully

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the partitioned topic does not exist
    [✖]  code: 404 reason: Partitioned topic does not exist

    #the non-partitioned topic does not exist
    [✖]  code: 404 reason: Topic not found

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics delete [flags]

Aliases: delete, d
```

* get-metadata *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic get-metadata -h
USED FOR:
    This command is used for getting an exist topic.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #Get an exist topic <topic-name> metadata
    pulsarctl topics get-metadata <topic-name>

OUTPUT:
    #normal output
    {
      "partitions": "<partitions>"
    }

    #the topic name is not specified
    [✖]  only one argument is allowed to be used as a name

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics get-metadata [flags]

Aliases: get-metadata, gm
```

* list *
```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic list -h
USED FOR:
    This command is used for listing all exist topics under the specified namespace.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #List all exist topics under the namespace <tenant/namespace>
    pulsarctl topics list <tenant/namespace>

OUTPUT:
    #normal output
    +--------------------------------+--------------------------------+
    |   PUBLIC/DEFAULT PARTITIONED   | PUBLIC/DEFAULT NON-PARTITIONED |
    |             TOPICS             |             TOPICS             |
    +--------------------------------+--------------------------------+
    |                                |                                |
    +--------------------------------+--------------------------------+

    #the namespace is not specified
    [✖]  only one argument is allowed to be used as a name

    #the tenant of the namespace is not exist
    [✖]  code: 404 reason: Tenant does not exist

    #the namespace is not exist
    [✖]  code: 404 reason: Namespace does not exist

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics list [flags]

Aliases: list, lp
```

* update *

```
➜  pulsarctl-yong git:(topic-partitioned-commands) ./pulsarctl topic update -h
USED FOR:
    This command is used for updating an exist topic with new partition number.

REQUIRED PERMISSION:
    This command requires admin permissions.

EXAMPLES:
    #
    pulsarctl topics update <topic-name> <partition-num>

OUTPUT:
    #normal output
    Update topic <topic-name> with <partition-num> partitions successfully

    #the topic name and(or) the partitions is not specified
    [✖]  need to specified the topic name and the partitions

    #the partitions number is invalid
    [✖]  invalid partition number '<number>'

    #the topic is not exist
    [✖]  code: 409 reason: Topic is not partitioned topic

    #the topic name is not in the format of <tenant>/<namespace>/<topic> or <topic>
    [✖]  Invalid short topic name '<topic-name>', it should be in the format of <tenant>/<namespace>/<topic> or <topic>

    #the topic name is not in the format of <domain>://<tenant>/<namespace>/<topic>
    [✖]  Invalid complete topic name '<topic-name>', it should be in the format of <domain>://<tenant>/<namespace>/<topic>

    #the topic name is not in the format of <tenant>/<namespace>/<topic>
    [✖]  Invalid topic name '<topic-name>', it should be in the format of<tenant>/<namespace>/<topic>

    #the namespace name is not in the format of <tenant>/<namespace>
    [✖]  The complete name of namespace is invalid. complete name : <namespace-complete-name>

    #the tenant name and(or) namespace name is empty
    [✖]  Invalid tenant or namespace. [<tenant>/<namespace>]

    #the tenant name contains unsupported special chars. the alphanumeric (a-zA-Z0-9) and the special chars (-=:.%)  is allowed
    [✖]  Tenant name include unsupported special chars. tenant : [<namespace>]

    #the namespace name contains unsupported special chars. the  alphanumeric (a-zA-Z0-9) and the special chars (-=:.%) is allowed
    [✖]  Namespace name include unsupported special chars. namespace : [<namespace>]

Usage: pulsarctl topics update [flags]

Aliases: update, up
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants