diff --git a/ibm/service/power/data_source_ibm_pi_host.go b/ibm/service/power/data_source_ibm_pi_host.go index 0b6ea2c7e6..4ff6aa16c7 100644 --- a/ibm/service/power/data_source_ibm_pi_host.go +++ b/ibm/service/power/data_source_ibm_pi_host.go @@ -94,6 +94,11 @@ func DataSourceIBMPIHost() *schema.Resource { Description: "Link to host group resource.", Type: schema.TypeMap, }, + Attr_HostReference: { + Computed: true, + Description: "Current physical ID of the host.", + Type: schema.TypeInt, + }, Attr_State: { Computed: true, Description: "State of the host (up/down).", @@ -137,6 +142,9 @@ func dataSourceIBMPIHostRead(ctx context.Context, d *schema.ResourceData, meta i if host.HostGroup != nil { d.Set(Attr_HostGroup, hostGroupToMap(host.HostGroup)) } + if host.HostReference != 0 { + d.Set(Attr_HostReference, host.HostReference) + } if host.State != "" { d.Set(Attr_State, host.State) } diff --git a/ibm/service/power/data_source_ibm_pi_hosts.go b/ibm/service/power/data_source_ibm_pi_hosts.go index c7476bec05..9b27903b1e 100644 --- a/ibm/service/power/data_source_ibm_pi_hosts.go +++ b/ibm/service/power/data_source_ibm_pi_hosts.go @@ -97,6 +97,11 @@ func DataSourceIBMPIHosts() *schema.Resource { Description: "Link to host group resource.", Type: schema.TypeMap, }, + Attr_HostReference: { + Computed: true, + Description: "Current physical ID of the host.", + Type: schema.TypeInt, + }, Attr_State: { Computed: true, Description: "State of the host (up/down).", @@ -151,6 +156,9 @@ func dataSourceIBMPIHostsRead(ctx context.Context, d *schema.ResourceData, meta if host.HostGroup != nil { hs[Attr_HostGroup] = hostGroupToMap(host.HostGroup) } + if host.HostReference != 0 { + hs[Attr_HostReference] = host.HostReference + } if host.State != "" { hs[Attr_State] = host.State } diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 45c39a5ce3..60276b9604 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -216,6 +216,7 @@ const ( Attr_HostGroupID = "host_group_id" Attr_HostGroups = "host_groups" Attr_HostID = "host_id" + Attr_HostReference = "host_reference" Attr_Hosts = "hosts" Attr_Href = "href" Attr_Hypervisor = "hypervisor" diff --git a/website/docs/d/pi_host.html.markdown b/website/docs/d/pi_host.html.markdown index 721c7bd065..1d0d4c1834 100644 --- a/website/docs/d/pi_host.html.markdown +++ b/website/docs/d/pi_host.html.markdown @@ -50,14 +50,14 @@ After your data source is created, you can read values from the following attrib - `capacity` - (List) Capacities of the host. Nested schema for `capacity`: - - `available_core` - (Float) Number of cores currently available. - - `available_memory` - (Float) Amount of memory currently available (in GB). - - `reserved_core` - (Float) Number of cores reserved for system use. - - `reserved_memory` - (Float) Amount of memory reserved for system use (in GB). - - `total_core` - (Float) Total number of cores of the host. - - `total_memory` - (Float) Total amount of memory of the host (in GB). - - `used_core` - (Float) Number of cores in use on the host. - - `used_memory` - (Float) Amount of memory used on the host (in GB). + - `available_core` - (Float) Number of cores currently available. + - `available_memory` - (Float) Amount of memory currently available (in GB). + - `reserved_core` - (Float) Number of cores reserved for system use. + - `reserved_memory` - (Float) Amount of memory reserved for system use (in GB). + - `total_core` - (Float) Total number of cores of the host. + - `total_memory` - (Float) Total amount of memory of the host (in GB). + - `used_core` - (Float) Number of cores in use on the host. + - `used_memory` - (Float) Amount of memory used on the host (in GB). - `display_name` - (String) Name of the host. - `host_group` - (Map) Information about the owning host group. @@ -66,11 +66,8 @@ After your data source is created, you can read values from the following attrib - `access` - (String) Whether the host group is a primary or secondary host group. - `href` - (String) Link to the host group resource. - `name` - (String) Name of the host group. - +- `host_reference` - (Integer) Current physical ID of the host. - `state` - (String) State of the host `up` or `down`. - - `id` - (String) The unique identifier of the host. - - `status` - (String) Status of the host `enabled` or `disabled`. - - `sys_type` - (String) System type. diff --git a/website/docs/d/pi_hosts.html.markdown b/website/docs/d/pi_hosts.html.markdown index 460f7e8fd1..e44357e294 100644 --- a/website/docs/d/pi_hosts.html.markdown +++ b/website/docs/d/pi_hosts.html.markdown @@ -68,6 +68,7 @@ After your data source is created, you can read values from the following attrib - `href` - (String) Link to the host group resource. - `name` - (String) Name of the host group. - `host_id` - (String) ID of the host. + - `host_reference` - (Integer) Current physical ID of the host. - `id` - (String) The unique identifier of the pi_hosts. - `state` - (String) State of the host `up` or `down`. - `status` - (String) Status of the host `enabled` or `disabled`.