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 support for all-projects to incus image list and API #390

Closed
stgraber opened this issue Jan 15, 2024 · 5 comments · Fixed by #400
Closed

Add support for all-projects to incus image list and API #390

stgraber opened this issue Jan 15, 2024 · 5 comments · Fixed by #400
Assignees
Labels
API Changes to the REST API Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@stgraber
Copy link
Member

Similar to instance listing supporting querying for all projects at the same time, it'd be useful to add that to the images API and CLI.

https://discuss.linuxcontainers.org/t/incus-image-list-columns/18711

@stgraber stgraber added Feature New feature, not a bug Easy Good for new contributors API Changes to the REST API labels Jan 15, 2024
@MaheshPunjabi
Copy link
Contributor

Can I try ?

@stgraber
Copy link
Member Author

sure!

I assigned it to you.

@stgraber
Copy link
Member Author

For this one, you're going to want to:

  • Add a new API extension to both internal/version/api.go and doc/api-extensions.md, let's call it images_all_projects
  • Add support for all-projects to cmd/incusd/images.go for the imagesGet function. You can find examples of detecting all-projects in cmd/incusd/storage_volumes.go, cmd/incusd/network_allocations.go, cmd/incusd/instances_get.go, cmd/incusd/events.go and cmd/incusd/operations.go. This should also include adding the all-projects to the swagger comments on imagesGet.
  • Re-generate the swagger YAML data (make update-api).
  • Add a new GetImagesAllProjects function to client/incus_images.go and add that function to the ImageServer interface. Implement it in client/simplestreams_images.go as an alias for the standard GetImages.
  • Add the new argument to cmd/incus/image.go, when passed, call GetImagesAllProjects instead of GetImages.
  • Re-generate the translation template for the new CLI string.

The resulting set of commits will likely be:

  • api: images_all_projects
  • incusd/images: Add support for all_projects
  • doc/rest-api: Refresh swagger YAML
  • client: Add GetImagesAllProjects
  • incus/image: Add --all-projects flag to list
  • i18n: Update translation templates

@MaheshPunjabi
Copy link
Contributor

Follow up question: do we want to add a column for 'project' in the output ?

@stgraber
Copy link
Member Author

stgraber commented Feb 1, 2024

Ah yeah, when --all-projects is passed, a project column should be added, same thing we do with incus list --all-projects.

@stgraber stgraber linked a pull request Feb 11, 2024 that will close this issue
6 tasks
@stgraber stgraber added this to the incus-0.6 milestone Feb 11, 2024
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 Easy Good for new contributors Feature New feature, not a bug
Development

Successfully merging a pull request may close this issue.

2 participants