@@ -22,6 +22,7 @@ const (
2222 nameFlag = "name"
2323 networkAreaIdFlag = "network-area-id"
2424 nonDynamicRoutesFlag = "non-dynamic-routes"
25+ nonSystemRoutesFlag = "non-system-routes"
2526 organizationIdFlag = "organization-id"
2627 routingTableIdArg = "ROUTING_TABLE_ID"
2728)
@@ -31,6 +32,7 @@ type inputModel struct {
3132 OrganizationId string
3233 NetworkAreaId string
3334 NonDynamicRoutes bool
35+ NonSystemRoutes bool
3436 RoutingTableId string
3537 Description * string
3638 Labels * map [string ]string
@@ -60,6 +62,10 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
6062 `Disables the dynamic routes of a routing-table with ID "xxx" in organization with ID "yyy" and network-area with ID "zzz"` ,
6163 "$ stackit routing-table update xxx --organization-id yyy --network-area-id zzz --non-dynamic-routes" ,
6264 ),
65+ examples .NewExample (
66+ `Disables the system routes of a routing-table with ID "xxx" in organization with ID "yyy" and network-area with ID "zzz"` ,
67+ "$ stackit routing-table update xxx --organization-id yyy --network-area-id zzz --non-system-routes" ,
68+ ),
6369 ),
6470 RunE : func (cmd * cobra.Command , args []string ) error {
6571 ctx := context .Background ()
@@ -101,6 +107,7 @@ func configureFlags(cmd *cobra.Command) {
101107 cmd .Flags ().StringToString (labelFlag , nil , "Key=value labels" )
102108 cmd .Flags ().Var (flags .UUIDFlag (), networkAreaIdFlag , "Network-Area ID" )
103109 cmd .Flags ().Bool (nonDynamicRoutesFlag , false , "If true, preventing dynamic routes from propagating to the routing-table." )
110+ cmd .Flags ().Bool (nonSystemRoutesFlag , false , "If true, automatically disables routes for project-to-project communication." )
104111 cmd .Flags ().Var (flags .UUIDFlag (), organizationIdFlag , "Organization ID" )
105112
106113 err := flags .MarkFlagsRequired (cmd , organizationIdFlag , networkAreaIdFlag )
@@ -119,6 +126,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
119126 Name : flags .FlagToStringPointer (p , cmd , nameFlag ),
120127 NetworkAreaId : flags .FlagToStringValue (p , cmd , networkAreaIdFlag ),
121128 NonDynamicRoutes : flags .FlagToBoolValue (p , cmd , nonDynamicRoutesFlag ),
129+ NonSystemRoutes : flags .FlagToBoolValue (p , cmd , nonSystemRoutesFlag ),
122130 OrganizationId : flags .FlagToStringValue (p , cmd , organizationIdFlag ),
123131 RoutingTableId : routeTableId ,
124132 }
@@ -152,12 +160,14 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *iaas.APICli
152160 )
153161
154162 dynamicRoutes := ! model .NonDynamicRoutes
163+ systemRoutes := ! model .NonSystemRoutes
155164
156165 payload := iaas.UpdateRoutingTableOfAreaPayload {
157166 Labels : utils .ConvertStringMapToInterfaceMap (model .Labels ),
158167 Name : model .Name ,
159168 Description : model .Description ,
160169 DynamicRoutes : & dynamicRoutes ,
170+ SystemRoutes : & systemRoutes ,
161171 }
162172
163173 return req .UpdateRoutingTableOfAreaPayload (payload )
0 commit comments