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

Make use of SFTP API for incus file operations #1176

Open
1 of 5 tasks
stgraber opened this issue Sep 2, 2024 · 8 comments
Open
1 of 5 tasks

Make use of SFTP API for incus file operations #1176

stgraber opened this issue Sep 2, 2024 · 8 comments
Assignees
Labels
Easy Good for new contributors Feature New feature, not a bug
Milestone

Comments

@stgraber
Copy link
Member

stgraber commented Sep 2, 2024

Currently all the incus file operations are done through the individual REST API endpoints, which Incus then internally converts to SFTP interactions. This isn't exactly the most flexible or efficient.

It'd be good to change all the incus file operations to instead use GetInstanceFileSFTP to fetch a Go SFTP client and then perform the relevant filesystem operations through it.

  • create
  • delete
  • push
  • pull
  • edit
@stgraber stgraber added Feature New feature, not a bug Easy Good for new contributors labels Sep 2, 2024
@stgraber stgraber added this to the soon milestone Sep 2, 2024
@HassanAlsamahi
Copy link
Contributor

Can I work on this? If that is okay, should the change be done in client/incus_instances and replace the REST API part of the functions CreateInstanceFile..etc with the SFTP part? or directly in the cmd/incus/files? I believe the first but wanted to verify.

@stgraber
Copy link
Member Author

stgraber commented Sep 3, 2024

Assigned it to you!

The change should be done directly in cmd/incus/file.go, the Go client package should be a mostly clear mapping to the API so we don't want it to get too smart on that front.

@stgraber
Copy link
Member Author

Hey @HassanAlsamahi, how are things going with this one?

@HassanAlsamahi
Copy link
Contributor

Hey @stgraber . I made some progress but I didn't push a commit yet as I got busy and some personal stuff. I'll push a commit very soon for one of the operations, followed by the other operations. Thanks for asking and sorry for the delay.

@stgraber
Copy link
Member Author

No worries, thanks for the update!

@stgraber
Copy link
Member Author

@HassanAlsamahi any luck with the other ones?

@HassanAlsamahi
Copy link
Contributor

Hey @stgraber . Sorry I was on vacation in October totally logged off. Please check the latest PR and let me know if anything is needed regarding it.

@stgraber
Copy link
Member Author

stgraber commented Nov 6, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Good for new contributors Feature New feature, not a bug
Development

No branches or pull requests

2 participants