4.6.0
This commit is contained in:
@@ -95,6 +95,11 @@ func dataSourceFlipgroupListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "Filter by RG ID",
|
||||
},
|
||||
"sort_by": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
@@ -105,6 +110,29 @@ func dataSourceFlipgroupListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
"account_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Account id",
|
||||
},
|
||||
"conn_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Conn id",
|
||||
},
|
||||
"client_ids": {
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "client_ids",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Status",
|
||||
},
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
|
||||
@@ -153,38 +153,48 @@ func utilityFlipgroupListCheckPresence(ctx context.Context, d *schema.ResourceDa
|
||||
if name, ok := d.GetOk("name"); ok {
|
||||
req.Name = name.(string)
|
||||
}
|
||||
|
||||
if vinsId, ok := d.GetOk("vins_id"); ok {
|
||||
req.VINSID = uint64(vinsId.(int))
|
||||
}
|
||||
|
||||
if vinsName, ok := d.GetOk("vins_name"); ok {
|
||||
req.VINSName = vinsName.(string)
|
||||
}
|
||||
|
||||
if extNetId, ok := d.GetOk("extnet_id"); ok {
|
||||
req.ExtNetID = uint64(extNetId.(int))
|
||||
}
|
||||
|
||||
if byIp, ok := d.GetOk("by_ip"); ok {
|
||||
req.ByIP = byIp.(string)
|
||||
}
|
||||
|
||||
if rgId, ok := d.GetOk("rg_id"); ok {
|
||||
req.RGID = uint64(rgId.(int))
|
||||
}
|
||||
|
||||
if byId, ok := d.GetOk("by_id"); ok {
|
||||
req.ByID = uint64(byId.(int))
|
||||
}
|
||||
|
||||
if sortBy, ok := d.GetOk("sort_by"); ok {
|
||||
req.SortBy = sortBy.(string)
|
||||
}
|
||||
if page, ok := d.GetOk("page"); ok {
|
||||
req.Page = uint64(page.(int))
|
||||
}
|
||||
|
||||
if size, ok := d.GetOk("size"); ok {
|
||||
req.Size = uint64(size.(int))
|
||||
}
|
||||
if accountId, ok := d.GetOk("account_id"); ok {
|
||||
req.AccountId = uint64(accountId.(int))
|
||||
}
|
||||
if connId, ok := d.GetOk("conn_id"); ok {
|
||||
req.ConnId = uint64(connId.(int))
|
||||
}
|
||||
if cliensId, ok := d.GetOk("client_ids"); ok {
|
||||
cliensIds := cliensId.([]interface{})
|
||||
for _, elem := range cliensIds {
|
||||
req.ClientIDs = append(req.ClientIDs, uint64(elem.(int)))
|
||||
}
|
||||
}
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
|
||||
fg_list, err := c.CloudAPI().FLIPGroup().List(ctx, req)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user