Skip to content

Commit 8184132

Browse files
Hugues Morissetizissise
authored andcommitted
Add security group stateful flags
1 parent 65d3dbe commit 8184132

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

pkg/api/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ type ScalewaySecurityGroups struct {
458458
Servers []ScalewaySecurityGroup `json:"servers"`
459459
EnableDefaultSecurity bool `json:"enable_default_security"`
460460
OrganizationDefault bool `json:"organization_default"`
461+
Stateful bool `json:"stateful"`
461462
}
462463

463464
// ScalewayGetSecurityGroups represents the response of a GET /security_groups/
@@ -506,6 +507,7 @@ type ScalewayNewSecurityGroup struct {
506507
Organization string `json:"organization"`
507508
Name string `json:"name"`
508509
Description string `json:"description"`
510+
Stateful bool `json:"stateful"`
509511
}
510512

511513
// ScalewayUpdateSecurityGroup definition PUT request /security_groups
@@ -514,6 +516,7 @@ type ScalewayUpdateSecurityGroup struct {
514516
Name string `json:"name"`
515517
Description string `json:"description"`
516518
OrganizationDefault bool `json:"organization_default"`
519+
Stateful bool `json:"stateful"`
517520
}
518521

519522
// ScalewayServer represents a Scaleway server

pkg/cli/x_security-groups.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func init() {
4242
cmdSecurityGroups.Flag.BoolVar(&securityGroupsHelp, []string{"h", "-help"}, false, "Print usage")
4343
cmdSecurityGroups.Flag.StringVar(&securityGroupsName, []string{"n", "-name"}, "", "SecurityGroup's name")
4444
cmdSecurityGroups.Flag.StringVar(&securityGroupsDesc, []string{"d", "-description"}, "", "SecurityGroup's description")
45+
cmdSecurityGroups.Flag.BoolVar(&securityGroupsStateful, []string{"s", "-stateful"}, false, "is SecurityGroup stateful")
4546
subCmdSecurityGroup = map[string]func(cmd *Command, args []string) error{
4647
"list-groups": listSecurityGroup,
4748
"new-group": newSecurityGroup,
@@ -60,6 +61,7 @@ func init() {
6061
var securityGroupsHelp bool // -h, --help flag
6162
var securityGroupsName string // -n, --name flag
6263
var securityGroupsDesc string // -d, --description flag
64+
var securityGroupsStateful bool // -s, --stateful flag
6365

6466
// SubCommand
6567
var subCmdSecurityGroup map[string]func(cmd *Command, args []string) error
@@ -91,6 +93,7 @@ func newSecurityGroup(cmd *Command, args []string) error {
9193
Organization: cmd.API.Organization,
9294
Name: securityGroupsName,
9395
Description: securityGroupsDesc,
96+
Stateful: securityGroupsStateful,
9497
})
9598
}
9699

@@ -103,6 +106,7 @@ func updateSecurityGroup(cmd *Command, args []string) error {
103106
Organization: cmd.API.Organization,
104107
Name: securityGroupsName,
105108
Description: securityGroupsDesc,
109+
Stateful: securityGroupsStateful,
106110
}, args[0])
107111
}
108112

0 commit comments

Comments
 (0)