feat(cli): migrate cloud ip (floating/additional/extNet) to API v2 - #218
feat(cli): migrate cloud ip (floating/additional/extNet) to API v2#218duboolivier wants to merge 1 commit into
Conversation
Signed-off-by: olivier dubo <olivier.dubo@ovhcloud.com>
| * [ovhcloud cloud alerting](ovhcloud_cloud_alerting.md) - Manage billing alert configurations in the given cloud project | ||
| * [ovhcloud cloud instance](ovhcloud_cloud_instance.md) - Manage instances in the given cloud project | ||
| * [ovhcloud cloud ip](ovhcloud_cloud_ip.md) - Manage public IPs (floating and failover) in the given cloud project | ||
| * [ovhcloud cloud ip](ovhcloud_cloud_ip.md) - Manage public IPs (floating, additional, ext-net and failover) in the given cloud project |
There was a problem hiding this comment.
| * [ovhcloud cloud ip](ovhcloud_cloud_ip.md) - Manage public IPs (floating, additional, ext-net and failover) in the given cloud project | |
| * [ovhcloud cloud ip](ovhcloud_cloud_ip.md) - Manage public IPs (floating, additional and ext-net) in the given cloud project |
| ## ovhcloud cloud ip | ||
|
|
||
| Manage public IPs (floating and failover) in the given cloud project | ||
| Manage public IPs (floating, additional, ext-net and failover) in the given cloud project |
There was a problem hiding this comment.
| Manage public IPs (floating, additional, ext-net and failover) in the given cloud project | |
| Manage public IPs (floating, additional and ext-net) in the given cloud project |
| * [ovhcloud cloud ip list](ovhcloud_cloud_ip_list.md) - List public IPs (both floating and failover when --type is not specified) | ||
| * [ovhcloud cloud ip additional](ovhcloud_cloud_ip_additional.md) - Manage additional public IPs in the given cloud project | ||
| * [ovhcloud cloud ip extNet](ovhcloud_cloud_ip_extNet.md) - Manage ext-net public IPs in the given cloud project | ||
| * [ovhcloud cloud ip failover](ovhcloud_cloud_ip_failover.md) - Manage failover public IPs in the given cloud project |
There was a problem hiding this comment.
we can't have failover and additional, it's the same product
| Get a specific ext-net IP | ||
|
|
||
| ``` | ||
| ovhcloud cloud ip extNet get <ip> [flags] |
There was a problem hiding this comment.
the command should be ovhcloud cloud ip extnet (lowercase). Please fix in the base command and regenerate the doc after
| initCloudIPAdditionalCommand(ipCmd) | ||
| initCloudIPExtNetCommand(ipCmd) | ||
|
|
||
| // Failover IPs (API v1) |
| } | ||
|
|
||
| // initCloudIPFailoverCommand registers the `cloud ip failover` subcommands (API v1). | ||
| func initCloudIPFailoverCommand(ipCmd *cobra.Command) { |
| // Failover IP - attach | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| func (ms *MockSuite) TestCloudFailoverIPAttachCmd(assert, require *td.T) { |
There was a problem hiding this comment.
all failover tests should be removed, and for this one the command attach should be moved under ip additional (the attach is not available yet in APIv2, so continue using the v1)
| // Columns displayed for the various public IP kinds (API v2). | ||
| cloudPublicIPColumnsToDisplay = []string{"ip", "type"} | ||
| cloudPublicIPFloatingColumnsToDisplay = []string{"id", "currentState.status status", "currentState.location.region region", "resourceStatus"} | ||
| cloudPublicIPAdditionalColumnsToDisplay = []string{"id", "currentState.ip ip", "resourceStatus"} |
There was a problem hiding this comment.
| cloudPublicIPAdditionalColumnsToDisplay = []string{"id", "currentState.ip ip", "resourceStatus"} | |
| cloudPublicIPAdditionalColumnsToDisplay = []string{"id", "resourceStatus"} |
There was a problem hiding this comment.
also, adding the linked resource could be useful
| @@ -56,47 +56,6 @@ func ListCloudIPFailovers(_ *cobra.Command, _ []string) { | |||
| display.RenderTable(body, cloudprojectIPFailoverColumnsToDisplay, &flags.OutputFormatConfig) | |||
There was a problem hiding this comment.
whole file to remove, and the commands not yet available in v2 must be moved under ip additional
Description
Migrates the
cloud ipcommands to the Cloud API v2publicIpendpoints and restructuresthe command tree into one subcommand per IP kind.
cloud ip floating(v2,/v2/publicCloud/project/{id}/publicIp/floating): list, get, create, edit, delete — full CRUD, async create via--waitcloud ip additional(v2): list, get (read-only)cloud ip extNet(v2): list, get, deletecloud ip list: now the v2 public-IP inventory (GET /publicIp)cloud ip failover: functionally unchanged (still v1), moved under thefailoversubcommand for consistencyCreate/edit go through
common.CreateResource/EditResource(so--editor/--from-file/--init-filework).Breaking changes (CLI invocation)
cloud ip get --type floating|failover→cloud ip floating|failover get <ip>cloud ip listno longer merges failover IPs; usecloud ip failover listTested end-to-end against the real v2 API (v2 lists + inventory + 404; failover still served by v1).
Type of change
Please delete options that are not relevant.
Checklist:
go mod tidy