From 1520b95220231484a41cc9e04366c86c66046a6c Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Tue, 15 Oct 2024 12:15:31 -0700 Subject: [PATCH 01/10] update nexus commands.yml for docs gen Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 157 ++++++++++++++------------- 1 file changed, 83 insertions(+), 74 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index f6774b770..2a059ba00 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -147,7 +147,7 @@ commands: type: string description: | Path to environment settings file. - (defaults to `$HOME/.config/temporalio/temporal.yaml`). + Defaults to `$HOME/.config/temporalio/temporal.yaml`. - name: log-level type: string-enum enum-values: @@ -194,7 +194,7 @@ commands: default: auto - name: no-json-shorthand-payloads type: bool - description: Raw payload output, even if they are JSON. + description: Raw payload output, even if the JSON option was used. - name: command-timeout type: duration description: Timeout for the span of a command. @@ -542,7 +542,7 @@ commands: docs: description-header: >- Operator commands in Temporal allow actions on Namespaces, Search Attributes, - and Clusters using specific subcommands. Execute with + Clusters and Nexus Endpoints using specific subcommands. Execute with "temporal operator [command] [subcommand] [options]". keywords: - cli reference @@ -558,6 +558,13 @@ commands: - namespace delete - namespace describe - namespace list + - nexus + - nexus endpoint + - nexus endpoint create + - nexus endpoint delete + - nexus endpoint get + - nexus endpoint list + - nexus endpoint update - operator - search attribute - search attribute create @@ -737,7 +744,7 @@ commands: description: | Namespace data as `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey={"your": "value"}'. + For example: `'YourKey={"your": "value"}'`. Can be passed multiple times. - name: description type: string @@ -877,7 +884,7 @@ commands: description: | Namespace data as `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey={"your": "value"}'. + For example: `'YourKey={"your": "value"}'`. Can be passed multiple times. - name: description type: string @@ -917,29 +924,29 @@ commands: - name: temporal operator nexus summary: Commands for managing Nexus resources (EXPERIMENTAL) description: | - Nexus commands enable managing Nexus resources. + These commands manage Nexus resources. - Nexus commands follow this syntax: + nexus commands follow this syntax: ``` - temporal operator nexus [command] [command] [command options] + temporal operator nexus [command] [subcommand] [options] ``` - name: temporal operator nexus endpoint summary: Commands for managing Nexus Endpoints (EXPERIMENTAL) description: | - Endpoint commands enable managing Nexus Endpoints. + These commands manage Nexus Endpoints. - Endpoint commands follow this syntax: + Nexus Endpoint commands follow this syntax: ``` - temporal operator nexus endpoint [command] [command options] + temporal operator nexus endpoint [command] [options] ``` - name: temporal operator nexus endpoint create - summary: Create a new Nexus Endpoint (EXPERIMENTAL) + summary: Create a Nexus Endpoint (EXPERIMENTAL) description: | - Create a new Nexus Endpoint on the Server. + Create a Nexus Endpoint on the Server. An endpoint name is used in workflow code to invoke Nexus operations. The endpoint target may either be a worker, in which case `--target-namespace` and @@ -955,61 +962,35 @@ commands: --target-task-queue your-task-queue \ --description-file DESCRIPTION.md ``` - options: - - name: name - type: string - description: Endpoint name. - required: true - - name: description - type: string - description: | - Endpoint description in markdown format (encoded using the configured codec server). - - name: description-file - type: string - description: | - Endpoint description file in markdown format (encoded using the configured codec server). - - name: target-namespace - type: string - description: Namespace in which a handler worker will be polling for Nexus tasks on. - - name: target-task-queue - type: string - description: Task Queue in which a handler worker will be polling for Nexus tasks on. - - name: target-url - type: string - description: URL to direct Nexus requests to. - + option-sets: + - nexus-endpoint-identity + - nexus-endpoint-config - name: temporal operator nexus endpoint delete summary: Delete a Nexus Endpoint (EXPERIMENTAL) description: | - Delete a Nexus Endpoint configuration from the Server. + Delete a Nexus Endpoint from the Server. ``` temporal operator nexus endpoint delete --name your-endpoint ``` - options: - - name: name - type: string - description: Endpoint name. - required: true + option-sets: + - nexus-endpoint-identity - name: temporal operator nexus endpoint get summary: Get a Nexus Endpoint by name (EXPERIMENTAL) description: | - Get a Nexus Endpoint configuration by name from the Server. + Get a Nexus Endpoint by name from the Server. ``` temporal operator nexus endpoint get --name your-endpoint ``` - options: - - name: name - type: string - description: Endpoint name. - required: true + option-sets: + - nexus-endpoint-identity - name: temporal operator nexus endpoint list summary: List Nexus Endpoints (EXPERIMENTAL) description: | - List all Nexus Endpoint configurations on the Server. + List all Nexus Endpoints on the Server. ``` temporal operator nexus endpoint list @@ -1043,31 +1024,13 @@ commands: --name your-endpoint \ --description-file DESCRIPTION.md ``` + option-sets: + - nexus-endpoint-identity + - nexus-endpoint-config options: - - name: name - type: string - description: Endpoint name. - required: true - - name: description - type: string - description: | - Endpoint description in markdown format (encoded using the configured codec server). - - name: description-file - type: string - description: | - Endpoint description file in markdown format (encoded using the configured codec server). - name: unset-description type: bool description: Unset the description. - - name: target-namespace - type: string - description: Namespace in which a handler worker will be polling for Nexus tasks on. - - name: target-task-queue - type: string - description: Task Queue in which a handler worker will be polling for Nexus tasks on. - - name: target-url - type: string - description: URL to direct Nexus requests to. - name: temporal operator search-attribute summary: Search Attribute operations @@ -1555,7 +1518,7 @@ commands: description: | Dynamic configuration value using `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey="YourString"'. + For example: `'YourKey="YourString"'`. Can be passed multiple times. - name: log-config type: bool @@ -2524,6 +2487,7 @@ commands: description: Content for an SQL-like `QUERY` List Filter. - name: archived type: bool + experimental: true description: Limit output to archived Workflow Executions. - name: limit type: int @@ -2953,6 +2917,7 @@ commands: option-sets: - name: client + description: Commands that connect to a Temporal Service options: - name: address type: string @@ -3035,6 +3000,7 @@ option-sets: env: TEMPORAL_CODEC_AUTH - name: overlap-policy + description: Schedule commands options: - name: overlap-policy type: string-enum @@ -3049,6 +3015,7 @@ option-sets: default: Skip - name: schedule-id + description: Schedule commands options: - name: schedule-id type: string @@ -3057,6 +3024,7 @@ option-sets: short: s - name: schedule-configuration + description: Schedule commands options: - name: calendar type: string[] @@ -3112,17 +3080,18 @@ option-sets: description: | Set schedule Search Attributes using `KEY="VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey={"your": "value"}'. + For example: `'YourKey={"your": "value"}'`. Can be passed multiple times. - name: schedule-memo type: string[] description: | Set schedule memo using `KEY="VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey={"your": "value"}'. + For example: `'YourKey={"your": "value"}'`. Can be passed multiple times. - name: workflow-reference + description: Commands that reference a Workflow options: - name: workflow-id type: string @@ -3135,6 +3104,7 @@ option-sets: description: Run ID. - name: single-workflow-or-batch + description: Commands that may use a Batch Job options: - name: workflow-id type: string @@ -3174,6 +3144,7 @@ option-sets: Only allowed if query is present. - name: shared-workflow-start + description: Commands that start a workflow options: - name: workflow-id type: string @@ -3212,7 +3183,7 @@ option-sets: description: | Search Attribute in `KEY=VALUE` format. Keys must be identifiers, and values must be JSON values. - For example: 'YourKey={"your": "value"}'. + For example: `'YourKey={"your": "value"}'`. Can be passed multiple times. - name: memo type: string[] @@ -3221,6 +3192,7 @@ option-sets: Use JSON values. - name: workflow-start + description: Commands that start a workflow options: - name: cron type: string @@ -3256,6 +3228,7 @@ option-sets: - UseExisting - TerminateExisting - name: payload-input + description: Commands accepting an input payload options: - name: input type: string[] @@ -3284,6 +3257,7 @@ option-sets: Assume inputs are base64-encoded and attempt to decode them. - name: update-starting + description: Workflow update commands options: - name: name type: string @@ -3315,6 +3289,7 @@ option-sets: If unset, looks for an Update against the currently-running Workflow Execution. - name: update-targeting + description: Workflow update commands options: - name: workflow-id short: w @@ -3333,3 +3308,37 @@ option-sets: description: | Run ID. If unset, updates the currently-running Workflow Execution. + + - name: nexus-endpoint-identity + description: Nexus endpoint commands + options: + - name: name + type: string + description: Endpoint name. + required: true + + - name: nexus-endpoint-config + description: Nexus endpoint commands + options: + - name: description + type: string + description: | + Nexus Endpoint description. + You may use Markdown formatting in the description. + - name: description-file + type: string + description: | + Path to the Nexus Endpoint description file. + Contents of the description file may use Markdown formatting. + - name: target-namespace + type: string + description: Namespace in which a handler Worker will be poll for Nexus tasks. + - name: target-task-queue + type: string + description: Task Queue in which a handler Worker will poll for Nexus tasks. + - name: target-url + type: string + experimental: true + description: | + An external Nexus Endpoint where Nexus requests are forwarded to. + May be used as an alternative to `--target-namespace` and `--target-task-queue`. From 3dc7afec30fbff1517c4d63ff65f443e7b8147ec Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Tue, 15 Oct 2024 14:09:44 -0700 Subject: [PATCH 02/10] cleanup Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index 2a059ba00..c63017fb1 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -195,9 +195,10 @@ commands: - name: no-json-shorthand-payloads type: bool description: Raw payload output, even if the JSON option was used. - - name: command-timeout - type: duration - description: Timeout for the span of a command. + # not yet supported + #- name: command-timeout + # type: duration + # description: Timeout for the span of a command. - name: temporal activity summary: Complete or fail an Activity @@ -948,8 +949,8 @@ commands: description: | Create a Nexus Endpoint on the Server. - An endpoint name is used in workflow code to invoke Nexus operations. The - endpoint target may either be a worker, in which case `--target-namespace` and + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The + endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. @@ -1001,8 +1002,8 @@ commands: description: | Update an existing Nexus Endpoint on the Server. - An endpoint name is used in workflow code to invoke Nexus operations. The - endpoint target may either be a worker, in which case `--target-namespace` and + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The + endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. @@ -3324,15 +3325,15 @@ option-sets: type: string description: | Nexus Endpoint description. - You may use Markdown formatting in the description. + You may use Markdown formatting in the Nexus Endpoint description. - name: description-file type: string description: | Path to the Nexus Endpoint description file. - Contents of the description file may use Markdown formatting. + The contents of the description file may use Markdown formatting. - name: target-namespace type: string - description: Namespace in which a handler Worker will be poll for Nexus tasks. + description: Namespace in which a handler Worker will poll for Nexus tasks. - name: target-task-queue type: string description: Task Queue in which a handler Worker will poll for Nexus tasks. From 364d118dd60917794afd12505a4cc055fc185e66 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Tue, 15 Oct 2024 14:24:37 -0700 Subject: [PATCH 03/10] restore --command-timeout in commands.yml Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index c63017fb1..1d5f9a27b 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -195,10 +195,9 @@ commands: - name: no-json-shorthand-payloads type: bool description: Raw payload output, even if the JSON option was used. - # not yet supported - #- name: command-timeout - # type: duration - # description: Timeout for the span of a command. + - name: command-timeout + type: duration + description: Timeout for the span of a command. - name: temporal activity summary: Complete or fail an Activity From d59264b7766bdfaf5f3c182e087637fe98351e2d Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 10:03:59 -0700 Subject: [PATCH 04/10] update commands.yml per docs feedback Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index 1d5f9a27b..c15aeb078 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -926,7 +926,7 @@ commands: description: | These commands manage Nexus resources. - nexus commands follow this syntax: + Nexus commands follow this syntax: ``` temporal operator nexus [command] [subcommand] [options] @@ -948,10 +948,8 @@ commands: description: | Create a Nexus Endpoint on the Server. - A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The - endpoint target may either be a Worker, in which case `--target-namespace` and - `--target-task-queue` must both be provided, or an external URL, in which case - `--target-url` must be provided. + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. + The endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. This command will fail if an endpoint with the same name is already registered. @@ -1001,10 +999,8 @@ commands: description: | Update an existing Nexus Endpoint on the Server. - A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The - endpoint target may either be a Worker, in which case `--target-namespace` and - `--target-task-queue` must both be provided, or an external URL, in which case - `--target-url` must be provided. + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. + The endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. The endpoint is patched; existing fields for which flags are not provided are left as they were. From 25323535586ea40369c83e384feb4cf4427ddf42 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 12:17:33 -0700 Subject: [PATCH 05/10] address feedback Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index c15aeb078..06997d9dc 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -951,7 +951,7 @@ commands: A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. - This command will fail if an endpoint with the same name is already registered. + This command will fail if an Endpoint with the same name is already registered. ``` temporal operator nexus endpoint create \ @@ -1000,10 +1000,9 @@ commands: Update an existing Nexus Endpoint on the Server. A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. - The endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. + The Endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. - The endpoint is patched; existing fields for which flags are not provided are - left as they were. + The Endpoint is patched; existing fields for which flags are not provided are left as they were. Update only the target task queue: @@ -2996,7 +2995,6 @@ option-sets: env: TEMPORAL_CODEC_AUTH - name: overlap-policy - description: Schedule commands options: - name: overlap-policy type: string-enum @@ -3011,7 +3009,6 @@ option-sets: default: Skip - name: schedule-id - description: Schedule commands options: - name: schedule-id type: string @@ -3020,7 +3017,6 @@ option-sets: short: s - name: schedule-configuration - description: Schedule commands options: - name: calendar type: string[] @@ -3087,7 +3083,6 @@ option-sets: Can be passed multiple times. - name: workflow-reference - description: Commands that reference a Workflow options: - name: workflow-id type: string @@ -3100,7 +3095,6 @@ option-sets: description: Run ID. - name: single-workflow-or-batch - description: Commands that may use a Batch Job options: - name: workflow-id type: string @@ -3140,7 +3134,6 @@ option-sets: Only allowed if query is present. - name: shared-workflow-start - description: Commands that start a workflow options: - name: workflow-id type: string @@ -3188,7 +3181,6 @@ option-sets: Use JSON values. - name: workflow-start - description: Commands that start a workflow options: - name: cron type: string @@ -3224,7 +3216,6 @@ option-sets: - UseExisting - TerminateExisting - name: payload-input - description: Commands accepting an input payload options: - name: input type: string[] @@ -3253,7 +3244,6 @@ option-sets: Assume inputs are base64-encoded and attempt to decode them. - name: update-starting - description: Workflow update commands options: - name: name type: string @@ -3285,7 +3275,6 @@ option-sets: If unset, looks for an Update against the currently-running Workflow Execution. - name: update-targeting - description: Workflow update commands options: - name: workflow-id short: w @@ -3306,7 +3295,6 @@ option-sets: If unset, updates the currently-running Workflow Execution. - name: nexus-endpoint-identity - description: Nexus endpoint commands options: - name: name type: string @@ -3314,7 +3302,6 @@ option-sets: required: true - name: nexus-endpoint-config - description: Nexus endpoint commands options: - name: description type: string @@ -3328,13 +3315,13 @@ option-sets: The contents of the description file may use Markdown formatting. - name: target-namespace type: string - description: Namespace in which a handler Worker will poll for Nexus tasks. + description: Namespace where a handler Worker polls for Nexus tasks. - name: target-task-queue type: string - description: Task Queue in which a handler Worker will poll for Nexus tasks. + description: Task Queue that a handler Worker polls for Nexus tasks. - name: target-url type: string experimental: true description: | - An external Nexus Endpoint where Nexus requests are forwarded to. + An external Nexus Endpoint that receives forwarded Nexus requests. May be used as an alternative to `--target-namespace` and `--target-task-queue`. From c385df828c1ca28c0a4089e3de14ce3f3c5abbb9 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 12:46:46 -0700 Subject: [PATCH 06/10] reverting to 80 char width Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index 06997d9dc..c40913dda 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -541,9 +541,9 @@ commands: - client docs: description-header: >- - Operator commands in Temporal allow actions on Namespaces, Search Attributes, - Clusters and Nexus Endpoints using specific subcommands. Execute with - "temporal operator [command] [subcommand] [options]". + Operator commands in Temporal allow actions on Namespaces, Search + Attributes, Clusters and Nexus Endpoints using specific subcommands. + Execute with "temporal operator [command] [subcommand] [options]". keywords: - cli reference - cluster @@ -949,9 +949,12 @@ commands: Create a Nexus Endpoint on the Server. A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. - The endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. - - This command will fail if an Endpoint with the same name is already registered. + The endpoint target may either be a Worker, in which case + `--target-namespace` and `--target-task-queue` must both be provided, or + an external URL, in which case `--target-url` must be provided. + + This command will fail if an Endpoint with the same name is already + registered. ``` temporal operator nexus endpoint create \ @@ -998,11 +1001,14 @@ commands: summary: Update an existing Nexus Endpoint (EXPERIMENTAL) description: | Update an existing Nexus Endpoint on the Server. - + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. - The Endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or an external URL, in which case `--target-url` must be provided. - - The Endpoint is patched; existing fields for which flags are not provided are left as they were. + The Endpoint target may either be a Worker, in which case + `--target-namespace` and `--target-task-queue` must both be provided, or + an external URL, in which case `--target-url` must be provided. + + The Endpoint is patched; existing fields for which flags are not provided + are left as they were. Update only the target task queue: @@ -3324,4 +3330,5 @@ option-sets: experimental: true description: | An external Nexus Endpoint that receives forwarded Nexus requests. - May be used as an alternative to `--target-namespace` and `--target-task-queue`. + May be used as an alternative to `--target-namespace` and + `--target-task-queue`. \ No newline at end of file From a21908de2e60b9240145d34c40401a9e8394a0fa Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 12:49:00 -0700 Subject: [PATCH 07/10] remove whitespace Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index c40913dda..53110ff79 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -1001,7 +1001,7 @@ commands: summary: Update an existing Nexus Endpoint (EXPERIMENTAL) description: | Update an existing Nexus Endpoint on the Server. - + A Nexus Endpoint name is used in Workflow code to invoke Nexus Operations. The Endpoint target may either be a Worker, in which case `--target-namespace` and `--target-task-queue` must both be provided, or From fe2c67b58e7c8e80923d6525dfc39b747da8cb69 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 13:00:53 -0700 Subject: [PATCH 08/10] adjust formatting Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index 53110ff79..1968068e8 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -744,7 +744,7 @@ commands: description: | Namespace data as `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey={"your": "value"}'`. + For example: 'YourKey={"your": "value"}'. Can be passed multiple times. - name: description type: string @@ -884,7 +884,7 @@ commands: description: | Namespace data as `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey={"your": "value"}'`. + For example: 'YourKey={"your": "value"}'. Can be passed multiple times. - name: description type: string @@ -1519,7 +1519,7 @@ commands: description: | Dynamic configuration value using `KEY=VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey="YourString"'`. + For example: 'YourKey="YourString"'. Can be passed multiple times. - name: log-config type: bool @@ -3078,14 +3078,14 @@ option-sets: description: | Set schedule Search Attributes using `KEY="VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey={"your": "value"}'`. + For example: 'YourKey={"your": "value"}'. Can be passed multiple times. - name: schedule-memo type: string[] description: | Set schedule memo using `KEY="VALUE` pairs. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey={"your": "value"}'`. + For example: 'YourKey={"your": "value"}'. Can be passed multiple times. - name: workflow-reference @@ -3178,7 +3178,7 @@ option-sets: description: | Search Attribute in `KEY=VALUE` format. Keys must be identifiers, and values must be JSON values. - For example: `'YourKey={"your": "value"}'`. + For example: 'YourKey={"your": "value"}'. Can be passed multiple times. - name: memo type: string[] From f92fe453256d4982ac85c4f4a784929cb0cad84f Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 13:18:43 -0700 Subject: [PATCH 09/10] updated commands.gen.go Signed-off-by: Phil Prasek --- temporalcli/commands.gen.go | 111 +++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/temporalcli/commands.gen.go b/temporalcli/commands.gen.go index 81c6cd9d4..a56d6d3cd 100644 --- a/temporalcli/commands.gen.go +++ b/temporalcli/commands.gen.go @@ -241,6 +241,31 @@ func (v *UpdateTargetingOptions) buildFlags(cctx *CommandContext, f *pflag.FlagS f.StringVarP(&v.RunId, "run-id", "r", "", "Run ID. If unset, updates the currently-running Workflow Execution.") } +type NexusEndpointIdentityOptions struct { + Name string +} + +func (v *NexusEndpointIdentityOptions) buildFlags(cctx *CommandContext, f *pflag.FlagSet) { + f.StringVar(&v.Name, "name", "", "Endpoint name. Required.") + _ = cobra.MarkFlagRequired(f, "name") +} + +type NexusEndpointConfigOptions struct { + Description string + DescriptionFile string + TargetNamespace string + TargetTaskQueue string + TargetUrl string +} + +func (v *NexusEndpointConfigOptions) buildFlags(cctx *CommandContext, f *pflag.FlagSet) { + f.StringVar(&v.Description, "description", "", "Nexus Endpoint description. You may use Markdown formatting in the Nexus Endpoint description.") + f.StringVar(&v.DescriptionFile, "description-file", "", "Path to the Nexus Endpoint description file. The contents of the description file may use Markdown formatting.") + f.StringVar(&v.TargetNamespace, "target-namespace", "", "Namespace where a handler Worker polls for Nexus tasks.") + f.StringVar(&v.TargetTaskQueue, "target-task-queue", "", "Task Queue that a handler Worker polls for Nexus tasks.") + f.StringVar(&v.TargetUrl, "target-url", "", "An external Nexus Endpoint that receives forwarded Nexus requests. May be used as an alternative to `--target-namespace` and `--target-task-queue`.") +} + type TemporalCommand struct { Command cobra.Command Env string @@ -274,7 +299,7 @@ func NewTemporalCommand(cctx *CommandContext) *TemporalCommand { s.Command.AddCommand(&NewTemporalWorkflowCommand(cctx, &s).Command) s.Command.PersistentFlags().StringVar(&s.Env, "env", "default", "Active environment name (`ENV`).") cctx.BindFlagEnvVar(s.Command.PersistentFlags().Lookup("env"), "TEMPORAL_ENV") - s.Command.PersistentFlags().StringVar(&s.EnvFile, "env-file", "", "Path to environment settings file. (defaults to `$HOME/.config/temporalio/temporal.yaml`).") + s.Command.PersistentFlags().StringVar(&s.EnvFile, "env-file", "", "Path to environment settings file. Defaults to `$HOME/.config/temporalio/temporal.yaml`.") s.LogLevel = NewStringEnum([]string{"debug", "info", "warn", "error", "never"}, "info") s.Command.PersistentFlags().Var(&s.LogLevel, "log-level", "Log level. Default is \"info\" for most commands and \"warn\" for `server start-dev`. Accepted values: debug, info, warn, error, never.") s.Command.PersistentFlags().StringVar(&s.LogFormat, "log-format", "text", "Log format. Options are: text, json.") @@ -284,7 +309,7 @@ func NewTemporalCommand(cctx *CommandContext) *TemporalCommand { s.Command.PersistentFlags().Var(&s.TimeFormat, "time-format", "Time format. Accepted values: relative, iso, raw.") s.Color = NewStringEnum([]string{"always", "never", "auto"}, "auto") s.Command.PersistentFlags().Var(&s.Color, "color", "Output coloring. Accepted values: always, never, auto.") - s.Command.PersistentFlags().BoolVar(&s.NoJsonShorthandPayloads, "no-json-shorthand-payloads", false, "Raw payload output, even if they are JSON.") + s.Command.PersistentFlags().BoolVar(&s.NoJsonShorthandPayloads, "no-json-shorthand-payloads", false, "Raw payload output, even if the JSON option was used.") s.CommandTimeout = 0 s.Command.PersistentFlags().Var(&s.CommandTimeout, "command-timeout", "Timeout for the span of a command.") s.initCommand(cctx) @@ -1052,9 +1077,9 @@ func NewTemporalOperatorNexusCommand(cctx *CommandContext, parent *TemporalOpera s.Command.Use = "nexus" s.Command.Short = "Commands for managing Nexus resources (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Nexus commands enable managing Nexus resources.\n\nNexus commands follow this syntax:\n\n\x1b[1mtemporal operator nexus [command] [command] [command options]\x1b[0m" + s.Command.Long = "These commands manage Nexus resources.\n\nNexus commands follow this syntax:\n\n\x1b[1mtemporal operator nexus [command] [subcommand] [options]\x1b[0m" } else { - s.Command.Long = "Nexus commands enable managing Nexus resources.\n\nNexus commands follow this syntax:\n\n```\ntemporal operator nexus [command] [command] [command options]\n```" + s.Command.Long = "These commands manage Nexus resources.\n\nNexus commands follow this syntax:\n\n```\ntemporal operator nexus [command] [subcommand] [options]\n```" } s.Command.Args = cobra.NoArgs s.Command.AddCommand(&NewTemporalOperatorNexusEndpointCommand(cctx, &s).Command) @@ -1072,9 +1097,9 @@ func NewTemporalOperatorNexusEndpointCommand(cctx *CommandContext, parent *Tempo s.Command.Use = "endpoint" s.Command.Short = "Commands for managing Nexus Endpoints (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Endpoint commands enable managing Nexus Endpoints.\n\nEndpoint commands follow this syntax:\n\n\x1b[1mtemporal operator nexus endpoint [command] [command options]\x1b[0m" + s.Command.Long = "These commands manage Nexus Endpoints.\n\nNexus Endpoint commands follow this syntax:\n\n\x1b[1mtemporal operator nexus endpoint [command] [options]\x1b[0m" } else { - s.Command.Long = "Endpoint commands enable managing Nexus Endpoints.\n\nEndpoint commands follow this syntax:\n\n```\ntemporal operator nexus endpoint [command] [command options]\n```" + s.Command.Long = "These commands manage Nexus Endpoints.\n\nNexus Endpoint commands follow this syntax:\n\n```\ntemporal operator nexus endpoint [command] [options]\n```" } s.Command.Args = cobra.NoArgs s.Command.AddCommand(&NewTemporalOperatorNexusEndpointCreateCommand(cctx, &s).Command) @@ -1086,14 +1111,10 @@ func NewTemporalOperatorNexusEndpointCommand(cctx *CommandContext, parent *Tempo } type TemporalOperatorNexusEndpointCreateCommand struct { - Parent *TemporalOperatorNexusEndpointCommand - Command cobra.Command - Name string - Description string - DescriptionFile string - TargetNamespace string - TargetTaskQueue string - TargetUrl string + Parent *TemporalOperatorNexusEndpointCommand + Command cobra.Command + NexusEndpointIdentityOptions + NexusEndpointConfigOptions } func NewTemporalOperatorNexusEndpointCreateCommand(cctx *CommandContext, parent *TemporalOperatorNexusEndpointCommand) *TemporalOperatorNexusEndpointCreateCommand { @@ -1101,20 +1122,15 @@ func NewTemporalOperatorNexusEndpointCreateCommand(cctx *CommandContext, parent s.Parent = parent s.Command.DisableFlagsInUseLine = true s.Command.Use = "create [flags]" - s.Command.Short = "Create a new Nexus Endpoint (EXPERIMENTAL)" + s.Command.Short = "Create a Nexus Endpoint (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Create a new Nexus Endpoint on the Server.\n\nAn endpoint name is used in workflow code to invoke Nexus operations. The\nendpoint target may either be a worker, in which case \x1b[1m--target-namespace\x1b[0m and\n\x1b[1m--target-task-queue\x1b[0m must both be provided, or an external URL, in which case\n\x1b[1m--target-url\x1b[0m must be provided.\n\nThis command will fail if an endpoint with the same name is already registered.\n\n\x1b[1mtemporal operator nexus endpoint create \\\n --name your-endpoint \\\n --target-namespace your-namespace \\\n --target-task-queue your-task-queue \\\n --description-file DESCRIPTION.md\x1b[0m" + s.Command.Long = "Create a Nexus Endpoint on the Server.\n\nA Nexus Endpoint name is used in Workflow code to invoke Nexus Operations.\nThe endpoint target may either be a Worker, in which case\n\x1b[1m--target-namespace\x1b[0m and \x1b[1m--target-task-queue\x1b[0m must both be provided, or\nan external URL, in which case \x1b[1m--target-url\x1b[0m must be provided.\n\nThis command will fail if an Endpoint with the same name is already\nregistered.\n\n\x1b[1mtemporal operator nexus endpoint create \\\n --name your-endpoint \\\n --target-namespace your-namespace \\\n --target-task-queue your-task-queue \\\n --description-file DESCRIPTION.md\x1b[0m" } else { - s.Command.Long = "Create a new Nexus Endpoint on the Server.\n\nAn endpoint name is used in workflow code to invoke Nexus operations. The\nendpoint target may either be a worker, in which case `--target-namespace` and\n`--target-task-queue` must both be provided, or an external URL, in which case\n`--target-url` must be provided.\n\nThis command will fail if an endpoint with the same name is already registered.\n\n```\ntemporal operator nexus endpoint create \\\n --name your-endpoint \\\n --target-namespace your-namespace \\\n --target-task-queue your-task-queue \\\n --description-file DESCRIPTION.md\n```" + s.Command.Long = "Create a Nexus Endpoint on the Server.\n\nA Nexus Endpoint name is used in Workflow code to invoke Nexus Operations.\nThe endpoint target may either be a Worker, in which case\n`--target-namespace` and `--target-task-queue` must both be provided, or\nan external URL, in which case `--target-url` must be provided.\n\nThis command will fail if an Endpoint with the same name is already\nregistered.\n\n```\ntemporal operator nexus endpoint create \\\n --name your-endpoint \\\n --target-namespace your-namespace \\\n --target-task-queue your-task-queue \\\n --description-file DESCRIPTION.md\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.Name, "name", "", "Endpoint name. Required.") - _ = cobra.MarkFlagRequired(s.Command.Flags(), "name") - s.Command.Flags().StringVar(&s.Description, "description", "", "Endpoint description in markdown format (encoded using the configured codec server).") - s.Command.Flags().StringVar(&s.DescriptionFile, "description-file", "", "Endpoint description file in markdown format (encoded using the configured codec server).") - s.Command.Flags().StringVar(&s.TargetNamespace, "target-namespace", "", "Namespace in which a handler worker will be polling for Nexus tasks on.") - s.Command.Flags().StringVar(&s.TargetTaskQueue, "target-task-queue", "", "Task Queue in which a handler worker will be polling for Nexus tasks on.") - s.Command.Flags().StringVar(&s.TargetUrl, "target-url", "", "URL to direct Nexus requests to.") + s.NexusEndpointIdentityOptions.buildFlags(cctx, s.Command.Flags()) + s.NexusEndpointConfigOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) @@ -1126,7 +1142,7 @@ func NewTemporalOperatorNexusEndpointCreateCommand(cctx *CommandContext, parent type TemporalOperatorNexusEndpointDeleteCommand struct { Parent *TemporalOperatorNexusEndpointCommand Command cobra.Command - Name string + NexusEndpointIdentityOptions } func NewTemporalOperatorNexusEndpointDeleteCommand(cctx *CommandContext, parent *TemporalOperatorNexusEndpointCommand) *TemporalOperatorNexusEndpointDeleteCommand { @@ -1136,13 +1152,12 @@ func NewTemporalOperatorNexusEndpointDeleteCommand(cctx *CommandContext, parent s.Command.Use = "delete [flags]" s.Command.Short = "Delete a Nexus Endpoint (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Delete a Nexus Endpoint configuration from the Server.\n\n\x1b[1mtemporal operator nexus endpoint delete --name your-endpoint\x1b[0m" + s.Command.Long = "Delete a Nexus Endpoint from the Server.\n\n\x1b[1mtemporal operator nexus endpoint delete --name your-endpoint\x1b[0m" } else { - s.Command.Long = "Delete a Nexus Endpoint configuration from the Server.\n\n```\ntemporal operator nexus endpoint delete --name your-endpoint\n```" + s.Command.Long = "Delete a Nexus Endpoint from the Server.\n\n```\ntemporal operator nexus endpoint delete --name your-endpoint\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.Name, "name", "", "Endpoint name. Required.") - _ = cobra.MarkFlagRequired(s.Command.Flags(), "name") + s.NexusEndpointIdentityOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) @@ -1154,7 +1169,7 @@ func NewTemporalOperatorNexusEndpointDeleteCommand(cctx *CommandContext, parent type TemporalOperatorNexusEndpointGetCommand struct { Parent *TemporalOperatorNexusEndpointCommand Command cobra.Command - Name string + NexusEndpointIdentityOptions } func NewTemporalOperatorNexusEndpointGetCommand(cctx *CommandContext, parent *TemporalOperatorNexusEndpointCommand) *TemporalOperatorNexusEndpointGetCommand { @@ -1164,13 +1179,12 @@ func NewTemporalOperatorNexusEndpointGetCommand(cctx *CommandContext, parent *Te s.Command.Use = "get [flags]" s.Command.Short = "Get a Nexus Endpoint by name (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Get a Nexus Endpoint configuration by name from the Server.\n\n\x1b[1mtemporal operator nexus endpoint get --name your-endpoint\x1b[0m" + s.Command.Long = "Get a Nexus Endpoint by name from the Server.\n\n\x1b[1mtemporal operator nexus endpoint get --name your-endpoint\x1b[0m" } else { - s.Command.Long = "Get a Nexus Endpoint configuration by name from the Server.\n\n```\ntemporal operator nexus endpoint get --name your-endpoint\n```" + s.Command.Long = "Get a Nexus Endpoint by name from the Server.\n\n```\ntemporal operator nexus endpoint get --name your-endpoint\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.Name, "name", "", "Endpoint name. Required.") - _ = cobra.MarkFlagRequired(s.Command.Flags(), "name") + s.NexusEndpointIdentityOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) @@ -1191,9 +1205,9 @@ func NewTemporalOperatorNexusEndpointListCommand(cctx *CommandContext, parent *T s.Command.Use = "list [flags]" s.Command.Short = "List Nexus Endpoints (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "List all Nexus Endpoint configurations on the Server.\n\n\x1b[1mtemporal operator nexus endpoint list\x1b[0m" + s.Command.Long = "List all Nexus Endpoints on the Server.\n\n\x1b[1mtemporal operator nexus endpoint list\x1b[0m" } else { - s.Command.Long = "List all Nexus Endpoint configurations on the Server.\n\n```\ntemporal operator nexus endpoint list\n```" + s.Command.Long = "List all Nexus Endpoints on the Server.\n\n```\ntemporal operator nexus endpoint list\n```" } s.Command.Args = cobra.NoArgs s.Command.Run = func(c *cobra.Command, args []string) { @@ -1205,15 +1219,11 @@ func NewTemporalOperatorNexusEndpointListCommand(cctx *CommandContext, parent *T } type TemporalOperatorNexusEndpointUpdateCommand struct { - Parent *TemporalOperatorNexusEndpointCommand - Command cobra.Command - Name string - Description string - DescriptionFile string + Parent *TemporalOperatorNexusEndpointCommand + Command cobra.Command + NexusEndpointIdentityOptions + NexusEndpointConfigOptions UnsetDescription bool - TargetNamespace string - TargetTaskQueue string - TargetUrl string } func NewTemporalOperatorNexusEndpointUpdateCommand(cctx *CommandContext, parent *TemporalOperatorNexusEndpointCommand) *TemporalOperatorNexusEndpointUpdateCommand { @@ -1223,19 +1233,14 @@ func NewTemporalOperatorNexusEndpointUpdateCommand(cctx *CommandContext, parent s.Command.Use = "update [flags]" s.Command.Short = "Update an existing Nexus Endpoint (EXPERIMENTAL)" if hasHighlighting { - s.Command.Long = "Update an existing Nexus Endpoint on the Server.\n\nAn endpoint name is used in workflow code to invoke Nexus operations. The\nendpoint target may either be a worker, in which case \x1b[1m--target-namespace\x1b[0m and\n\x1b[1m--target-task-queue\x1b[0m must both be provided, or an external URL, in which case\n\x1b[1m--target-url\x1b[0m must be provided.\n\nThe endpoint is patched; existing fields for which flags are not provided are\nleft as they were.\n\nUpdate only the target task queue:\n\n\x1b[1mtemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --target-task-queue your-other-queue\x1b[0m\n\nUpdate only the description:\n\n\x1b[1mtemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --description-file DESCRIPTION.md\x1b[0m" + s.Command.Long = "Update an existing Nexus Endpoint on the Server.\n\nA Nexus Endpoint name is used in Workflow code to invoke Nexus Operations.\nThe Endpoint target may either be a Worker, in which case\n\x1b[1m--target-namespace\x1b[0m and \x1b[1m--target-task-queue\x1b[0m must both be provided, or\nan external URL, in which case \x1b[1m--target-url\x1b[0m must be provided.\n\nThe Endpoint is patched; existing fields for which flags are not provided\nare left as they were.\n\nUpdate only the target task queue:\n\n\x1b[1mtemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --target-task-queue your-other-queue\x1b[0m\n\nUpdate only the description:\n\n\x1b[1mtemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --description-file DESCRIPTION.md\x1b[0m" } else { - s.Command.Long = "Update an existing Nexus Endpoint on the Server.\n\nAn endpoint name is used in workflow code to invoke Nexus operations. The\nendpoint target may either be a worker, in which case `--target-namespace` and\n`--target-task-queue` must both be provided, or an external URL, in which case\n`--target-url` must be provided.\n\nThe endpoint is patched; existing fields for which flags are not provided are\nleft as they were.\n\nUpdate only the target task queue:\n\n```\ntemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --target-task-queue your-other-queue\n```\n\nUpdate only the description:\n\n```\ntemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --description-file DESCRIPTION.md\n```" + s.Command.Long = "Update an existing Nexus Endpoint on the Server.\n\nA Nexus Endpoint name is used in Workflow code to invoke Nexus Operations.\nThe Endpoint target may either be a Worker, in which case\n`--target-namespace` and `--target-task-queue` must both be provided, or\nan external URL, in which case `--target-url` must be provided.\n\nThe Endpoint is patched; existing fields for which flags are not provided\nare left as they were.\n\nUpdate only the target task queue:\n\n```\ntemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --target-task-queue your-other-queue\n```\n\nUpdate only the description:\n\n```\ntemporal operator nexus endpoint update \\\n --name your-endpoint \\\n --description-file DESCRIPTION.md\n```" } s.Command.Args = cobra.NoArgs - s.Command.Flags().StringVar(&s.Name, "name", "", "Endpoint name. Required.") - _ = cobra.MarkFlagRequired(s.Command.Flags(), "name") - s.Command.Flags().StringVar(&s.Description, "description", "", "Endpoint description in markdown format (encoded using the configured codec server).") - s.Command.Flags().StringVar(&s.DescriptionFile, "description-file", "", "Endpoint description file in markdown format (encoded using the configured codec server).") s.Command.Flags().BoolVar(&s.UnsetDescription, "unset-description", false, "Unset the description.") - s.Command.Flags().StringVar(&s.TargetNamespace, "target-namespace", "", "Namespace in which a handler worker will be polling for Nexus tasks on.") - s.Command.Flags().StringVar(&s.TargetTaskQueue, "target-task-queue", "", "Task Queue in which a handler worker will be polling for Nexus tasks on.") - s.Command.Flags().StringVar(&s.TargetUrl, "target-url", "", "URL to direct Nexus requests to.") + s.NexusEndpointIdentityOptions.buildFlags(cctx, s.Command.Flags()) + s.NexusEndpointConfigOptions.buildFlags(cctx, s.Command.Flags()) s.Command.Run = func(c *cobra.Command, args []string) { if err := s.run(cctx, args); err != nil { cctx.Options.Fail(err) From 2279c28dafb218226f7b7f06db5fbd2b153c1d70 Mon Sep 17 00:00:00 2001 From: Phil Prasek Date: Wed, 16 Oct 2024 14:11:05 -0700 Subject: [PATCH 10/10] address feedback Signed-off-by: Phil Prasek --- temporalcli/commandsgen/commands.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/temporalcli/commandsgen/commands.yml b/temporalcli/commandsgen/commands.yml index 1968068e8..e03e572b0 100644 --- a/temporalcli/commandsgen/commands.yml +++ b/temporalcli/commandsgen/commands.yml @@ -2918,7 +2918,6 @@ commands: option-sets: - name: client - description: Commands that connect to a Temporal Service options: - name: address type: string