diff --git a/examples/data-sources/hpegl_metal_available_resources/README.md b/examples/data-sources/hpegl_metal_available_resources/README.md index a3c05f7..d4f1cb2 100644 --- a/examples/data-sources/hpegl_metal_available_resources/README.md +++ b/examples/data-sources/hpegl_metal_available_resources/README.md @@ -139,12 +139,18 @@ storage-pools = [ "Name": "abtest", "LocationID": "c8b3c5a7-f81d-453a-af3a-1e6d78291bd5", "Description": "" + "StoragePoolIDs": [ + "bdbbb385-2ee3-4e71-a60a-ba712cdda37e" + ] }, { "ID": "dd253c2a-defb-41c7-b23d-f9a937c37da0", "Name": "abose-tf-test", "LocationID": "c8b3c5a7-f81d-453a-af3a-1e6d78291bd5", "Description": "" + "StoragePoolIDs": [ + "bdbbb385-2ee3-4e71-a60a-ba712cdda37e" + ] } ] ``` diff --git a/go.mod b/go.mod index d3e8fae..166dc91 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/golangci/golangci-lint v1.55.2 github.com/hashicorp/terraform-plugin-docs v0.16.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.31.0 - github.com/hewlettpackard/hpegl-metal-client v1.5.5 + github.com/hewlettpackard/hpegl-metal-client v1.5.6 github.com/hewlettpackard/hpegl-provider-lib v0.0.14 github.com/stretchr/testify v1.8.4 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index dae9f62..af80589 100644 --- a/go.sum +++ b/go.sum @@ -400,8 +400,8 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/hewlettpackard/hpegl-metal-client v1.5.5 h1:b7MkBzjX3Vydfdc+HmbpqcPLdjnpOmJLyUgF8eBnHU4= -github.com/hewlettpackard/hpegl-metal-client v1.5.5/go.mod h1:z8JEXcrqvD22jOofmU/3ZZOHBXk2yljfahDmquMRxas= +github.com/hewlettpackard/hpegl-metal-client v1.5.6 h1:hCr4AGbto86nbZqLxMbLvAmeEU7LDN7WnVTmcIZcjNM= +github.com/hewlettpackard/hpegl-metal-client v1.5.6/go.mod h1:5E6K3bq3aoBNuolGpbmeD/JuAarnXS96W/MqiHUTmFQ= github.com/hewlettpackard/hpegl-provider-lib v0.0.14 h1:fwIXQsdEdeYYvaJQr1vwfPgCGYKgZaP7kL0p8xbBQJ4= github.com/hewlettpackard/hpegl-provider-lib v0.0.14/go.mod h1:7StTTobQIl8pZCLcJnZm0/+N4lNE2MO6H/U0LhTfXog= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= diff --git a/internal/resources/datasource_available_resources.go b/internal/resources/datasource_available_resources.go index 70a4651..e4ef730 100644 --- a/internal/resources/datasource_available_resources.go +++ b/internal/resources/datasource_available_resources.go @@ -64,10 +64,11 @@ const ( spCapacity = "capacity" // For avVolumeCollections each terraform block has these attributes. - vcName = "name" - vcLocation = "location" - vcLocationID = "location_id" - vcDescription = "description" + vcName = "name" + vcLocation = "location" + vcLocationID = "location_id" + vcDescription = "description" + vcStoragePoolIDs = "storage_pool_ids" ) func locationResources() *schema.Resource { @@ -216,6 +217,14 @@ func volumeCollectionResource() *schema.Resource { Computed: true, Description: "Description of the volume collection", }, + vcStoragePoolIDs: { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Description: "A list of storage pool ids", + }, }, } } @@ -552,10 +561,11 @@ func addVolumeCollections(p *configuration.Config, d *schema.ResourceData, avail for _, vcol := range available.VolumeCollections { iData := map[string]interface{}{ - "id": vcol.ID, - vcName: vcol.Name, - vcLocationID: vcol.LocationID, - vcDescription: vcol.Description, + "id": vcol.ID, + vcName: vcol.Name, + vcLocationID: vcol.LocationID, + vcDescription: vcol.Description, + vcStoragePoolIDs: vcol.StoragePoolIDs, } iData[vLocation], _ = p.GetLocationName(vcol.LocationID)