Skip to content

feat(vsphere): add location, template and disk-type commands - #19

Merged
ProbstenHias merged 3 commits into
mainfrom
feat/vsphere-provisioning-lists
Sep 13, 2026
Merged

ProbstenHias merged 3 commits into
mainfrom
feat/vsphere-provisioning-lists

Conversation

@ProbstenHias

Copy link
Copy Markdown
Owner

Summary

Starts the vsphere group from the roadmap with the read-only provisioning lookups needed before vm create can exist:

  • anexia vsphere location list (--code, --organization filters, paged)
  • anexia vsphere template list|get (--location, --type templates|from_scratch)
  • anexia vsphere disk-type list (--location, paged)

Location and disk-type use the legacy go-anxcloud provisioning clients, which interpolate filters and path segments raw, so values are escaped on the CLI side and pinned by tests. Template uses the generic vspherev1.Template spec because the Engine template endpoint is not paginated: the legacy client sent --page values the API ignored.

Also fixes a pre-existing ordering bug in the generic list command: unpaged lists with --page 2 and no token exited with the auth code instead of the usage code.

README coverage table and docs/cli-design.md inventory updated.

Test plan

  • make ci (fmt, lint, go test -race ./...) green
  • Conformance suite drives the new commands against a fake Engine
  • Paging, escaping, not-found, usage-error and unpaged --all/--page behaviour covered in internal/cli/vsphere_test.go
  • Four review cycles (bugs, tests, structure/docs) with no new findings in the last cycle

Add the vsphere command group with paged read-only lists backed by the
go-anxcloud legacy provisioning clients. Filters and path identifiers
are escaped before reaching the clients, which interpolate them raw.
Unpaged list commands checked pagination support only inside the fetch
callback, after the API client was built. Running such a list with
--page 2 and no token exited with the auth code instead of the usage
code. Check paging support before building the client and share the
error with the fetch path.
The Engine template endpoint is not paginated; the legacy client sent
--page values the API ignored, so --page 2 repeated page 1 and --all
looped. Use the generic vspherev1.Template spec, which handles the
unpaged endpoint and adds template get. Validate --location as an
identifier, fall back to the country code when a location has no
country name, align column headers with the rest of the CLI and pin
paging, escaping, not-found and usage behaviour in tests.
@ProbstenHias
ProbstenHias merged commit ea281ef into main Sep 13, 2026
3 checks passed
@ProbstenHias
ProbstenHias deleted the feat/vsphere-provisioning-lists branch September 13, 2026 13:34
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