Skip to content

Commit 1dc881e

Browse files
committed
Show type & decription of eip in eip list
1 parent 0e1a377 commit 1dc881e

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

cmd/compute/elastic_ip/elastic_ip_list.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import (
1515
)
1616

1717
type elasticIPListItemOutput struct {
18-
ID v3.UUID `json:"id"`
19-
IPAddress string `json:"ip_address"`
20-
Zone v3.ZoneName `json:"zone"`
18+
ID v3.UUID `json:"id"`
19+
IPAddress string `json:"ip_address"`
20+
Description string `json:"description"`
21+
Type string `json:"type"`
22+
Zone v3.ZoneName `json:"zone"`
2123
}
2224

2325
type elasticIPListOutput []elasticIPListItemOutput
@@ -78,10 +80,18 @@ func (c *elasticIPListCmd) CmdRun(_ *cobra.Command, _ []string) error {
7880

7981
if list != nil {
8082
for _, e := range list.ElasticIPS {
83+
var eipType string
84+
if e.Healthcheck != nil {
85+
eipType = "Managed"
86+
} else {
87+
eipType = "Manual"
88+
}
8189
res <- elasticIPListItemOutput{
82-
ID: e.ID,
83-
IPAddress: e.IP,
84-
Zone: zone.Name,
90+
ID: e.ID,
91+
IPAddress: e.IP,
92+
Description: e.Description,
93+
Type: eipType,
94+
Zone: zone.Name,
8595
}
8696
}
8797

0 commit comments

Comments
 (0)