4.3.0
This commit is contained in:
@@ -59,11 +59,6 @@ func dataSourceImageListSchemaMake() map[string]*schema.Schema {
|
||||
Optional: true,
|
||||
Description: "filter images by storage endpoint provider ID",
|
||||
},
|
||||
"shared_with": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "filter images by account ID availability",
|
||||
},
|
||||
"page": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
|
||||
@@ -82,9 +82,9 @@ func flattenHistory(history []image.History) []map[string]interface{} {
|
||||
return temp
|
||||
}
|
||||
|
||||
func flattenImageList(il image.ListImages) []map[string]interface{} {
|
||||
func flattenImageList(il *image.ListImages) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0)
|
||||
for _, item := range il {
|
||||
for _, item := range il.Data {
|
||||
temp := map[string]interface{}{
|
||||
"name": item.Name,
|
||||
"url": item.URL,
|
||||
@@ -130,9 +130,9 @@ func flattenImageList(il image.ListImages) []map[string]interface{} {
|
||||
return res
|
||||
}
|
||||
|
||||
func flattenImageListStacks(_ *schema.ResourceData, stack image.ListStacks) []map[string]interface{} {
|
||||
func flattenImageListStacks(_ *schema.ResourceData, stack *image.ListStacks) []map[string]interface{} {
|
||||
temp := make([]map[string]interface{}, 0)
|
||||
for _, item := range stack {
|
||||
for _, item := range stack.Data {
|
||||
t := map[string]interface{}{
|
||||
"api_url": item.APIURL,
|
||||
"api_key": item.APIKey,
|
||||
|
||||
@@ -41,16 +41,13 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityImageListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (image.ListImages, error) {
|
||||
func utilityImageListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*image.ListImages, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := image.ListRequest{}
|
||||
|
||||
if sepId, ok := d.GetOk("sep_id"); ok {
|
||||
req.SepID = uint64(sepId.(int))
|
||||
}
|
||||
if sharedWith, ok := d.GetOk("shared_with"); ok {
|
||||
req.SharedWith = uint64(sharedWith.(int))
|
||||
}
|
||||
|
||||
if page, ok := d.GetOk("page"); ok {
|
||||
req.Page = uint64(page.(int))
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityImageListStacksCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (image.ListStacks, error) {
|
||||
func utilityImageListStacksCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*image.ListStacks, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := image.ListStacksRequest{
|
||||
ImageID: uint64(d.Get("image_id").(int)),
|
||||
|
||||
Reference in New Issue
Block a user