Skip to content

Commit 2e0bb62

Browse files
feat(flexibleip): reorder columns and make fip_id positional in update and delete (#1996)
Co-authored-by: Rémy Léone <[email protected]>
1 parent df0a770 commit 2e0bb62

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

cmd/scw/testdata/test-all-usage-fip-ip-delete-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Delete a Flexible IP.
44

55
USAGE:
6-
scw fip ip delete [arg=value ...]
6+
scw fip ip delete <fip-id ...> [arg=value ...]
77

88
ARGS:
99
fip-id ID of the Flexible IP to delete

cmd/scw/testdata/test-all-usage-fip-ip-update-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Update a Flexible IP.
44

55
USAGE:
6-
scw fip ip update [arg=value ...]
6+
scw fip ip update <fip-id ...> [arg=value ...]
77

88
ARGS:
99
fip-id ID of the Flexible IP to update

internal/namespaces/flexibleip/v1alpha1/flexibleip_cli.go

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,41 @@ func fipIPList() *core.Command {
212212
return resp.FlexibleIPs, nil
213213

214214
},
215+
View: &core.View{Fields: []*core.ViewField{
216+
{
217+
FieldName: "ID",
218+
},
219+
{
220+
FieldName: "IPAddress",
221+
},
222+
{
223+
FieldName: "Status",
224+
},
225+
{
226+
FieldName: "Reverse",
227+
},
228+
{
229+
FieldName: "ServerID",
230+
},
231+
{
232+
FieldName: "Description",
233+
},
234+
{
235+
FieldName: "Tags",
236+
},
237+
{
238+
FieldName: "ProjectID",
239+
},
240+
{
241+
FieldName: "OrganizationID",
242+
},
243+
{
244+
FieldName: "UpdatedAt",
245+
},
246+
{
247+
FieldName: "CreatedAt",
248+
},
249+
}},
215250
}
216251
}
217252

@@ -230,7 +265,7 @@ func fipIPUpdate() *core.Command {
230265
Short: `ID of the Flexible IP to update`,
231266
Required: true,
232267
Deprecated: false,
233-
Positional: false,
268+
Positional: true,
234269
},
235270
{
236271
Name: "description",
@@ -281,7 +316,7 @@ func fipIPDelete() *core.Command {
281316
Short: `ID of the Flexible IP to delete`,
282317
Required: true,
283318
Deprecated: false,
284-
Positional: false,
319+
Positional: true,
285320
},
286321
core.ZoneArgSpec(scw.ZoneFrPar2),
287322
},

0 commit comments

Comments
 (0)