From 68b01b3ce103c02bcb1f1c76a16781a723c5370a Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Tue, 5 Mar 2024 10:42:19 -0600 Subject: [PATCH 1/3] Add server_name attribute to instances data source --- .../power/data_source_ibm_pi_instances.go | 6 +++++ ibm/service/power/ibm_pi_constants.go | 25 ++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ibm/service/power/data_source_ibm_pi_instances.go b/ibm/service/power/data_source_ibm_pi_instances.go index 60ba597ed0..f37b03be3f 100644 --- a/ibm/service/power/data_source_ibm_pi_instances.go +++ b/ibm/service/power/data_source_ibm_pi_instances.go @@ -141,6 +141,11 @@ func DataSourceIBMPIInstances() *schema.Resource { Description: "The unique identifier of the instance.", Type: schema.TypeString, }, + Attr_ServerName: { + Computed: true, + Description: "The name of the instance.", + Type: schema.TypeString, + }, Attr_SharedProcessorPool: { Computed: true, Description: "The name of the shared processor pool for the instance.", @@ -225,6 +230,7 @@ func flattenPvmInstances(list []*models.PVMInstanceReference) []map[string]inter Attr_Processors: *i.Processors, Attr_ProcType: *i.ProcType, Attr_PVMInstanceID: *i.PvmInstanceID, + Attr_ServerName: i.ServerName, Attr_SharedProcessorPool: i.SharedProcessorPool, Attr_SharedProcessorPoolID: i.SharedProcessorPoolID, Attr_Status: *i.Status, diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index d564ce2586..c06f0b7d80 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -181,28 +181,29 @@ const ( Attr_ResultsVolumeOnboardingFailures = "results_volume_onboarding_failures" Attr_SPPPlacementGroups = "spp_placement_groups" Attr_SSHKey = "ssh_key" + Attr_ServerName = "server_name" Attr_Shareable = "shreable" Attr_SharedCoreRatio = "shared_core_ratio" Attr_SharedProcessorPool = "shared_processor_pool" - Attr_SharedProcessorPoolID = "shared_processor_pool_id" - Attr_SharedProcessorPoolPlacementGroups = "spp_placement_groups" - Attr_SharedProcessorPoolStatus = "status" - Attr_SharedProcessorPools = "shared_processor_pools" - Attr_SharedProcessorPoolName = "name" - Attr_SharedProcessorPoolHostID = "host_id" - Attr_SharedProcessorPoolReservedCores = "reserved_cores" - Attr_SharedProcessorPoolAvailableCores = "available_cores" Attr_SharedProcessorPoolAllocatedCores = "allocated_cores" - Attr_SharedProcessorPoolStatusDetail = "status_detail" - Attr_SharedProcessorPoolInstances = "instances" - Attr_SharedProcessorPoolInstanceCpus = "cpus" - Attr_SharedProcessorPoolInstanceUncapped = "uncapped" + Attr_SharedProcessorPoolAvailableCores = "available_cores" + Attr_SharedProcessorPoolHostID = "host_id" + Attr_SharedProcessorPoolID = "shared_processor_pool_id" Attr_SharedProcessorPoolInstanceAvailabilityZone = "availability_zone" + Attr_SharedProcessorPoolInstanceCpus = "cpus" Attr_SharedProcessorPoolInstanceId = "id" Attr_SharedProcessorPoolInstanceMemory = "memory" Attr_SharedProcessorPoolInstanceName = "name" Attr_SharedProcessorPoolInstanceStatus = "status" + Attr_SharedProcessorPoolInstanceUncapped = "uncapped" Attr_SharedProcessorPoolInstanceVcpus = "vcpus" + Attr_SharedProcessorPoolInstances = "instances" + Attr_SharedProcessorPoolName = "name" + Attr_SharedProcessorPoolPlacementGroups = "spp_placement_groups" + Attr_SharedProcessorPoolReservedCores = "reserved_cores" + Attr_SharedProcessorPoolStatus = "status" + Attr_SharedProcessorPoolStatusDetail = "status_detail" + Attr_SharedProcessorPools = "shared_processor_pools" Attr_Size = "size" Attr_SourceVolumeName = "source_volume_name" Attr_Speed = "speed" From c177e5151e5c923551fbe1e18136aa79c7d9a1f6 Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Tue, 5 Mar 2024 10:42:36 -0600 Subject: [PATCH 2/3] Update instances data source documentation --- website/docs/d/pi_instances.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/d/pi_instances.html.markdown b/website/docs/d/pi_instances.html.markdown index 504f037252..b03dc62a76 100644 --- a/website/docs/d/pi_instances.html.markdown +++ b/website/docs/d/pi_instances.html.markdown @@ -65,6 +65,7 @@ In addition to all argument reference list, you can access the following attribu - `processors` - (Float) The number of processors that are allocated to the instance. - `proctype` - (String) The procurement type of the instance. Supported values are `shared` and `dedicated`. - `pvm_instance_id` - (String) The unique identifier of the instance. + - `server_name` - (String) The name of the instance. - `shared_processor_pool`- (String) The name of the shared processor pool for the instance. - `shared_processor_pool_id` - (String) The ID of the shared processor pool for the instance. - `status` - (String) The status of the instance. From c9c6d3528d9c226029ef02a4aa1d79f00c631ad3 Mon Sep 17 00:00:00 2001 From: Axel Ismirlian Date: Tue, 5 Mar 2024 17:27:14 -0600 Subject: [PATCH 3/3] Add server_name attribute to instance data source --- ibm/service/power/data_source_ibm_pi_instance.go | 6 ++++++ website/docs/d/pi_instance.html.markdown | 1 + 2 files changed, 7 insertions(+) diff --git a/ibm/service/power/data_source_ibm_pi_instance.go b/ibm/service/power/data_source_ibm_pi_instance.go index faa7f7b251..0ee20ee127 100644 --- a/ibm/service/power/data_source_ibm_pi_instance.go +++ b/ibm/service/power/data_source_ibm_pi_instance.go @@ -161,6 +161,11 @@ func DataSourceIBMPIInstance() *schema.Resource { Description: "The procurement type of the instance. Supported values are shared and dedicated.", Type: schema.TypeString, }, + Attr_ServerName: { + Computed: true, + Description: "The name of the instance.", + Type: schema.TypeString, + }, Attr_SharedProcessorPool: { Computed: true, Description: "The name of the shared processor pool for the instance.", @@ -235,6 +240,7 @@ func dataSourceIBMPIInstancesRead(ctx context.Context, d *schema.ResourceData, m d.Set(Attr_PinPolicy, powervmdata.PinPolicy) d.Set(Attr_Processors, powervmdata.Processors) d.Set(Attr_ProcType, powervmdata.ProcType) + d.Set(Attr_ServerName, powervmdata.ServerName) d.Set(Attr_SharedProcessorPool, powervmdata.SharedProcessorPool) d.Set(Attr_SharedProcessorPoolID, powervmdata.SharedProcessorPoolID) d.Set(Attr_Status, powervmdata.Status) diff --git a/website/docs/d/pi_instance.html.markdown b/website/docs/d/pi_instance.html.markdown index 09b881eec6..7bb3db0130 100644 --- a/website/docs/d/pi_instance.html.markdown +++ b/website/docs/d/pi_instance.html.markdown @@ -71,6 +71,7 @@ In addition to all argument reference list, you can access the following attribu - `placement_group_id`- (String) The ID of the placement group that the instance is a member. - `processors` - (Float) The number of processors that are allocated to the instance. - `proctype` - (String) The procurement type of the instance. Supported values are `shared` and `dedicated`. +- `server_name` - (String) The name of the instance. - `shared_processor_pool`- (String) The name of the shared processor pool for the instance. - `shared_processor_pool_id` - (String) The ID of the shared processor pool for the instance. - `status` - (String) The status of the instance.