Skip to content

feat(ovhcloud-cli): migrate instance list/get/delete/set-name to API v2 - #292

Open
Bxota wants to merge 1 commit into
mainfrom
dev/tleterme/instance-v2
Open

Bxota wants to merge 1 commit into
mainfrom
dev/tleterme/instance-v2

Conversation

@Bxota

@Bxota Bxota commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

First step of the instance migration to API v2: instance list, get, delete and set-name now use /v2/publicCloud/project/{projectId}/compute/instance[/{instanceId}]. The other instance subcommands stay on v1 and will be migrated in follow-up PRs.

  • list: a single v2 call returning full objects, instead of listing IDs then fetching each instance. Columns: id, name, region, powerState, status
  • get: template rewritten on the v2 envelope (status, power state, region/AZ, SSH key, lock, IP addresses with type and network, flavor, image, volumes, security groups, current tasks)
  • set-name: same command and arguments; fetches the instance, changes targetSpec.name and sends back the editable targetSpec with the checksum. Adds --wait
  • delete: asynchronous in v2, the message is now "Instance X is being deleted"
  • Shell completions of the instance commands now use the v2 listing (instance group completions stay on v1)
  • Resync the two instance routes and the schemas they reference in cloud_v2.json with the live spec
  • Tests for the 4 commands, including a CREATING instance with no currentState, an instance without image, the set-name PUT body, --wait and a 404

Manually tested on a real v2 instance (create via API v2, then list / get / set-name --wait / delete).

Breaking changes

  • instance list no longer has a flavor.name column (only available in currentState, shown by get)
  • --filter expressions on instance list apply to the v2 envelope: name=="x" becomes targetSpec.name=="x", region becomes targetSpec.location.region
  • IAM: set-name now requires publicCloudProject:apiovh:instance/edit, and list/get/delete the v2 instance/get / instance/delete actions

Type of change

  • Improvement (improvement of existing commands)
  • Breaking change (fix or feature that can break a current behavior)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code
  • I ran go mod tidy
  • I have added tests that prove my fix is effective or that my feature works

@Bxota
Bxota added this pull request to stack #294 October 7, 2026 09:33
@Bxota
Bxota marked this pull request as ready for review October 7, 2026 09:36
@Bxota
Bxota requested a review from a team as a code owner October 7, 2026 09:36
@Bxota
Bxota force-pushed the dev/tleterme/instance-v2 branch from db88950 to dd65018 Compare October 8, 2026 08:20
- Migrate instance list/get/delete/set-name to API v2
- Rewrite the get template on the v2 envelope
- Add --wait to set-name
- Switch instance shell completions to the v2 listing
- Resync instance routes in cloud_v2.json with the live spec

Signed-off-by: Thomas Leterme <thomas.leterme@corp.ovh.com>
@amstuta
amstuta force-pushed the dev/tleterme/instance-v2 branch from dd65018 to 0994e19 Compare October 9, 2026 14:40

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant