Skip to content

feat(machines): select the create API version - #113

Closed
mehal-dedalus wants to merge 1 commit into
mainfrom
feat/machines-create-api-version
Closed

mehal-dedalus wants to merge 1 commit into
mainfrom
feat/machines-create-api-version

Conversation

@mehal-dedalus

Copy link
Copy Markdown
Collaborator

Summary

Add dedalus machines create --api-version v2 to select /v2/machines on servers that support controller placement. The default remains v1. Both versions use the existing request body, credentials, transport, and output formatting.

An invalid version fails before sending a request. A v2 error is returned directly without retrying the create through v1. Other Machine commands keep their v1 routes.

Verification

The new TestCreateAPIVersion initially failed because --api-version did not exist. It now runs the built CLI against a local HTTP server and passes for the default, explicit v1, explicit v2, a base URL with a path prefix, piped JSON, an invalid version, and a v2 404 without a v1 request.

  • go test ./... passed with the repository's Steady mock API running. The mock recorded 21 structurally valid requests across all 17 endpoints.
  • go vet ./... passed.
  • Built the CLI and checked that create help includes --api-version with a v1 default.
  • git diff --check passed.

These are local CLI and HTTP-contract tests, not a real Machine placement test. Deploy server support before using v2. This change does not publish a CLI release.

Scope

117 handwritten changed lines, including 85 test lines and 13 documentation lines. No generated schema changes.

Usage documentation.

Signed-off-by: Mehal <mehal@dedaluslabs.ai>
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.

2 participants