Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --description flag to create type CLI commands #1498

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

luissimas
Copy link

Adds a --description CLI flag to the following commands:

  • config trust add-certificate
  • cluster group create
  • create
  • image alias create
  • launch
  • network create
  • network acl create
  • network acl rule add
  • network forward create
  • network forward port add
  • network load-balancer create
  • network load-balancer backend add
  • network load-balancer port add
  • network peer create
  • network zone create
  • network zone record add
  • profile create
  • project create
  • storage create
  • storage bucket create
  • storage bucket key create
  • storage volume create
  • storage volume snapshot create
  • snapshot create

The flag allow users to set a description on the resources when they create them, instead of having to update the description after the creation.

For the snapshot create and storage volume snapshot create commands, some changes were made to the API and the incusd daemon, since the description field was not supported on the server side. Additionally, the new description field is shown in the output of incus storage volume snapshot list, incus snapshot list and incus info.

Closes #1485

@luissimas luissimas requested a review from stgraber as a code owner December 12, 2024 11:14
@github-actions github-actions bot added the API Changes to the REST API label Dec 12, 2024
@luissimas luissimas marked this pull request as draft December 12, 2024 11:17
@luissimas
Copy link
Author

@stgraber opening as a draft because I still want to add some test cases for the commands. Is the test/suites/*.sh the intended place for such tests?

I did some manual tests to validate most of the changes, but I was a bit limited by my local setup to test the network commands. Also, I'm not sure about the changes for snapshots, specially the default description values for the scheduled/automatic snapshots.

@luissimas luissimas changed the title Description flag Add --description flag to create type CLI commands Dec 12, 2024
@stgraber
Copy link
Member

@stgraber opening as a draft because I still want to add some test cases for the commands. Is the test/suites/*.sh the intended place for such tests?

Yeah, you can have a few of the commands in there start passing --description for testing.

Adds a --description flag to various commands that create resources.

Signed-off-by: Luís Simas <[email protected]>
Adds a description field on the request schema of instance and volume
snapshots for POST and GET routes.

Signed-off-by: Luís Simas <[email protected]>
Adds a --description flag to the create subcommand of the snapshot and
storage volume snapshot commands. Also adds the ability to display the
description field in query commands.

Signed-off-by: Luís Simas <[email protected]>
Adds support for specifying a description on both instance and volume
snapshots. In the case of snapshots created by the user, the description
can be provided via the HTTP API. In the case of snapshots created
automatically by Incus, a default description value is used.

Signed-off-by: Luís Simas <[email protected]>
@luissimas luissimas marked this pull request as ready for review December 13, 2024 10:46
@stgraber
Copy link
Member

Looks good overall. I'll have to take a closer look at the snapshot description stuff as I now have a nagging feeling that we have those fields read-only as we want the snapshot to capture and restore the instance or volume's own description.

If that's indeed the case, we'll then want to just remove the ability to set a description on snapshots at creation time which will also make this PR a bit simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes to the REST API
Development

Successfully merging this pull request may close these issues.

Add --description flag to create type CLI commands
2 participants