Skip to content

microvms: add URL add/remove and ingress opt-out - #1174

Merged
SSharma-10 merged 2 commits into
digitalocean:mainfrom
schakraborty-do:schakraborty/microvm-url-add-remove
Oct 19, 2026
Merged

SSharma-10 merged 2 commits into
digitalocean:mainfrom
schakraborty-do:schakraborty/microvm-url-add-remove

Conversation

@schakraborty-do

Copy link
Copy Markdown
Contributor

Why

The public MicroVM API gained ingress-URL management and a create-time ingress opt-out. These godo bindings expose that surface so downstream clients (doctl, terraform-provider-digitalocean) can wire it up.

Internal tracking: MDROP-591.

What changed

microvms.go / microvms_test.go:

  • MicroVMURL.ID — stable per-URL identifier, used to remove a URL.
  • MicroVMCreateRequest.Ingress *bool — omitted (nil) keeps the API default (a default URL is created); set to false to create a MicroVM with no default URL.
  • MicroVMURLCreateRequest{ Port int } — optional port for a new URL; defaults to the MicroVM's http_port when zero.
  • MicroVMsService.AddURL — POST /v2/microvms/{id}/urls, returns the new MicroVMURL.
  • MicroVMsService.RemoveURL — DELETE /v2/microvms/{id}/urls/{url_id}, 204 no body.

No version bump or CHANGELOG entry — left for the release PR per CONTRIBUTING.md.

Testing

go build ./..., go vet ./..., gofmt, and go test . all pass. Added tests: add-with-port, add-with-default-port (nil request), remove, empty-arg guards, and create with ingress: false.

Made with Cursor

Add MicroVMsService.AddURL (POST /v2/microvms/{id}/urls) and RemoveURL (DELETE /v2/microvms/{id}/urls/{url_id}), a MicroVMURLCreateRequest with optional port, MicroVMURL.ID, and MicroVMCreateRequest.Ingress (*bool, defaults true) to opt out of the default URL at create. Matches the microdroplet public API contract.

Co-authored-by: Cursor <cursoragent@cursor.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.

3 participants

⌂ 换网址