Skip to content

Commit

Permalink
Add server_name to instance and instances data source (#5184)
Browse files Browse the repository at this point in the history
* Add server_name attribute to instances data source

* Update instances data source documentation

* Add server_name attribute to instance data source
  • Loading branch information
ismirlia authored Mar 13, 2024
1 parent b44cfc5 commit b5c27a5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
6 changes: 6 additions & 0 deletions ibm/service/power/data_source_ibm_pi_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions ibm/service/power/data_source_ibm_pi_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 13 additions & 12 deletions ibm/service/power/ibm_pi_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/pi_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/pi_instances.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b5c27a5

Please sign in to comment.