Skip to content

Commit eef6fa6

Browse files
committed
extend network commands with new fields
1 parent 4ee0f0e commit eef6fa6

File tree

8 files changed

+287
-36
lines changed

8 files changed

+287
-36
lines changed

docs/stackit_beta_network_create.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,35 @@ stackit beta network create [flags]
1616
Create a network with name "network-1"
1717
$ stackit beta network create --name network-1
1818
19-
Create an IPv4 network with name "network-1" with DNS name servers and a prefix length
20-
$ stackit beta network create --name network-1 --ipv4-dns-name-servers "1.1.1.1,8.8.8.8,9.9.9.9" --ipv4-prefix-length 25
19+
Create a routed network with name "network-1"
20+
$ stackit beta network create --name network-1 --routed
2121
22-
Create an IPv6 network with name "network-1" with DNS name servers and a prefix length
23-
$ stackit beta network create --name network-1 --ipv6-dns-name-servers "2001:4860:4860::8888,2001:4860:4860::8844" --ipv6-prefix-length 56
22+
Create a network with name "network-1" and no gateway
23+
$ stackit beta network create --name network-1 --no-ipv4-gateway
24+
25+
Create an IPv4 network with name "network-1" with DNS name servers, a prefix, a gateway and a prefix length
26+
$ stackit beta network create --name network-1 --ipv4-dns-name-servers "1.1.1.1,8.8.8.8,9.9.9.9" --ipv4-prefix-length 25 --ipv4-prefix "10.1.2.0/24" --ipv4-gateway "10.1.2.3"
27+
28+
Create an IPv6 network with name "network-1" with DNS name servers, a prefix, a gateway and a prefix length
29+
$ stackit beta network create --name network-1 --ipv6-dns-name-servers "2001:4860:4860::8888,2001:4860:4860::8844" --ipv6-prefix-length 56 --ipv6-prefix "2001:4860:4860::8888" --ipv6-gateway "2001:4860:4860::8888"
2430
```
2531

2632
### Options
2733

2834
```
2935
-h, --help Help for "stackit beta network create"
30-
--ipv4-dns-name-servers strings List of DNS name servers for IPv4
36+
--ipv4-dns-name-servers strings List of DNS name servers for IPv4. Nameservers cannot be defined for routed networks.
37+
--ipv4-gateway string The IPv4 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.
38+
--ipv4-prefix string The IPv4 prefix of the network (CIDR)
3139
--ipv4-prefix-length int The prefix length of the IPv4 network
32-
--ipv6-dns-name-servers strings List of DNS name servers for IPv6
40+
--ipv6-dns-name-servers strings List of DNS name servers for IPv6. Nameservers cannot be defined for routed networks.
41+
--ipv6-gateway string The IPv6 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.
42+
--ipv6-prefix string The IPv6 prefix of the network (CIDR)
3343
--ipv6-prefix-length int The prefix length of the IPv6 network
3444
-n, --name string Network name
45+
--no-ipv4-gateway If set to true, the network doesn't have an IPv4 gateway.
46+
--no-ipv6-gateway If set to true, the network doesn't have an IPv6 gateway.
47+
--routed If set to true, the network is routed and therefore accessible from other networks
3548
```
3649

3750
### Options inherited from parent commands

docs/stackit_beta_network_update.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,31 @@ stackit beta network update [flags]
1616
Update network with ID "xxx" with new name "network-1-new"
1717
$ stackit beta network update xxx --name network-1-new
1818
19-
Update IPv4 network with ID "xxx" with new name "network-1-new" and new DNS name servers
20-
$ stackit beta network update xxx --name network-1-new --ipv4-dns-name-servers "2.2.2.2"
19+
Update network with ID "xxx" with routed true
20+
$ stackit beta network update xxx --routed
2121
22-
Update IPv6 network with ID "xxx" with new name "network-1-new" and new DNS name servers
23-
$ stackit beta network update xxx --name network-1-new --ipv6-dns-name-servers "2001:4860:4860::8888"
22+
Update network with ID "xxx" with no gateway
23+
$ stackit beta network update --no-ipv4-gateway
24+
25+
Update IPv4 network with ID "xxx" with new name "network-1-new", new gateway and new DNS name servers
26+
$ stackit beta network update xxx --name network-1-new --ipv4-dns-name-servers "2.2.2.2" --ipv4-gateway "10.1.2.3"
27+
28+
Update IPv6 network with ID "xxx" with new name "network-1-new", new gateway and new DNS name servers
29+
$ stackit beta network update xxx --name network-1-new --ipv6-dns-name-servers "2001:4860:4860::8888" --ipv6-gateway "2001:4860:4860::8888"
2430
```
2531

2632
### Options
2733

2834
```
2935
-h, --help Help for "stackit beta network update"
30-
--ipv4-dns-name-servers strings List of DNS name servers IPv4
31-
--ipv6-dns-name-servers strings List of DNS name servers for IPv6
36+
--ipv4-dns-name-servers strings List of DNS name servers IPv4. Nameservers cannot be defined for routed networks.
37+
--ipv4-gateway string The IPv4 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.
38+
--ipv6-dns-name-servers strings List of DNS name servers for IPv6. Nameservers cannot be defined for routed networks.
39+
--ipv6-gateway string The IPv6 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.
3240
-n, --name string Network name
41+
--no-ipv4-gateway If set to true, the network doesn't have an IPv4 gateway.
42+
--no-ipv6-gateway If set to true, the network doesn't have an IPv6 gateway.
43+
--routed If set to true, the network is routed and therefore accessible from other networks
3344
```
3445

3546
### Options inherited from parent commands

internal/cmd/beta/network/create/create.go

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,31 @@ const (
2525
nameFlag = "name"
2626
ipv4DnsNameServersFlag = "ipv4-dns-name-servers"
2727
ipv4PrefixLengthFlag = "ipv4-prefix-length"
28+
ipv4PrefixFlag = "ipv4-prefix"
29+
ipv4GatewayFlag = "ipv4-gateway"
2830
ipv6DnsNameServersFlag = "ipv6-dns-name-servers"
2931
ipv6PrefixLengthFlag = "ipv6-prefix-length"
32+
ipv6PrefixFlag = "ipv6-prefix"
33+
ipv6GatewayFlag = "ipv6-gateway"
34+
routedFlag = "routed"
35+
noIpv4Gateway = "no-ipv4-gateway"
36+
noIpv6Gateway = "no-ipv6-gateway"
3037
)
3138

3239
type inputModel struct {
3340
*globalflags.GlobalFlagModel
3441
Name *string
3542
IPv4DnsNameServers *[]string
3643
IPv4PrefixLength *int64
44+
IPv4Prefix *string
45+
IPv4Gateway *string
3746
IPv6DnsNameServers *[]string
3847
IPv6PrefixLength *int64
48+
IPv6Prefix *string
49+
IPv6Gateway *string
50+
Routed *bool
51+
NoIPv4Gateway bool
52+
NoIPv6Gateway bool
3953
}
4054

4155
func NewCmd(p *print.Printer) *cobra.Command {
@@ -50,12 +64,20 @@ func NewCmd(p *print.Printer) *cobra.Command {
5064
`$ stackit beta network create --name network-1`,
5165
),
5266
examples.NewExample(
53-
`Create an IPv4 network with name "network-1" with DNS name servers and a prefix length`,
54-
`$ stackit beta network create --name network-1 --ipv4-dns-name-servers "1.1.1.1,8.8.8.8,9.9.9.9" --ipv4-prefix-length 25`,
67+
`Create a routed network with name "network-1"`,
68+
`$ stackit beta network create --name network-1 --routed`,
5569
),
5670
examples.NewExample(
57-
`Create an IPv6 network with name "network-1" with DNS name servers and a prefix length`,
58-
`$ stackit beta network create --name network-1 --ipv6-dns-name-servers "2001:4860:4860::8888,2001:4860:4860::8844" --ipv6-prefix-length 56`,
71+
`Create a network with name "network-1" and no gateway`,
72+
`$ stackit beta network create --name network-1 --no-ipv4-gateway`,
73+
),
74+
examples.NewExample(
75+
`Create an IPv4 network with name "network-1" with DNS name servers, a prefix, a gateway and a prefix length`,
76+
`$ stackit beta network create --name network-1 --ipv4-dns-name-servers "1.1.1.1,8.8.8.8,9.9.9.9" --ipv4-prefix-length 25 --ipv4-prefix "10.1.2.0/24" --ipv4-gateway "10.1.2.3"`,
77+
),
78+
examples.NewExample(
79+
`Create an IPv6 network with name "network-1" with DNS name servers, a prefix, a gateway and a prefix length`,
80+
`$ stackit beta network create --name network-1 --ipv6-dns-name-servers "2001:4860:4860::8888,2001:4860:4860::8844" --ipv6-prefix-length 56 --ipv6-prefix "2001:4860:4860::8888" --ipv6-gateway "2001:4860:4860::8888"`,
5981
),
6082
),
6183
RunE: func(cmd *cobra.Command, _ []string) error {
@@ -113,11 +135,20 @@ func NewCmd(p *print.Printer) *cobra.Command {
113135

114136
func configureFlags(cmd *cobra.Command) {
115137
cmd.Flags().StringP(nameFlag, "n", "", "Network name")
116-
cmd.Flags().StringSlice(ipv4DnsNameServersFlag, []string{}, "List of DNS name servers for IPv4")
138+
cmd.Flags().StringSlice(ipv4DnsNameServersFlag, []string{}, "List of DNS name servers for IPv4. Nameservers cannot be defined for routed networks.")
117139
cmd.Flags().Int64(ipv4PrefixLengthFlag, 0, "The prefix length of the IPv4 network")
118-
cmd.Flags().StringSlice(ipv6DnsNameServersFlag, []string{}, "List of DNS name servers for IPv6")
140+
cmd.Flags().String(ipv4PrefixFlag, "", "The IPv4 prefix of the network (CIDR)")
141+
cmd.Flags().String(ipv4GatewayFlag, "", "The IPv4 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.")
142+
cmd.Flags().StringSlice(ipv6DnsNameServersFlag, []string{}, "List of DNS name servers for IPv6. Nameservers cannot be defined for routed networks.")
119143
cmd.Flags().Int64(ipv6PrefixLengthFlag, 0, "The prefix length of the IPv6 network")
144+
cmd.Flags().String(ipv6PrefixFlag, "", "The IPv6 prefix of the network (CIDR)")
145+
cmd.Flags().String(ipv6GatewayFlag, "", "The IPv6 gateway of a network. If not specified, the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.")
146+
cmd.Flags().Bool(routedFlag, false, "If set to true, the network is routed and therefore accessible from other networks")
147+
cmd.Flags().Bool(noIpv4Gateway, false, "If set to true, the network doesn't have an IPv4 gateway.")
148+
cmd.Flags().Bool(noIpv6Gateway, false, "If set to true, the network doesn't have an IPv6 gateway.")
120149

150+
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv4DnsNameServersFlag)
151+
cmd.MarkFlagsMutuallyExclusive(routedFlag, ipv6DnsNameServersFlag)
121152
err := flags.MarkFlagsRequired(cmd, nameFlag)
122153
cobra.CheckErr(err)
123154
}
@@ -133,8 +164,15 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
133164
Name: flags.FlagToStringPointer(p, cmd, nameFlag),
134165
IPv4DnsNameServers: flags.FlagToStringSlicePointer(p, cmd, ipv4DnsNameServersFlag),
135166
IPv4PrefixLength: flags.FlagToInt64Pointer(p, cmd, ipv4PrefixLengthFlag),
167+
IPv4Prefix: flags.FlagToStringPointer(p, cmd, ipv4PrefixFlag),
168+
IPv4Gateway: flags.FlagToStringPointer(p, cmd, ipv4GatewayFlag),
136169
IPv6DnsNameServers: flags.FlagToStringSlicePointer(p, cmd, ipv6DnsNameServersFlag),
137170
IPv6PrefixLength: flags.FlagToInt64Pointer(p, cmd, ipv6PrefixLengthFlag),
171+
IPv6Prefix: flags.FlagToStringPointer(p, cmd, ipv6PrefixFlag),
172+
IPv6Gateway: flags.FlagToStringPointer(p, cmd, ipv6GatewayFlag),
173+
Routed: flags.FlagToBoolPointer(p, cmd, routedFlag),
174+
NoIPv4Gateway: flags.FlagToBoolValue(p, cmd, noIpv4Gateway),
175+
NoIPv6Gateway: flags.FlagToBoolValue(p, cmd, noIpv6Gateway),
138176
}
139177

140178
if p.IsVerbosityDebug() {
@@ -153,22 +191,37 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
153191
req := apiClient.CreateNetwork(ctx, model.ProjectId)
154192
addressFamily := &iaas.CreateNetworkAddressFamily{}
155193

156-
if model.IPv6DnsNameServers != nil || model.IPv6PrefixLength != nil {
194+
if model.IPv6DnsNameServers != nil || model.IPv6PrefixLength != nil || model.IPv6Prefix != nil {
157195
addressFamily.Ipv6 = &iaas.CreateNetworkIPv6Body{
158196
Nameservers: model.IPv6DnsNameServers,
159197
PrefixLength: model.IPv6PrefixLength,
198+
Prefix: model.IPv6Prefix,
160199
}
161200
}
162201

163-
if model.IPv4DnsNameServers != nil || model.IPv4PrefixLength != nil {
202+
if model.NoIPv6Gateway {
203+
addressFamily.Ipv6.Gateway = iaas.NewNullableString(nil)
204+
} else if model.IPv6Gateway != nil {
205+
addressFamily.Ipv6.Gateway = iaas.NewNullableString(model.IPv6Gateway)
206+
}
207+
208+
if model.IPv4DnsNameServers != nil || model.IPv4PrefixLength != nil || model.IPv4Prefix != nil {
164209
addressFamily.Ipv4 = &iaas.CreateNetworkIPv4Body{
165210
Nameservers: model.IPv4DnsNameServers,
166211
PrefixLength: model.IPv4PrefixLength,
212+
Prefix: model.IPv4Prefix,
167213
}
168214
}
169215

216+
if model.NoIPv4Gateway {
217+
addressFamily.Ipv4.Gateway = iaas.NewNullableString(nil)
218+
} else if model.IPv4Gateway != nil {
219+
addressFamily.Ipv4.Gateway = iaas.NewNullableString(model.IPv4Gateway)
220+
}
221+
170222
payload := iaas.CreateNetworkPayload{
171-
Name: model.Name,
223+
Name: model.Name,
224+
Routed: model.Routed,
172225
}
173226

174227
if addressFamily.Ipv4 != nil || addressFamily.Ipv6 != nil {

internal/cmd/beta/network/create/create_test.go

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]st
2929
nameFlag: "example-network-name",
3030
ipv4DnsNameServersFlag: "1.1.1.0,1.1.2.0",
3131
ipv4PrefixLengthFlag: "24",
32+
ipv4PrefixFlag: "10.1.2.0/24",
33+
ipv4GatewayFlag: "10.1.2.3",
3234
ipv6DnsNameServersFlag: "2001:4860:4860::8888,2001:4860:4860::8844",
3335
ipv6PrefixLengthFlag: "24",
36+
ipv6PrefixFlag: "2001:4860:4860::8888",
37+
ipv6GatewayFlag: "2001:4860:4860::8888",
38+
routedFlag: "true",
3439
}
3540
for _, mod := range mods {
3641
mod(flagValues)
@@ -47,8 +52,13 @@ func fixtureInputModel(mods ...func(model *inputModel)) *inputModel {
4752
Name: utils.Ptr("example-network-name"),
4853
IPv4DnsNameServers: utils.Ptr([]string{"1.1.1.0", "1.1.2.0"}),
4954
IPv4PrefixLength: utils.Ptr(int64(24)),
55+
IPv4Prefix: utils.Ptr("10.1.2.0/24"),
56+
IPv4Gateway: utils.Ptr("10.1.2.3"),
5057
IPv6DnsNameServers: utils.Ptr([]string{"2001:4860:4860::8888", "2001:4860:4860::8844"}),
5158
IPv6PrefixLength: utils.Ptr(int64(24)),
59+
IPv6Prefix: utils.Ptr("2001:4860:4860::8888"),
60+
IPv6Gateway: utils.Ptr("2001:4860:4860::8888"),
61+
Routed: utils.Ptr(true),
5262
}
5363
for _, mod := range mods {
5464
mod(model)
@@ -78,15 +88,20 @@ func fixtureRequiredRequest(mods ...func(request *iaas.ApiCreateNetworkRequest))
7888

7989
func fixturePayload(mods ...func(payload *iaas.CreateNetworkPayload)) iaas.CreateNetworkPayload {
8090
payload := iaas.CreateNetworkPayload{
81-
Name: utils.Ptr("example-network-name"),
91+
Name: utils.Ptr("example-network-name"),
92+
Routed: utils.Ptr(true),
8293
AddressFamily: &iaas.CreateNetworkAddressFamily{
8394
Ipv4: &iaas.CreateNetworkIPv4Body{
8495
Nameservers: utils.Ptr([]string{"1.1.1.0", "1.1.2.0"}),
8596
PrefixLength: utils.Ptr(int64(24)),
97+
Prefix: utils.Ptr("10.1.2.0/24"),
98+
Gateway: iaas.NewNullableString(utils.Ptr("10.1.2.3")),
8699
},
87100
Ipv6: &iaas.CreateNetworkIPv6Body{
88101
Nameservers: utils.Ptr([]string{"2001:4860:4860::8888", "2001:4860:4860::8844"}),
89102
PrefixLength: utils.Ptr(int64(24)),
103+
Prefix: utils.Ptr("2001:4860:4860::8888"),
104+
Gateway: iaas.NewNullableString(utils.Ptr("2001:4860:4860::8888")),
90105
},
91106
},
92107
}
@@ -155,27 +170,69 @@ func TestParseInput(t *testing.T) {
155170
isValid: false,
156171
},
157172
{
158-
description: "use dns servers and prefix",
173+
description: "use dns servers, prefix, gateway and prefix length",
159174
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
160175
flagValues[ipv4DnsNameServersFlag] = "1.1.1.1"
161176
flagValues[ipv4PrefixLengthFlag] = "25"
177+
flagValues[ipv4PrefixFlag] = "10.1.2.0/24"
178+
flagValues[ipv4GatewayFlag] = "10.1.2.3"
162179
}),
163180
isValid: true,
164181
expectedModel: fixtureInputModel(func(model *inputModel) {
165182
model.IPv4DnsNameServers = utils.Ptr([]string{"1.1.1.1"})
166183
model.IPv4PrefixLength = utils.Ptr(int64(25))
184+
model.IPv4Prefix = utils.Ptr("10.1.2.0/24")
185+
model.IPv4Gateway = utils.Ptr("10.1.2.3")
167186
}),
168187
},
169188
{
170-
description: "use ipv6 dns servers and prefix",
189+
description: "use ipv4 gateway nil",
190+
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
191+
flagValues[noIpv4Gateway] = "true"
192+
delete(flagValues, ipv4GatewayFlag)
193+
}),
194+
isValid: true,
195+
expectedModel: fixtureInputModel(func(model *inputModel) {
196+
model.NoIPv4Gateway = true
197+
model.IPv4Gateway = nil
198+
}),
199+
},
200+
{
201+
description: "use ipv6 dns servers, prefix, gateway and prefix length",
171202
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
172203
flagValues[ipv6DnsNameServersFlag] = "2001:4860:4860::8888"
173204
flagValues[ipv6PrefixLengthFlag] = "25"
205+
flagValues[ipv6PrefixFlag] = "2001:4860:4860::8888"
206+
flagValues[ipv6GatewayFlag] = "2001:4860:4860::8888"
174207
}),
175208
isValid: true,
176209
expectedModel: fixtureInputModel(func(model *inputModel) {
177210
model.IPv6DnsNameServers = utils.Ptr([]string{"2001:4860:4860::8888"})
178211
model.IPv6PrefixLength = utils.Ptr(int64(25))
212+
model.IPv6Prefix = utils.Ptr("2001:4860:4860::8888")
213+
model.IPv6Gateway = utils.Ptr("2001:4860:4860::8888")
214+
}),
215+
},
216+
{
217+
description: "use ipv6 gateway nil",
218+
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
219+
flagValues[noIpv6Gateway] = "true"
220+
delete(flagValues, ipv6GatewayFlag)
221+
}),
222+
isValid: true,
223+
expectedModel: fixtureInputModel(func(model *inputModel) {
224+
model.NoIPv6Gateway = true
225+
model.IPv6Gateway = nil
226+
}),
227+
},
228+
{
229+
description: "use routed true",
230+
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
231+
flagValues[routedFlag] = "true"
232+
}),
233+
isValid: true,
234+
expectedModel: fixtureInputModel(func(model *inputModel) {
235+
model.Routed = utils.Ptr(true)
179236
}),
180237
},
181238
}
@@ -257,6 +314,7 @@ func TestBuildRequest(t *testing.T) {
257314
diff := cmp.Diff(request, tt.expectedRequest,
258315
cmp.AllowUnexported(tt.expectedRequest),
259316
cmpopts.EquateComparable(testCtx),
317+
cmp.AllowUnexported(iaas.NullableString{}),
260318
)
261319
if diff != "" {
262320
t.Fatalf("Data does not match: %s", diff)

internal/cmd/beta/network/describe/describe.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ func outputResult(p *print.Printer, outputFormat string, network *iaas.Network)
152152
table.AddSeparator()
153153
}
154154

155+
if network.Routed != nil {
156+
table.AddRow("ROUTED", *network.Routed)
157+
table.AddSeparator()
158+
}
159+
160+
if network.Gateway != nil {
161+
table.AddRow("IPv4 GATEWAY", *network.Gateway.Get())
162+
table.AddSeparator()
163+
}
164+
155165
if len(ipv4nameservers) > 0 {
156166
table.AddRow("IPv4 NAME SERVERS", strings.Join(ipv4nameservers, ", "))
157167
}
@@ -160,6 +170,12 @@ func outputResult(p *print.Printer, outputFormat string, network *iaas.Network)
160170
table.AddRow("IPv4 PREFIXES", strings.Join(ipv4prefixes, ", "))
161171
}
162172
table.AddSeparator()
173+
174+
if network.Gatewayv6 != nil {
175+
table.AddRow("IPv6 GATEWAY", *network.Gatewayv6.Get())
176+
table.AddSeparator()
177+
}
178+
163179
if len(ipv6nameservers) > 0 {
164180
table.AddRow("IPv6 NAME SERVERS", strings.Join(ipv6nameservers, ", "))
165181
}

internal/cmd/beta/network/list/list.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,20 @@ func outputResult(p *print.Printer, outputFormat string, networks []iaas.Network
151151
return nil
152152
default:
153153
table := tables.NewTable()
154-
table.SetHeader("ID", "Name", "Status", "Public IP")
154+
table.SetHeader("ID", "NAME", "STATUS", "PUBLIC IP", "ROUTED")
155155

156156
for _, network := range networks {
157157
publicIp := ""
158158
if network.PublicIp != nil {
159159
publicIp = *network.PublicIp
160160
}
161161

162-
table.AddRow(*network.NetworkId, *network.Name, *network.State, publicIp)
162+
routed := false
163+
if network.Routed != nil {
164+
routed = *network.Routed
165+
}
166+
167+
table.AddRow(*network.NetworkId, *network.Name, *network.State, publicIp, routed)
163168
table.AddSeparator()
164169
}
165170

0 commit comments

Comments
 (0)