Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
project-archive-with-yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Peeter Piegaze <[email protected]>
  • Loading branch information
ppiegaze committed Jan 31, 2024
1 parent 79ed5ce commit 291612e
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 67 deletions.
80 changes: 47 additions & 33 deletions cmd/update/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,85 @@ 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:
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.
To archive a project, specify its ID with the *p* flag and add the *archive* flag:
::
flytectl update project -p flytesnacks --activate
flytectl update project -p my-project-id --archive
Archive project flytesnacks:
To activate (unarchive) an archived project, specify its ID with the *p* flag and add the *activate* flag:
::
flytectl update project -p flytesnacks --archive
flytectl update project -p my-project-id --activate
Incorrect usage when passing both archive and activate:
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 -p flytesnacks --archive --activate
flytectl update project -p my-project-id --description "A wonderful project" --labels app=my-app
Incorrect usage when passing unknown-project:
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)
project ID is required flag
Then, pass it in using the *file* flag:
::
flytectl update project unknown-project --archive
flytectl update project --file project.yaml
Update projects.(project/projects can be used interchangeably in these commands)
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.
* Add the *archive* flag to the command.
flytectl update project -p flytesnacks --description "flytesnacks description" --labels app=flyte
For example, to archive a project:
.. code-block:: yaml
# update.yaml
id: "my-project-id"
state: 1
Update a project by definition file. Note: The name shouldn't contain any whitespace characters.
::
flytectl update project --file project.yaml
$ 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
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
.. code-block:: yaml
Note that
id: "project-unique-id"
name: "Name"
labels:
values:
app: flyte
description: "Some description for the project"
* The *state* field only takes effect if the *archive* flag is present in the command.
* The *activate** flag is not used when updating a project using a *yaml* file.
Instead, a *state* field value of *0* in conjunction with the *archive* flag is used.
Usage
`
Expand Down
2 changes: 1 addition & 1 deletion docs/source/gen/flytectl_update.rst

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

80 changes: 47 additions & 33 deletions 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 291612e

Please sign in to comment.