Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add restart, list and get cmd for Pulsar Functions #30

Merged
merged 11 commits into from
Sep 4, 2019

Conversation

wolfstudy
Copy link
Contributor

@wolfstudy wolfstudy commented Sep 3, 2019

Add restart cmd for Pulsar Functions

USED FOR:
    This command is used for restarting function instance.

REQUIRED PERMISSION:
    This command requires super-user permissions.

EXAMPLES:
    #Restart function instance
    pulsarctl functions restart
	--tenant public
	--namespace default
	--name <the name of Pulsar Function>

    #Restart function instance with instance ID
    pulsarctl functions restart
	--tenant public
	--namespace default
	--name <the name of Pulsar Function>
	--instance-id 1

    #Restart function instance with FQFN
    pulsarctl functions restart
	--fqfn tenant/namespace/name [eg: public/default/ExampleFunctions]

OUTPUT:
    #normal output
    Restarted successfully

    #You must specify a name for the Pulsar Functions or a FQFN, please check the --name args
    [✖]  you must specify a name for the function or a Fully Qualified Function Name (FQFN)

    #The name of Pulsar Functions doesn't exist, please check the --name args
    [✖]  code: 404 reason: Function <your function name> doesn't exist

    #Used an instanceID that does not exist or other impermissible actions
    [✖]  code: 400 reason: Operation not permitted

Usage: pulsarctl functions restart [flags]

Aliases: restart, restart

List command as follows:

USED FOR:
    List all Pulsar Functions running under a specific tenant and namespace.

REQUIRED PERMISSION:
    This command requires super-user permissions.

EXAMPLES:
    #List all Pulsar Functions running under a specific tenant and namespace
    pulsarctl functions list
	--tenant public
	--namespace default

OUTPUT:
    #normal output
    +--------------------+
    |   Function Name    |
    +--------------------+
    | test_function_name |
    +--------------------+

Usage: pulsarctl functions list [flags]

Aliases: list, list

FunctionsConfig flags:
      --tenant string      The tenant of a Pulsar Function
      --namespace string   The namespace of a Pulsar Function

Get command as follows:

USED FOR:
    Fetch information about a Pulsar Function

REQUIRED PERMISSION:
    This command requires super-user permissions.

EXAMPLES:
    #Fetch information about a Pulsar Function
    pulsarctl functions get
	--tenant public
	--namespace default
	--name <the name of Pulsar Function>

    #Fetch information about a Pulsar Function with FQFN
    pulsarctl functions get
	--fqfn tenant/namespace/name [eg: public/default/ExampleFunctions]

OUTPUT:
    #normal output
    {
      "tenant": "public",
      "namespace": "default",
      "name": "test-functions",
      "className": "org.apache.pulsar.functions.api.examples.ExclamationFunction",
      "inputSpecs": {
        "persistent://public/default/test-topic-1": {
          "isRegexPattern": false
        }
      },
      "output": "persistent://public/default/test-topic-2",
      "processingGuarantees": "ATLEAST_ONCE",
      "retainOrdering": false,
      "userConfig": {},
      "runtime": "JAVA",
      "autoAck": true,
      "parallelism": 1,
      "resources": {
        "cpu": 1.0,
        "ram": 1073741824,
        "disk": 10737418240
      },
      "cleanupSubscription": true
    }

    #You must specify a name for the Pulsar Functions or a FQFN, please check the --name args
    [✖]  you must specify a name for the function or a Fully Qualified Function Name (FQFN)

    #The name of Pulsar Functions doesn't exist, please check the --name args
    [✖]  code: 404 reason: Function <your function name> doesn't exist

Usage: pulsarctl functions get [flags]

Aliases: get, get

FunctionsConfig flags:
      --fqfn string        The Fully Qualified Function Name (FQFN) for the function
      --tenant string      The tenant of a Pulsar Function
      --namespace string   The namespace of a Pulsar Function
      --name string        The name of a Pulsar Function

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
@wolfstudy wolfstudy self-assigned this Sep 3, 2019
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
@sijie sijie mentioned this pull request Sep 4, 2019
29 tasks
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
@wolfstudy wolfstudy changed the title [WIP] Add restart cmd for Pulsar Functions Add restart, list and get cmd for Pulsar Functions Sep 4, 2019
@wolfstudy
Copy link
Contributor Author

@sijie @zymap PTAL

@wolfstudy wolfstudy merged commit 46dba74 into master Sep 4, 2019
@wolfstudy wolfstudy deleted the xiaolong/restart-pulsar-functions branch September 4, 2019 07:42
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
…arctl#30)

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add restart cmd for Pulsar Functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add list cmd for Pulsar Functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add get cmd for Pulsar functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
tisonkun pushed a commit to apache/pulsar-client-go that referenced this pull request Aug 16, 2023
…arctl#30)

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add restart cmd for Pulsar Functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add list cmd for Pulsar Functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>

* Add get cmd for Pulsar functions

Signed-off-by: xiaolong.ran <ranxiaolong716@gmail.com>
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