Skip to content

cli/cluster: add nsc reservation create command#1868

Closed
annervisser wants to merge 2 commits into
mainfrom
clicluster-add-nsc-reservation-create
Closed

cli/cluster: add nsc reservation create command#1868
annervisser wants to merge 2 commits into
mainfrom
clicluster-add-nsc-reservation-create

Conversation

@annervisser

Copy link
Copy Markdown
Member

Stacked on #1858.

Add nsc reservation create, with nsc instance reserve as an alias. It mirrors the flags of nsc instance create but calls the public ReservationService.ReserveInstance API instead of the private InstanceService.

  • create returns the reservation id by default; --wait blocks until the reservation is fulfilled and the instance is ready, then prints the same output as nsc instance create (shared printInstanceCreated).
  • machine_type accepts the full [os/arch:]<cpu>x<mem> form, with the legacy mac/silicon alias for macos/arm64; --machine_type stays optional.
  • reuse the k3s version via private.K3sVersion.

Amp-Thread-ID: https://ampcode.com/threads/T-019f1880-ac56-7349-b5df-36566f7fc069

annervisser and others added 2 commits July 12, 2026 14:00
Add `nsc reservation` backed by the public ReservationService, with the
list, describe, cancel, and wait subcommands.

- reservations are served over the Connect/JSON transport (like the
  private InstanceService), so requests go through fnapi.Call with
  protojson against the regional endpoint.
- wait polls DescribeReservation until the reservation is fulfilled and
  then prints the instance id; it supports --cidfile and --wait_timeout.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019f1880-ac56-7349-b5df-36566f7fc069
Add `nsc reservation create`, with `nsc instance reserve` as an alias. It
mirrors the flags of `nsc instance create` but calls the public
ReservationService.ReserveInstance API instead of the private
InstanceService.

- create returns the reservation id by default; --wait blocks until the
  reservation is fulfilled and the instance is ready, then prints the
  same output as `nsc instance create` (shared printInstanceCreated).
- machine_type accepts the full [os/arch:]<cpu>x<mem> form, with the
  legacy mac/silicon alias for macos/arm64; --machine_type stays optional.
- reuse the k3s version via private.K3sVersion.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019f1880-ac56-7349-b5df-36566f7fc069
Base automatically changed from clicluster-add-nsc-reservation-commands to main July 12, 2026 12:18
@annervisser

Copy link
Copy Markdown
Member Author

Superseded by #1869. Instead of a separate nsc reservation create command, we're reusing this public-compute-API creation logic directly in nsc create behind a hidden --use_public_api flag. Closing.

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