Skip to content

Commit a454402

Browse files
author
Anton Bozhiy
committed
fix outputs
1 parent ddf1e6f commit a454402

22 files changed

Lines changed: 103 additions & 82 deletions

File tree

cmd/entities/cloud-instances/list.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ func newListCmd(cmdContext *base.CmdContext) *cobra.Command {
1717
opts := base.NewListOptions(
1818
&base.BaseListOptions[serverscom.CloudComputingInstance]{},
1919
&base.RegionIDOption[serverscom.CloudComputingInstance]{},
20-
&base.RegionCodeOption[serverscom.CloudComputingInstance]{},
2120
&base.LocationIDOption[serverscom.CloudComputingInstance]{},
2221
&base.LabelSelectorOption[serverscom.CloudComputingInstance]{},
2322
)

internal/output/entities/cloud_backups.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var (
1111
CloudBlockStorageBackupType = reflect.TypeOf(serverscom.CloudBlockStorageBackup{})
12-
CloudBlockStorageBackupListDefaultFields = []string{"ID", "Name", "Status", "Size"}
12+
CloudBlockStorageBackupListDefaultFields = []string{"ID", "Name", "Status", "Size", "RegionCode"}
1313
)
1414

1515
func RegisterCloudBackupDefinition() {
@@ -20,6 +20,7 @@ func RegisterCloudBackupDefinition() {
2020
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2121
{ID: "Size", Name: "Size", Path: "Size", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2222
{ID: "RegionID", Name: "Region ID", Path: "RegionID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
23+
{ID: "RegionCode", Name: "RegionCode", Path: "RegionCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2324
{ID: "OpenstackUUID", Name: "Openstack UUID", Path: "OpenstackUUID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
2425
{ID: "OpenstackVolumeUUID", Name: "Openstack Volume UUID", Path: "OpenstackVolumeUUID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
2526
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},

internal/output/entities/cloud_volumes.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var (
1111
CloudVolumeType = reflect.TypeOf(serverscom.CloudBlockStorageVolume{})
12-
CloudVolumeListDefaultFields = []string{"ID", "Name", "RegionID", "Size", "Description"}
12+
CloudVolumeListDefaultFields = []string{"ID", "Name", "RegionID", "RegionCode", "Size", "Description"}
1313
)
1414

1515
func RegisterCloudVolumeDefinition() {
@@ -18,6 +18,7 @@ func RegisterCloudVolumeDefinition() {
1818
{ID: "ID", Name: "ID", Path: "ID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
1919
{ID: "Name", Name: "Name", Path: "Name", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2020
{ID: "RegionID", Name: "Region ID", Path: "RegionID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
21+
{ID: "RegionCode", Name: "RegionCode", Path: "RegionCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2122
{ID: "Size", Name: "Size", Path: "Size", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2223
{ID: "Description", Name: "Description", Path: "Description", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2324
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},

internal/output/entities/k8s.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
var (
1111
KubernetesClusterType = reflect.TypeOf(serverscom.KubernetesCluster{})
1212
KubernetesClusterNodeType = reflect.TypeOf(serverscom.KubernetesClusterNode{})
13-
KubernetesClusterListDefaultFields = []string{"ID", "Name", "Status", "LocationID"}
13+
KubernetesClusterListDefaultFields = []string{"ID", "Name", "Status", "LocationID", "LocationCode"}
1414
KubernetesClusterNodeListDefaultFields = []string{"ID", "Number", "Hostname", "Type", "Role", "Status", "PrivateIPv4Address", "PublicIPv4Address"}
1515
)
1616

@@ -21,6 +21,7 @@ func RegisterKubernetesClusterDefinition() {
2121
{ID: "Name", Name: "Name", Path: "Name", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2222
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2323
{ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
24+
{ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2425
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},
2526
{ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
2627
{ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},

internal/output/entities/l2_segments.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func RegisterL2SegmentDefinitions() {
4646
{ID: "Code", Name: "Code", Path: "Code", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
4747
{ID: "GroupType", Name: "GroupType", Path: "GroupType", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
4848
{ID: "LocationIDs", Name: "LocationIDs", Path: "LocationIDs", PageViewHandlerFunc: slicePvHandler},
49+
{ID: "LocationCodes", Name: "LocationCodes", Path: "LocationCodes", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
4950
{ID: "Hyperscalers", Name: "Hyperscalers", Path: "Hyperscalers", PageViewHandlerFunc: slicePvHandler},
5051
},
5152
eType: L2SegmentLocationGroupType,

internal/output/entities/load_balancer_clusters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func RegisterLoadBalancerClusterDefinition() {
1818
{ID: "Name", Name: "Name", Path: "Name", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
1919
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2020
{ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
21+
{ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2122
{ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
2223
{ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
2324
},

internal/output/entities/load_balancers.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var (
1111
LoadBalancerType = reflect.TypeOf(serverscom.LoadBalancer{})
1212
L4LoadBalancerType = reflect.TypeOf(serverscom.L4LoadBalancer{})
1313
L7LoadBalancerType = reflect.TypeOf(serverscom.L7LoadBalancer{})
14-
LoadBalancerListDefaultFields = []string{"ID", "Name", "Type", "Status", "LocationID", "ClusterID"}
14+
LoadBalancerListDefaultFields = []string{"ID", "Name", "Type", "Status", "LocationID", "LocationCode", "ClusterID"}
1515
)
1616

1717
func RegisterLoadBalancerDefinitions() {
@@ -24,6 +24,7 @@ func RegisterLoadBalancerDefinitions() {
2424
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2525
{ID: "ExternalAddresses", Name: "ExternalAddresses", Path: "ExternalAddresses", PageViewHandlerFunc: slicePvHandler},
2626
{ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
27+
{ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2728
{ID: "ClusterID", Name: "ClusterID", Path: "ClusterID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2829
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},
2930
{ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
@@ -47,6 +48,7 @@ func RegisterLoadBalancerDefinitions() {
4748
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
4849
{ID: "ExternalAddresses", Name: "ExternalAddresses", Path: "ExternalAddresses", PageViewHandlerFunc: slicePvHandler},
4950
{ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
51+
{ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
5052
{ID: "StoreLogs", Name: "StoreLogs", Path: "StoreLogs", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
5153
{ID: "ClusterID", Name: "ClusterID", Path: "ClusterID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
5254
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},
@@ -71,6 +73,7 @@ func RegisterLoadBalancerDefinitions() {
7173
{ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
7274
{ID: "ExternalAddresses", Name: "ExternalAddresses", Path: "ExternalAddresses", PageViewHandlerFunc: slicePvHandler},
7375
{ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
76+
{ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
7477
{ID: "Geoip", Name: "Geoip", Path: "Geoip", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
7578
{ID: "StoreLogs", Name: "StoreLogs", Path: "StoreLogs", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},
7679
{ID: "StoreLogsRegionID", Name: "StoreLogsRegionID", Path: "StoreLogsRegionID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler},

internal/output/entities/network_pools.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
var (
1111
NetworkPoolType = reflect.TypeOf(serverscom.NetworkPool{})
12-
NetworkPoolListDefaultFields = []string{"ID", "Title", "CIDR", "Type"}
12+
NetworkPoolListDefaultFields = []string{"ID", "Title", "CIDR", "Type", "LocationCodes"}
1313

1414
SubnetworkType = reflect.TypeOf(serverscom.Subnetwork{})
1515
SubnetworkListDefaultFields = []string{"ID", "Title", "CIDR", "Attached", "InterfaceType"}
@@ -23,6 +23,7 @@ func RegisterNetworkPoolDefinitions() {
2323
{ID: "CIDR", Name: "CIDR", Path: "CIDR", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2424
{ID: "Type", Name: "Type", Path: "Type", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2525
{ID: "LocationIDs", Name: "LocationIDs", Path: "LocationIDs", PageViewHandlerFunc: slicePvHandler},
26+
{ID: "LocationCodes", Name: "LocationCodes", Path: "LocationCodes", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true},
2627
{ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler},
2728
{ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
2829
{ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true},
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ID Name Status Size Created
2-
backup-123 test-backup available 1073741824 2025-01-01T12:00:00Z
1+
ID Name Status Size RegionCode Created
2+
backup-123 test-backup available 1073741824 AMS1 2025-01-01T12:00:00Z

testdata/entities/cloud-backups/list_pageview.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Name: test-backup
33
Status: available
44
Size: 1073741824
55
Region ID: 1
6+
RegionCode: AMS1
67
Openstack UUID: <none>
78
Openstack Volume UUID: vol-123-openstack
89
Labels: env=test
@@ -13,6 +14,7 @@ Name: test-backup-2
1314
Status: available
1415
Size: 2147483648
1516
Region ID: 1
17+
RegionCode: AMS1
1618
Openstack UUID: <none>
1719
Openstack Volume UUID: vol-456-openstack
1820
Labels: env=prod

0 commit comments

Comments
 (0)