diff --git a/cmd/scw/testdata/test-all-usage-datalab-cluster-version-list-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-cluster-version-list-usage.golden new file mode 100644 index 0000000000..6c13dc9f06 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-cluster-version-list-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List datalab resources. + +USAGE: + scw datalab cluster-version list [arg=value ...] + +ARGS: + [order-by] The order by field. (name_asc | name_desc) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) + +FLAGS: + -h, --help help for list + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-datalab-cluster-version-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-cluster-version-usage.golden new file mode 100644 index 0000000000..7803af6458 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-cluster-version-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Lists the Spark versions available for Data Lab creation. + +USAGE: + scw datalab cluster-version + +AVAILABLE COMMANDS: + list List datalab resources + +FLAGS: + -h, --help help for cluster-version + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw datalab cluster-version [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-datalab-datalab-create-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-datalab-create-usage.golden index 83053ac58f..6fbeaa7308 100644 --- a/cmd/scw/testdata/test-all-usage-datalab-datalab-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-datalab-datalab-create-usage.golden @@ -13,11 +13,11 @@ ARGS: [main.node-type] [worker.node-type] [worker.node-count] - [has-notebook] Whether a JupyterLab notebook shall be created with the Data Lab or not. + [has-notebook] Select this option to include a notebook as part of the Data Lab. [spark-version] The version of Spark running inside the Data Lab, available options can be viewed at ListClusterVersions. [total-storage.type] (unknown_type | sbs_5k) [total-storage.size] - [private-network-id] The private network to which the Data Lab is connected. Important for accessing the Spark Master URL from a private cluster. + [private-network-id] The unique identifier of the private network the Data Lab will be attached to. [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) FLAGS: diff --git a/cmd/scw/testdata/test-all-usage-datalab-datalab-update-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-datalab-update-usage.golden index ba7065b64f..42614fe071 100644 --- a/cmd/scw/testdata/test-all-usage-datalab-datalab-update-usage.golden +++ b/cmd/scw/testdata/test-all-usage-datalab-datalab-update-usage.golden @@ -9,7 +9,7 @@ ARGS: datalab-id The unique identifier of the Data Lab. [name] The updated name of the Data Lab. [description] The updated description of the Data Lab. - [tags.{index}] The updated tags of the Data Lab + [tags.{index}] The updated tags of the Data Lab. [node-count] The updated node count of the Data Lab. Scale up or down the number of worker nodes. [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) diff --git a/cmd/scw/testdata/test-all-usage-datalab-datalab-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-datalab-usage.golden index 6a5e85700d..0865aa969c 100644 --- a/cmd/scw/testdata/test-all-usage-datalab-datalab-usage.golden +++ b/cmd/scw/testdata/test-all-usage-datalab-datalab-usage.golden @@ -1,6 +1,6 @@ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Manage your Datalab. +Manage your Data Labs. USAGE: scw datalab datalab diff --git a/cmd/scw/testdata/test-all-usage-datalab-node-type-list-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-node-type-list-usage.golden new file mode 100644 index 0000000000..ca243e2d15 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-node-type-list-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List datalab resources. + +USAGE: + scw datalab node-type list [arg=value ...] + +ARGS: + [order-by] The order by field. Available fields are `name_asc`, `name_desc`, `vcpus_asc`, `vcpus_desc`, `memory_gigabytes_asc`, `memory_gigabytes_desc`, `vram_bytes_asc`, `vram_bytes_desc`, `gpus_asc`, `gpus_desc`. (name_asc | name_desc | vcpus_asc | vcpus_desc | memory_gigabytes_asc | memory_gigabytes_desc | vram_bytes_asc | vram_bytes_desc | gpus_asc | gpus_desc) + [targets.{index}] Filter based on the target of the nodes. Allows to filter the nodes based on their purpose which can be main or worker node. (unknown_target | notebook | worker) + [resource-type] Filter based on node type ( `cpu`/`gpu`/`all` ). (all | gpu | cpu) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) + +FLAGS: + -h, --help help for list + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-datalab-node-type-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-node-type-usage.golden new file mode 100644 index 0000000000..dca7f03aa9 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-node-type-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List available node types. + +USAGE: + scw datalab node-type + +AVAILABLE COMMANDS: + list List datalab resources + +FLAGS: + -h, --help help for node-type + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw datalab node-type [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-datalab-notebook-version-list-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-notebook-version-list-usage.golden new file mode 100644 index 0000000000..35a2c59cd7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-notebook-version-list-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List datalab resources. + +USAGE: + scw datalab notebook-version list [arg=value ...] + +ARGS: + [order-by] The order by field. Available options are `name_asc` and `name_desc`. (name_asc | name_desc) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) + +FLAGS: + -h, --help help for list + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-datalab-notebook-version-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-notebook-version-usage.golden new file mode 100644 index 0000000000..ea0188a523 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-datalab-notebook-version-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List available notebook versions. + +USAGE: + scw datalab notebook-version + +AVAILABLE COMMANDS: + list List datalab resources + +FLAGS: + -h, --help help for notebook-version + --list-sub-commands List all subcommands + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw datalab notebook-version [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-datalab-usage.golden b/cmd/scw/testdata/test-all-usage-datalab-usage.golden index 4ca35f331e..beda4e51ec 100644 --- a/cmd/scw/testdata/test-all-usage-datalab-usage.golden +++ b/cmd/scw/testdata/test-all-usage-datalab-usage.golden @@ -6,10 +6,10 @@ USAGE: scw datalab AVAILABLE COMMANDS: - cluster-versions - datalab - node-types - notebook-versions + cluster-version + datalab + node-type + notebook-version FLAGS: -h, --help help for datalab diff --git a/docs/commands/datalab.md b/docs/commands/datalab.md index e2b44ef9f3..9ae9b0a501 100644 --- a/docs/commands/datalab.md +++ b/docs/commands/datalab.md @@ -28,7 +28,7 @@ List datalab resources. **Usage:** ``` -scw datalab cluster-versions list [arg=value ...] +scw datalab cluster-version list [arg=value ...] ``` @@ -43,7 +43,7 @@ scw datalab cluster-versions list [arg=value ...] ## -Manage your Datalab. +Manage your Data Labs. ### Create datalab resources @@ -68,11 +68,11 @@ scw datalab datalab create [arg=value ...] | main.node-type | | | | worker.node-type | | | | worker.node-count | | | -| has-notebook | | Whether a JupyterLab notebook shall be created with the Data Lab or not. | +| has-notebook | | Select this option to include a notebook as part of the Data Lab. | | spark-version | | The version of Spark running inside the Data Lab, available options can be viewed at ListClusterVersions. | | total-storage.type | One of: `unknown_type`, `sbs_5k` | | | total-storage.size | | | -| private-network-id | | The private network to which the Data Lab is connected. Important for accessing the Spark Master URL from a private cluster. | +| private-network-id | | The unique identifier of the private network the Data Lab will be attached to. | | region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | @@ -159,7 +159,7 @@ scw datalab datalab update [arg=value ...] | datalab-id | Required | The unique identifier of the Data Lab. | | name | | The updated name of the Data Lab. | | description | | The updated description of the Data Lab. | -| tags.{index} | | The updated tags of the Data Lab | +| tags.{index} | | The updated tags of the Data Lab. | | node-count | | The updated node count of the Data Lab. Scale up or down the number of worker nodes. | | region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | @@ -167,7 +167,7 @@ scw datalab datalab update [arg=value ...] ## -List available node types. These are the possible compute units that can host the Spark cluster. +List available node types. ### List datalab resources @@ -177,7 +177,7 @@ List datalab resources. **Usage:** ``` -scw datalab node-types list [arg=value ...] +scw datalab node-type list [arg=value ...] ``` @@ -186,7 +186,7 @@ scw datalab node-types list [arg=value ...] | Name | | Description | |------|---|-------------| | order-by | One of: `name_asc`, `name_desc`, `vcpus_asc`, `vcpus_desc`, `memory_gigabytes_asc`, `memory_gigabytes_desc`, `vram_bytes_asc`, `vram_bytes_desc`, `gpus_asc`, `gpus_desc` | The order by field. Available fields are `name_asc`, `name_desc`, `vcpus_asc`, `vcpus_desc`, `memory_gigabytes_asc`, `memory_gigabytes_desc`, `vram_bytes_asc`, `vram_bytes_desc`, `gpus_asc`, `gpus_desc`. | -| targets.{index} | One of: `unknown_target`, `notebook`, `worker` | Filter on the wanted targets, whether it's for main node or worker. | +| targets.{index} | One of: `unknown_target`, `notebook`, `worker` | Filter based on the target of the nodes. Allows to filter the nodes based on their purpose which can be main or worker node. | | resource-type | One of: `all`, `gpu`, `cpu` | Filter based on node type ( `cpu`/`gpu`/`all` ). | | region | Default: `fr-par`
One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config | @@ -194,7 +194,7 @@ scw datalab node-types list [arg=value ...] ## -List available notebook versions. Currently it includes JupyterLab. +List available notebook versions. ### List datalab resources @@ -204,7 +204,7 @@ List datalab resources. **Usage:** ``` -scw datalab notebook-versions list [arg=value ...] +scw datalab notebook-version list [arg=value ...] ``` diff --git a/internal/namespaces/datalab/v1beta1/datalab_cli.go b/internal/namespaces/datalab/v1beta1/datalab_cli.go index 6d19f02d80..823925d40a 100644 --- a/internal/namespaces/datalab/v1beta1/datalab_cli.go +++ b/internal/namespaces/datalab/v1beta1/datalab_cli.go @@ -21,17 +21,17 @@ func GetGeneratedCommands() *core.Commands { return core.NewCommands( datalabRoot(), datalabDatalab(), - datalabNodeTypes(), - datalabNotebookVersions(), - datalabClusterVersions(), + datalabNodeType(), + datalabNotebookVersion(), + datalabClusterVersion(), datalabDatalabCreate(), datalabDatalabGet(), datalabDatalabList(), datalabDatalabUpdate(), datalabDatalabDelete(), - datalabNodeTypesList(), - datalabNotebookVersionsList(), - datalabClusterVersionsList(), + datalabNodeTypeList(), + datalabNotebookVersionList(), + datalabClusterVersionList(), ) } @@ -46,36 +46,36 @@ func datalabRoot() *core.Command { func datalabDatalab() *core.Command { return &core.Command{ Short: ``, - Long: `Manage your Datalab.`, + Long: `Manage your Data Labs.`, Namespace: "datalab", Resource: "datalab", } } -func datalabNodeTypes() *core.Command { +func datalabNodeType() *core.Command { return &core.Command{ Short: ``, - Long: `List available node types. These are the possible compute units that can host the Spark cluster.`, + Long: `List available node types.`, Namespace: "datalab", - Resource: "node-types", + Resource: "node-type", } } -func datalabNotebookVersions() *core.Command { +func datalabNotebookVersion() *core.Command { return &core.Command{ Short: ``, - Long: `List available notebook versions. Currently it includes JupyterLab.`, + Long: `List available notebook versions.`, Namespace: "datalab", - Resource: "notebook-versions", + Resource: "notebook-version", } } -func datalabClusterVersions() *core.Command { +func datalabClusterVersion() *core.Command { return &core.Command{ Short: ``, Long: `Lists the Spark versions available for Data Lab creation.`, Namespace: "datalab", - Resource: "cluster-versions", + Resource: "cluster-version", } } @@ -131,7 +131,7 @@ func datalabDatalabCreate() *core.Command { }, { Name: "has-notebook", - Short: `Whether a JupyterLab notebook shall be created with the Data Lab or not.`, + Short: `Select this option to include a notebook as part of the Data Lab.`, Required: false, Deprecated: false, Positional: false, @@ -161,7 +161,7 @@ func datalabDatalabCreate() *core.Command { }, { Name: "private-network-id", - Short: `The private network to which the Data Lab is connected. Important for accessing the Spark Master URL from a private cluster.`, + Short: `The unique identifier of the private network the Data Lab will be attached to.`, Required: false, Deprecated: false, Positional: false, @@ -320,7 +320,7 @@ func datalabDatalabUpdate() *core.Command { }, { Name: "tags.{index}", - Short: `The updated tags of the Data Lab`, + Short: `The updated tags of the Data Lab.`, Required: false, Deprecated: false, Positional: false, @@ -375,12 +375,12 @@ func datalabDatalabDelete() *core.Command { } } -func datalabNodeTypesList() *core.Command { +func datalabNodeTypeList() *core.Command { return &core.Command{ Short: `List datalab resources`, Long: `List datalab resources.`, Namespace: "datalab", - Resource: "node-types", + Resource: "node-type", Verb: "list", // Deprecated: false, ArgsType: reflect.TypeOf(datalab.ListNodeTypesRequest{}), @@ -406,7 +406,7 @@ func datalabNodeTypesList() *core.Command { }, { Name: "targets.{index}", - Short: `Filter on the wanted targets, whether it's for main node or worker.`, + Short: `Filter based on the target of the nodes. Allows to filter the nodes based on their purpose which can be main or worker node.`, Required: false, Deprecated: false, Positional: false, @@ -453,12 +453,12 @@ func datalabNodeTypesList() *core.Command { } } -func datalabNotebookVersionsList() *core.Command { +func datalabNotebookVersionList() *core.Command { return &core.Command{ Short: `List datalab resources`, Long: `List datalab resources.`, Namespace: "datalab", - Resource: "notebook-versions", + Resource: "notebook-version", Verb: "list", // Deprecated: false, ArgsType: reflect.TypeOf(datalab.ListNotebookVersionsRequest{}), @@ -499,12 +499,12 @@ func datalabNotebookVersionsList() *core.Command { } } -func datalabClusterVersionsList() *core.Command { +func datalabClusterVersionList() *core.Command { return &core.Command{ Short: `List datalab resources`, Long: `List datalab resources.`, Namespace: "datalab", - Resource: "cluster-versions", + Resource: "cluster-version", Verb: "list", // Deprecated: false, ArgsType: reflect.TypeOf(datalab.ListClusterVersionsRequest{}),