github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/dcs/v2/whitelists/results.go (about) 1 package whitelists 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 ) 6 7 // WhitelistGroup is a struct that contains the whitelist parameters. 8 type WhitelistGroup struct { 9 // the group name 10 GroupName string `json:"group_name"` 11 // list of IP address or range 12 IPList []string `json:"ip_list"` 13 } 14 15 // Whitelist is a struct that contains all the whitelist parameters. 16 type Whitelist struct { 17 // instance id 18 InstanceID string `json:"instance_id"` 19 // enable or disable the whitelists 20 Enable bool `json:"enable_whitelist"` 21 // list of whitelist groups 22 Groups []WhitelistGroup `json:"whitelist"` 23 } 24 25 // PutResult is a struct from which can get the result of put method 26 type PutResult struct { 27 golangsdk.ErrResult 28 } 29 30 // WhitelistResult is a struct from which can get the result of get method 31 type WhitelistResult struct { 32 golangsdk.Result 33 } 34 35 // Extract from WhitelistResult 36 func (r WhitelistResult) Extract() (*Whitelist, error) { 37 var s Whitelist 38 err := r.Result.ExtractInto(&s) 39 return &s, err 40 }