|
4 | 4 | "context" |
5 | 5 | "fmt" |
6 | 6 | "strings" |
7 | | - "time" |
8 | 7 |
|
9 | 8 | "github.com/spf13/cobra" |
10 | 9 | "github.com/stackitcloud/stackit-cli/internal/cmd/params" |
@@ -56,11 +55,11 @@ func NewCmd(params *params.CmdParams) *cobra.Command { |
56 | 55 | `stackit routing-table create --organization-id xxx --network-area-id yyy --name "rt" --description "some description"`, |
57 | 56 | ), |
58 | 57 | examples.NewExample( |
59 | | - "Create a routing-table with name `rt` with system_routes disabled", |
| 58 | + "Create a routing-table with name `rt` with system routes disabled", |
60 | 59 | `stackit routing-table create --organization-id xxx --network-area-id yyy --name "rt" --non-system-routes`, |
61 | 60 | ), |
62 | 61 | examples.NewExample( |
63 | | - "Create a routing-table with name `rt` with dynamic_routes disabled", |
| 62 | + "Create a routing-table with name `rt` with dynamic routes disabled", |
64 | 63 | `stackit routing-table create --organization-id xxx --network-area-id yyy --name "rt" --non-dynamic-routes`, |
65 | 64 | ), |
66 | 65 | ), |
@@ -175,28 +174,18 @@ func outputResult(p *print.Printer, outputFormat string, routingTable *iaas.Rout |
175 | 174 | } |
176 | 175 | } |
177 | 176 |
|
178 | | - createdAt := "" |
179 | | - if routingTable.CreatedAt != nil { |
180 | | - createdAt = routingTable.CreatedAt.Format(time.RFC3339) |
181 | | - } |
182 | | - |
183 | | - updatedAt := "" |
184 | | - if routingTable.UpdatedAt != nil { |
185 | | - updatedAt = routingTable.UpdatedAt.Format(time.RFC3339) |
186 | | - } |
187 | | - |
188 | 177 | table := tables.NewTable() |
189 | | - table.SetHeader("ID", "NAME", "DESCRIPTION", "CREATED_AT", "UPDATED_AT", "DEFAULT", "LABELS", "SYSTEM_ROUTES", "DYNAMIC_ROUTES") |
| 178 | + table.SetHeader("ID", "NAME", "DESCRIPTION", "DEFAULT", "LABELS", "SYSTEM ROUTES", "DYNAMIC ROUTES", "CREATED AT", "UPDATED AT") |
190 | 179 | table.AddRow( |
191 | 180 | utils.PtrString(routingTable.Id), |
192 | 181 | utils.PtrString(routingTable.Name), |
193 | 182 | utils.PtrString(routingTable.Description), |
194 | | - createdAt, |
195 | | - updatedAt, |
196 | 183 | utils.PtrString(routingTable.Default), |
197 | 184 | strings.Join(labels, "\n"), |
198 | 185 | utils.PtrString(routingTable.SystemRoutes), |
199 | 186 | utils.PtrString(routingTable.DynamicRoutes), |
| 187 | + utils.ConvertTimePToDateTimeString(routingTable.CreatedAt), |
| 188 | + utils.ConvertTimePToDateTimeString(routingTable.UpdatedAt), |
200 | 189 | ) |
201 | 190 |
|
202 | 191 | err := table.Display(p) |
|
0 commit comments