Skip to content

feat: add civo vpc command suite with full CRUD for VPC resources#579

Merged
aculnaig merged 3 commits intomasterfrom
feat-vpc
Mar 4, 2026
Merged

feat: add civo vpc command suite with full CRUD for VPC resources#579
aculnaig merged 3 commits intomasterfrom
feat-vpc

Conversation

@aculnaig
Copy link
Contributor

@aculnaig aculnaig commented Mar 3, 2026

Implement the complete civo vpc command hierarchy using the VPC-prefixed methods from civogo SDK v0.7.0-alpha1. All commands target the /v2/vpc/ API path and follow existing CLI patterns for output formatting, batch deletion, region handling, and flag conventions.

Command tree:

civo vpc network ls | create | show | update | remove
civo vpc subnet ls | create | show | remove | attach | detach
civo vpc firewall ls | create | show | update | remove
civo vpc firewall rule ls | create | remove
civo vpc loadbalancer ls | create | show | update | remove
civo vpc ip ls | reserve | show | update | assign | unassign | delete

Implementation details:

  • 37 new files in cmd/vpc/ covering network, subnet, firewall, firewall rules, load balancer, and reserved IP resources
  • Wire VPCCmd into rootCmd via cmd/root.go
  • Subnet commands require --network flag to scope operations to a network
  • Load balancer create/update support repeatable --backend flag with format ip:source_port:target_port:protocol:health_check_port
  • IP assign uses --resource-id and --resource-type for generic resource assignment (not limited to instances)
  • Firewall list resolves network IDs to names via ListVPCNetworks
  • Firewall show includes inline rule listing
  • All remove commands support batch deletion with confirmation prompts
  • Three-way output support: json, custom fields, and human-readable

Implement the complete `civo vpc` command hierarchy using the VPC-prefixed
methods from civogo SDK v0.7.0-alpha1. All commands target the /v2/vpc/ API
path and follow existing CLI patterns for output formatting, batch deletion,
region handling, and flag conventions.

Command tree:

  civo vpc network      ls | create | show | update | remove
  civo vpc subnet       ls | create | show | remove | attach | detach
  civo vpc firewall     ls | create | show | update | remove
  civo vpc firewall rule  ls | create | remove
  civo vpc loadbalancer ls | create | show | update | remove
  civo vpc ip           ls | reserve | show | update | assign | unassign | delete

Implementation details:
- 37 new files in cmd/vpc/ covering network, subnet, firewall, firewall
  rules, load balancer, and reserved IP resources
- Wire VPCCmd into rootCmd via cmd/root.go
- Subnet commands require --network flag to scope operations to a network
- Load balancer create/update support repeatable --backend flag with
  format ip:source_port:target_port:protocol:health_check_port
- IP assign uses --resource-id and --resource-type for generic resource
  assignment (not limited to instances)
- Firewall list resolves network IDs to names via ListVPCNetworks
- Firewall show includes inline rule listing
- All remove commands support batch deletion with confirmation prompts
- Three-way output support: json, custom fields, and human-readable
@aculnaig aculnaig requested a review from giornetta March 3, 2026 14:03
Gianluca Cannata added 2 commits March 3, 2026 15:14
- Fix gofmt alignment in var blocks for vpc_firewall_create.go and
  vpc_loadbalancer_update.go
- Simplify createRules assignment to satisfy staticcheck QF1007
@giornetta
Copy link
Member

Is this something we want? Aren't we making our CLI API more complicated?

@aculnaig aculnaig merged commit 1f6f921 into master Mar 4, 2026
3 checks passed
@aculnaig aculnaig deleted the feat-vpc branch March 4, 2026 10:31
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