4.6.0
This commit is contained in:
@@ -189,6 +189,11 @@ func dataSourceFlipgroupsListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "by_id",
|
||||
},
|
||||
"sort_by": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
@@ -199,6 +204,29 @@ func dataSourceFlipgroupsListSchemaMake() 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,
|
||||
|
||||
@@ -69,12 +69,30 @@ func utilityFlipgroupListCheckPresence(ctx context.Context, d *schema.ResourceDa
|
||||
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 clientId, ok := d.GetOk("client_ids"); ok {
|
||||
clientIds := clientId.([]interface{})
|
||||
for _, elem := range clientIds {
|
||||
req.ClientIDs = append(req.ClientIDs, uint64(elem.(int)))
|
||||
}
|
||||
}
|
||||
if connId, ok := d.GetOk("conn_id"); ok {
|
||||
req.ConnId = uint64(connId.(int))
|
||||
}
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
|
||||
log.Debugf("utilityFlipgroupListCheckPresence: load flipgroup list")
|
||||
flipgroupList, err := c.CloudBroker().FLIPGroup().List(ctx, req)
|
||||
|
||||
Reference in New Issue
Block a user