From 07b067d895d9e68f4183fc36df9d2d1020fcfc0f Mon Sep 17 00:00:00 2001 From: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:24:44 +0100 Subject: [PATCH] Update docs for `flytectl update project` (#458) * project-archive-with-yaml Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> * fix syntax Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> * fix list Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> * update generated Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> --------- Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> --- flytectl/cmd/update/project.go | 79 +++++++++++-------- flytectl/docs/source/gen/flytectl_update.rst | 2 +- .../source/gen/flytectl_update_project.rst | 79 +++++++++++-------- 3 files changed, 91 insertions(+), 69 deletions(-) diff --git a/flytectl/cmd/update/project.go b/flytectl/cmd/update/project.go index 215f2393d8c..bf883af4504 100644 --- a/flytectl/cmd/update/project.go +++ b/flytectl/cmd/update/project.go @@ -15,71 +15,82 @@ import ( ) const ( - projectShort = "Update project resources" + projectShort = "Update the characteristics of a project" projectLong = ` -Update the project according to the flags passed. Allows you to archive or activate a project. -Activate project flytesnacks: -:: - - flytectl update project -p flytesnacks --activate +Allows you to update the characteristics of a project, including its name, labels and description. +Also allows you to archive or activate (unarchive) a project. -Archive project flytesnacks: +To archive a project, specify its ID with the *p* flag and add the *archive* flag: :: - flytectl update project -p flytesnacks --archive + flytectl update project -p my-project-id --archive -Incorrect usage when passing both archive and activate: +To activate (unarchive) an archived project, specify its ID with the *p* flag and add the *activate* flag: :: - flytectl update project -p flytesnacks --archive --activate + flytectl update project -p my-project-id --activate -Incorrect usage when passing unknown-project: +To update the characteristics of a project using flags, specify the project ID with the *p* flag and the flags corresponding to the characteristics you want to update: :: - flytectl update project unknown-project --archive + flytectl update project -p my-project-id --description "A wonderful project" --labels app=my-app -project ID is required flag +To update the characteristics of a project using a *yaml* file, define the file with the project ID desired updates: + +.. code-block:: yaml + + id: "my-project-id" + name: "my-project-name" + labels: + values: + app: my-app + description: "A wonderful project" -:: - flytectl update project unknown-project --archive +(Note: The name parameter must not contain whitespace) -Update projects.(project/projects can be used interchangeably in these commands) +Then, pass it in using the *file* flag: :: - flytectl update project -p flytesnacks --description "flytesnacks description" --labels app=flyte + flytectl update project --file project.yaml -Update a project by definition file. Note: The name shouldn't contain any whitespace characters. -:: +To archive or activate (unarchive) a project using a *yaml* file: + +* Add a state field, with a value of *0* for activated (unarchived) or *1* for archived, at the top level of the the *yaml* file. - flytectl update project --file project.yaml +* Add the *archive* flag to the command. + +For example, to archive a project: .. code-block:: yaml - id: "project-unique-id" - name: "Name" - labels: - values: - app: flyte - description: "Some description for the project" + # update.yaml + id: "my-project-id" + state: 1 -Update a project state by definition file. Note: The name shouldn't contain any whitespace characters. :: - flytectl update project --file project.yaml --archive + $ uctl update project --file update.yaml --archive + +And to activate (unarchive) the same project: .. code-block:: yaml - id: "project-unique-id" - name: "Name" - labels: - values: - app: flyte - description: "Some description for the project" + # update.yaml + id: "my-project-id" + state: 0 + +:: + + $ uctl update project --file update.yaml --archive + +Note that when using a *yaml* file, the *activate* flag is not used. +Instead, the *archive* flag is used for *both* archiving and activating (unarchiving) with the difference being in the *state* field of the *yaml* file. +Furthermore, the *state* field only takes effect if the *archive* flag is present in the command. Usage ` diff --git a/flytectl/docs/source/gen/flytectl_update.rst b/flytectl/docs/source/gen/flytectl_update.rst index 27949e6145c..ffc18b71010 100644 --- a/flytectl/docs/source/gen/flytectl_update.rst +++ b/flytectl/docs/source/gen/flytectl_update.rst @@ -104,7 +104,7 @@ SEE ALSO * :doc:`flytectl_update_launchplan` - Updates launch plan status * :doc:`flytectl_update_launchplan-meta` - Updates the launch plan metadata * :doc:`flytectl_update_plugin-override` - Update matchable resources of plugin overrides -* :doc:`flytectl_update_project` - Update project resources +* :doc:`flytectl_update_project` - Update the characteristics of a project * :doc:`flytectl_update_task-meta` - Update task metadata * :doc:`flytectl_update_task-resource-attribute` - Update matchable resources of task attributes * :doc:`flytectl_update_workflow-execution-config` - Updates matchable resources of workflow execution config diff --git a/flytectl/docs/source/gen/flytectl_update_project.rst b/flytectl/docs/source/gen/flytectl_update_project.rst index c4eeb48abee..5d273804787 100644 --- a/flytectl/docs/source/gen/flytectl_update_project.rst +++ b/flytectl/docs/source/gen/flytectl_update_project.rst @@ -3,76 +3,87 @@ flytectl update project ----------------------- -Update project resources +Update the characteristics of a project Synopsis ~~~~~~~~ -Update the project according to the flags passed. Allows you to archive or activate a project. -Activate project flytesnacks: -:: - - flytectl update project -p flytesnacks --activate +Allows you to update the characteristics of a project, including its name, labels and description. +Also allows you to archive or activate (unarchive) a project. -Archive project flytesnacks: +To archive a project, specify its ID with the *p* flag and add the *archive* flag: :: - flytectl update project -p flytesnacks --archive + flytectl update project -p my-project-id --archive -Incorrect usage when passing both archive and activate: +To activate (unarchive) an archived project, specify its ID with the *p* flag and add the *activate* flag: :: - flytectl update project -p flytesnacks --archive --activate + flytectl update project -p my-project-id --activate -Incorrect usage when passing unknown-project: +To update the characteristics of a project using flags, specify the project ID with the *p* flag and the flags corresponding to the characteristics you want to update: :: - flytectl update project unknown-project --archive + flytectl update project -p my-project-id --description "A wonderful project" --labels app=my-app -project ID is required flag +To update the characteristics of a project using a *yaml* file, define the file with the project ID desired updates: + +.. code-block:: yaml + + id: "my-project-id" + name: "my-project-name" + labels: + values: + app: my-app + description: "A wonderful project" -:: - flytectl update project unknown-project --archive +(Note: The name parameter must not contain whitespace) -Update projects.(project/projects can be used interchangeably in these commands) +Then, pass it in using the *file* flag: :: - flytectl update project -p flytesnacks --description "flytesnacks description" --labels app=flyte + flytectl update project --file project.yaml -Update a project by definition file. Note: The name shouldn't contain any whitespace characters. -:: +To archive or activate (unarchive) a project using a *yaml* file: + +* Add a state field, with a value of *0* for activated (unarchived) or *1* for archived, at the top level of the the *yaml* file. - flytectl update project --file project.yaml +* Add the *archive* flag to the command. + +For example, to archive a project: .. code-block:: yaml - id: "project-unique-id" - name: "Name" - labels: - values: - app: flyte - description: "Some description for the project" + # update.yaml + id: "my-project-id" + state: 1 -Update a project state by definition file. Note: The name shouldn't contain any whitespace characters. :: - flytectl update project --file project.yaml --archive + $ uctl update project --file update.yaml --archive + +And to activate (unarchive) the same project: .. code-block:: yaml - id: "project-unique-id" - name: "Name" - labels: - values: - app: flyte - description: "Some description for the project" + # update.yaml + id: "my-project-id" + state: 0 + +:: + + $ uctl update project --file update.yaml --archive + +Note that when using a *yaml* file, the *activate* flag is not used. +Instead, the *archive* flag is used for *both* archiving and activating (unarchiving) with the difference being in the *state* field of the *yaml* file. +Furthermore, the *state* field only takes effect if the *archive* flag is present in the command. Usage