Skip to content

feat(network): add address create, update, delete and reserve verbs - #18

Merged
ProbstenHias merged 5 commits into
mainfrom
feat/network-address-writes
Sep 12, 2026
Merged

ProbstenHias merged 5 commits into
mainfrom
feat/network-address-writes

Conversation

@ProbstenHias

Copy link
Copy Markdown
Owner

Summary

`anexia network address` was list/get only. This adds the write verbs the design doc already reserved for it:

  • `create --prefix --address [--description --role --organization --rdns]`
  • `update [--description --role --rdns]`: reads first so the mandatory `rdns_name` field is carried over unchanged; `--rdns ""` clears it. Refuses no-op updates and emptied description/role (go-anxcloud drops them from the request).
  • `delete ` (alias `destroy`) with the usual confirmation and `--yes`.
  • `reserve --location --vlan [--count --prefix --version --reservation-period]`: `--reservation-period` is a duration sent as whole seconds, minimum 1s, Engine default 30m. An empty reservation answer is an error.

Docs: README feature table, usage examples, and `docs/cli-design.md` (verb tables, update semantics, reserve rules, `--address` naming note, `--wait` list) updated to match.

Testing

`make ci` (vet, golangci-lint, `go test -race ./...`) is green. Wire-level tests pin every request method, path, query and JSON body against go-anxcloud v0.14.5 tags, plus usage-error paths that must not reach the Engine, failed GET/PUT/DELETE, the confirmation prompt, table and `-o json` rendering, and reservation-period boundaries (0s, 500ms, -1s rejected; 1s, 1500ms, 1h truncated to seconds).

Four independent review cycles (correctness, tests, contract/docs) were run; the last two found no behavior bugs.

Drive the legacy ipam/address client the same way network prefix does:
flags as payload, identifier validation before any request, confirmation
on delete and the same error shape as the registry-driven nouns.

update reads the address first and carries the current rDNS name into
the PUT, because go-anxcloud sends rdns_name without omitempty and an
omitted flag would otherwise clear it. reserve is the leaf action verb
docs/cli-design.md already allows; it takes --reservation-period as a
duration and renders the reserved addresses as a list.
…semantics

Reject an empty reservation result instead of rendering success, require
--reservation-period to be at least 1s because the Engine takes whole
seconds, and drop the unreachable 32-bit guard. Pin the rDNS carry-over,
identifier guards, delete paths and minimal reserve payload in tests, and
record the address update and summary behaviour in the design doc.
…eserve exit code

Also document the --address flag naming and list network address among
the resources that report a provisioning state.
Order the address file by verb like prefix, note why update offers no
--name flag, and pin that 1s is accepted while sub-second remainders are
truncated to whole seconds.
@ProbstenHias
ProbstenHias merged commit f485636 into main Sep 12, 2026
3 checks passed
@ProbstenHias
ProbstenHias deleted the feat/network-address-writes branch September 12, 2026 12:30
ProbstenHias pushed a commit that referenced this pull request Sep 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.6.0](v0.5.0...v0.6.0)
(2026-09-12)


### Features

* **kubernetes:** add cluster, node-pool and kubeconfig commands
([#16](#16))
([cf3599f](cf3599f))
* **network:** add address create, update, delete and reserve verbs
([#18](#18))
([f485636](f485636))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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