@@ -25,12 +25,7 @@ import (
2525const (
2626 instanceIdArg = "INSTANCE_ID"
2727
28- sourceIpFlag = "sourceIp"
29- directionFlag = "direction"
30- descriptionFlag = "description"
31- etherTypeFlag = "etherType"
32- portRangeFlag = "portRange"
33- protocolFlag = "protocol"
28+ sourceIpFlag = "sourceIp"
3429)
3530
3631type inputModel struct {
@@ -107,11 +102,6 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
107102
108103func configureFlags (cmd * cobra.Command ) {
109104 cmd .Flags ().StringP (sourceIpFlag , "s" , "" , "The IP (CIDR) to which the rule applies (e.g. 192.168.0.1/32)" )
110- cmd .Flags ().StringP (directionFlag , "d" , "" , "Direction (the direction of the traffic, typically ingress or egress, for security rules type)" )
111- cmd .Flags ().StringP (descriptionFlag , "D" , "" , "Description" )
112- cmd .Flags ().StringP (etherTypeFlag , "e" , "" , "Specifies the bound of the rule (for security rules type)" )
113- cmd .Flags ().StringP (portRangeFlag , "r" , "" , "Port range (the Port range to which the rule applies, for security rules type)" )
114- cmd .Flags ().String (protocolFlag , "" , "The network protocol (e.g. TCP, UDP, ICMP, for security rules type)" )
115105
116106 err := flags .MarkFlagsRequired (cmd , sourceIpFlag )
117107 cobra .CheckErr (err )
@@ -133,12 +123,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
133123 GlobalFlagModel : globalFlags ,
134124 InstanceId : instanceId ,
135125
136- SourceIp : flags .FlagToStringPointer (p , cmd , sourceIpFlag ),
137- Direction : flags .FlagToStringPointer (p , cmd , directionFlag ),
138- Description : flags .FlagToStringPointer (p , cmd , descriptionFlag ),
139- EtherType : flags .FlagToStringPointer (p , cmd , etherTypeFlag ),
140- PortRange : flags .FlagToStringPointer (p , cmd , portRangeFlag ),
141- Protocol : flags .FlagToStringPointer (p , cmd , protocolFlag ),
126+ SourceIp : flags .FlagToStringPointer (p , cmd , sourceIpFlag ),
142127 }
143128
144129 p .DebugInputModel (model )
@@ -148,14 +133,8 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
148133func buildRequest (ctx context.Context , model * inputModel , apiClient * ufw.APIClient ) ufw.ApiUpdateRuleRequest {
149134 req := apiClient .DefaultAPI .UpdateRule (ctx , model .ProjectId , model .Region , model .InstanceId )
150135
151- // TODO - add logic for field checking: existing ACLs, correct product, type, instanceID maybe
152-
153136 req = req .UpdateRulePayload (ufw.UpdateRulePayload {
154- SourceIP : * model .SourceIp ,
155- Direction : model .Direction ,
156- EtherType : model .EtherType ,
157- PortRange : model .PortRange ,
158- Protocol : model .Protocol ,
137+ SourceIP : * model .SourceIp ,
159138 })
160139
161140 return req
0 commit comments