Skip to content

Commit

Permalink
Update docs for flytectl update project (flyteorg#458)
Browse files Browse the repository at this point in the history
* project-archive-with-yaml

Signed-off-by: Peeter Piegaze <[email protected]>

* fix syntax

Signed-off-by: Peeter Piegaze <[email protected]>

* fix list

Signed-off-by: Peeter Piegaze <[email protected]>

* update generated

Signed-off-by: Peeter Piegaze <[email protected]>

---------

Signed-off-by: Peeter Piegaze <[email protected]>
  • Loading branch information
ppiegaze authored Jan 31, 2024
1 parent 71e61f1 commit 9feeb8e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 69 deletions.
79 changes: 45 additions & 34 deletions flytectl/cmd/update/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`
Expand Down
2 changes: 1 addition & 1 deletion flytectl/docs/source/gen/flytectl_update.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 45 additions & 34 deletions flytectl/docs/source/gen/flytectl_update_project.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9feeb8e

Please sign in to comment.