From a2df21a6aade5f50b70e0cf568f654ee1c3718a8 Mon Sep 17 00:00:00 2001 From: michaelkad Date: Tue, 5 Mar 2024 10:46:39 -0600 Subject: [PATCH] Add support_systems for sap profile --- go.mod | 5 ++- go.sum | 10 +++-- .../power/data_source_ibm_pi_sap_profile.go | 30 ++++++++++++++ .../power/data_source_ibm_pi_sap_profiles.go | 40 ++++++++++++++++--- ibm/service/power/ibm_pi_constants.go | 11 ++++- website/docs/d/pi_sap_profile.html.markdown | 27 +++++++++---- website/docs/d/pi_sap_profiles.html.markdown | 26 ++++++++---- 7 files changed, 121 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index a7a84d94c55..e5df8005459 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240216115622-a311507b4b5b - github.com/IBM-Cloud/power-go-client v1.6.0 + github.com/IBM-Cloud/power-go-client v1.6.0-beta9 github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca github.com/IBM/appconfiguration-go-admin-sdk v0.3.0 github.com/IBM/appid-management-go-sdk v0.0.0-20210908164609-dd0e0eaf732f @@ -65,6 +65,7 @@ require ( github.com/IBM/go-sdk-core v1.1.0 github.com/IBM/mqcloud-go-sdk v0.0.4 github.com/IBM/sarama v1.41.2 + github.com/IBM/vmware-go-sdk v0.1.2 github.com/stretchr/testify v1.9.0 k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 sigs.k8s.io/controller-runtime v0.14.1 @@ -210,7 +211,7 @@ require ( golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.23.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect diff --git a/go.sum b/go.sum index a0397807cca..61a6690354e 100644 --- a/go.sum +++ b/go.sum @@ -106,8 +106,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20240402122236-5c5b994a3f1a/go.mod h1:/7h github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240216115622-a311507b4b5b h1:Wnq0BuprazpP41+nQlRpxpmAs8+8jyOqU50KrvFdJQ4= github.com/IBM-Cloud/container-services-go-sdk v0.0.0-20240216115622-a311507b4b5b/go.mod h1:xUQL9SGAjoZFd4GNjrjjtEpjpkgU7RFXRyHesbKTjiY= github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.5.3/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs= -github.com/IBM-Cloud/power-go-client v1.6.0 h1:X+QX+WSF66+aouyaf4r+IeBLXUurAJj9+Bd+vH7G5I0= -github.com/IBM-Cloud/power-go-client v1.6.0/go.mod h1:0ad5Lcq1utoYVJx0uqooMjCpUaYaK0ItP9QJYtY6k0Y= +github.com/IBM-Cloud/power-go-client v1.6.0-beta9 h1:yMF53vAVoxapFEqJEIFCqx8bAjC/ZA6gbPqId3Gj4NI= +github.com/IBM-Cloud/power-go-client v1.6.0-beta9/go.mod h1:ucyaXsQxyssFFIbWT01uAA5784aKcU7u+q31yu04Rs4= github.com/IBM-Cloud/softlayer-go v1.0.5-tf h1:koUAyF9b6X78lLLruGYPSOmrfY2YcGYKOj/Ug9nbKNw= github.com/IBM-Cloud/softlayer-go v1.0.5-tf/go.mod h1:6HepcfAXROz0Rf63krk5hPZyHT6qyx2MNvYyHof7ik4= github.com/IBM/apigateway-go-sdk v0.0.0-20210714141226-a5d5d49caaca h1:crniVcf+YcmgF03NmmfonXwSQ73oJF+IohFYBwknMxs= @@ -172,6 +172,8 @@ github.com/IBM/schematics-go-sdk v0.2.3 h1:lgTt0Sbudii3cuSk1YSQgrtiZAXDbBABAoVj3 github.com/IBM/schematics-go-sdk v0.2.3/go.mod h1:Tw2OSAPdpC69AxcwoyqcYYaGTTW6YpERF9uNEU+BFRQ= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.4 h1:xa9e+POVqaXxXHXkSMCOVAbKdUNEu86jQmo5hcpd+L4= github.com/IBM/secrets-manager-go-sdk/v2 v2.0.4/go.mod h1:5gq8D8uWOIbqOm1uztay6lpOysgJaxxEsaVZLWGWb40= +github.com/IBM/vmware-go-sdk v0.1.2 h1:5lKWFyInWz9e2hwGsoFTEoLa1jYkD30SReN0fQ10w9M= +github.com/IBM/vmware-go-sdk v0.1.2/go.mod h1:2UGPBJju3jiv5VKKBBm9a5L6bzF/aJdKOKAzJ7HaOjA= github.com/IBM/vpc-beta-go-sdk v0.6.0 h1:wfM3AcW3zOM3xsRtZ+EA6+sESlGUjQ6Yf4n5QQyz4uc= github.com/IBM/vpc-beta-go-sdk v0.6.0/go.mod h1:fzHDAQIqH/5yJmYsKodKHLcqxMDT+yfH6vZjdiw8CQA= github.com/IBM/vpc-go-sdk v0.50.0 h1:+vnXYK0FXFXYqaS/5/X1XEqH0bbRotkzkerRk21ZEjE= @@ -1910,8 +1912,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/ibm/service/power/data_source_ibm_pi_sap_profile.go b/ibm/service/power/data_source_ibm_pi_sap_profile.go index 1f53d1ad724..83029eaaef8 100644 --- a/ibm/service/power/data_source_ibm_pi_sap_profile.go +++ b/ibm/service/power/data_source_ibm_pi_sap_profile.go @@ -43,16 +43,42 @@ func DataSourceIBMPISAPProfile() *schema.Resource { Description: "Amount of cores.", Type: schema.TypeInt, }, + Attr_FullSystemProfile: { + Computed: true, + Description: "Requires full system for deployment.", + Type: schema.TypeBool, + }, Attr_Memory: { Computed: true, Description: "Amount of memory (in GB).", Type: schema.TypeInt, }, + Attr_SAPS: { + Computed: true, + Description: "SAP Application Performance Standard", + Type: schema.TypeInt, + }, + Attr_SupportedSystems: { + Computed: true, + Description: "List of supported systems.", + Type: schema.TypeList, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, Attr_Type: { Computed: true, Description: "Type of profile.", Type: schema.TypeString, }, + Attr_WorkloadType: { + Computed: true, + Description: "Workload Type.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Type: schema.TypeList, + }, }, } } @@ -76,8 +102,12 @@ func dataSourceIBMPISAPProfileRead(ctx context.Context, d *schema.ResourceData, d.SetId(*sapProfile.ProfileID) d.Set(Attr_Certified, *sapProfile.Certified) d.Set(Attr_Cores, *sapProfile.Cores) + d.Set(Attr_FullSystemProfile, *sapProfile.FullSystemProfile) d.Set(Attr_Memory, *sapProfile.Memory) + d.Set(Attr_SAPS, *sapProfile.Saps) + d.Set(Attr_SupportedSystems, sapProfile.SupportedSystems) d.Set(Attr_Type, *sapProfile.Type) + d.Set(Attr_WorkloadType, *&sapProfile.WorkloadTypes) return nil } diff --git a/ibm/service/power/data_source_ibm_pi_sap_profiles.go b/ibm/service/power/data_source_ibm_pi_sap_profiles.go index a3c3c5f5a6e..bf04898e891 100644 --- a/ibm/service/power/data_source_ibm_pi_sap_profiles.go +++ b/ibm/service/power/data_source_ibm_pi_sap_profiles.go @@ -43,6 +43,11 @@ func DataSourceIBMPISAPProfiles() *schema.Resource { Description: "Amount of cores.", Type: schema.TypeInt, }, + Attr_FullSystemProfile: { + Computed: true, + Description: "Requires full system for deployment.", + Type: schema.TypeBool, + }, Attr_Memory: { Computed: true, Description: "Amount of memory (in GB).", @@ -53,11 +58,32 @@ func DataSourceIBMPISAPProfiles() *schema.Resource { Description: "SAP Profile ID.", Type: schema.TypeString, }, + Attr_SAPS: { + Computed: true, + Description: "SAP Application Performance Standard", + Type: schema.TypeInt, + }, + Attr_SupportedSystems: { + Computed: true, + Description: "List of supported systems.", + Type: schema.TypeList, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, Attr_Type: { Computed: true, Description: "Type of profile.", Type: schema.TypeString, }, + Attr_WorkloadType: { + Computed: true, + Description: "Workload Type.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Type: schema.TypeList, + }, }, }, Type: schema.TypeList, @@ -84,11 +110,15 @@ func dataSourceIBMPISAPProfilesRead(ctx context.Context, d *schema.ResourceData, result := make([]map[string]interface{}, 0, len(sapProfiles.Profiles)) for _, sapProfile := range sapProfiles.Profiles { profile := map[string]interface{}{ - Attr_Certified: *sapProfile.Certified, - Attr_Cores: *sapProfile.Cores, - Attr_Memory: *sapProfile.Memory, - Attr_ProfileID: *sapProfile.ProfileID, - Attr_Type: *sapProfile.Type, + Attr_Certified: *sapProfile.Certified, + Attr_Cores: *sapProfile.Cores, + Attr_FullSystemProfile: *sapProfile.FullSystemProfile, + Attr_Memory: *sapProfile.Memory, + Attr_ProfileID: *sapProfile.ProfileID, + Attr_SAPS: *sapProfile.Saps, + Attr_SupportedSystems: sapProfile.SupportedSystems, + Attr_Type: *sapProfile.Type, + Attr_WorkloadType: *&sapProfile.WorkloadTypes, } result = append(result, profile) } diff --git a/ibm/service/power/ibm_pi_constants.go b/ibm/service/power/ibm_pi_constants.go index 8cb883ed137..c4b0a194195 100644 --- a/ibm/service/power/ibm_pi_constants.go +++ b/ibm/service/power/ibm_pi_constants.go @@ -113,6 +113,7 @@ const ( Attr_FlashCopyMappings = "flash_copy_mappings" Attr_FlashCopyName = "flash_copy_name" Attr_FreezeTime = "freeze_time" + Attr_FullSystemProfile = "full_system_profile" Attr_Gateway = "gateway" Attr_GlobalRouting = "global_routing" Attr_GreDestinationAddress = "gre_destination_address" @@ -218,6 +219,7 @@ const ( Attr_ReservedCores = "reserved_cores" Attr_ResultsOnboardedVolumes = "results_onboarded_volumes" Attr_ResultsVolumeOnboardingFailures = "results_volume_onboarding_failures" + Attr_SAPS = "saps" Attr_ServerName = "server_name" Attr_Shareable = "shreable" Attr_SharedCoreRatio = "shared_core_ratio" @@ -260,6 +262,7 @@ const ( Attr_StoragePoolsCapacity = "storage_pools_capacity" Attr_StorageType = "storage_type" Attr_StorageTypesCapacity = "storage_types_capacity" + Attr_SupportedSystems = "supported_systems" Attr_Synchronized = "synchronized" Attr_SystemPoolName = "system_pool_name" Attr_SystemPools = "system_pools" @@ -296,11 +299,14 @@ const ( Attr_WorkspaceID = "pi_workspace_id" Attr_WorkspaceLocation = "pi_workspace_location" Attr_WorkspaceName = "pi_workspace_name" + Attr_WorkloadType = "workload_type" Attr_Workspaces = "workspaces" Attr_WorkspaceStatus = "pi_workspace_status" Attr_WorkspaceType = "pi_workspace_type" Attr_WWN = "wwn" - OS_IBMI = "ibmi" + + // Instance + OS_IBMI = "ibmi" // TODO: Second Half Cleanup, remove extra variables @@ -344,6 +350,9 @@ const ( PIInstanceUserData = "pi_user_data" PIInstanceVolumeIds = "pi_volume_ids" + Attr_PIInstanceSharedProcessorPool = "shared_processor_pool" + Attr_PIInstanceSharedProcessorPoolID = "shared_processor_pool_id" + // Placement Group PIPlacementGroupID = "placement_group_id" PIPlacementGroupMembers = "members" diff --git a/website/docs/d/pi_sap_profile.html.markdown b/website/docs/d/pi_sap_profile.html.markdown index 32717c17f78..d94339198fc 100644 --- a/website/docs/d/pi_sap_profile.html.markdown +++ b/website/docs/d/pi_sap_profile.html.markdown @@ -7,9 +7,11 @@ description: |- --- # ibm_pi_sap_profile + Retrieve information about a SAP profile. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage + ```terraform data "ibm_pi_sap_profile" "example" { pi_cloud_instance_id = "" @@ -17,30 +19,39 @@ data "ibm_pi_sap_profile" "example" { } ``` -**Notes** +### Notes + - Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. - If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - `region` - `lon` - `zone` - `lon04` -Example usage: - ```terraform - provider "ibm" { - region = "lon" - zone = "lon04" - } - ``` + Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` ## Argument reference + Review the argument references that you can specify for your data source. - `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account. - `pi_sap_profile_id` - (Required, String) SAP Profile ID. ## Attribute reference + In addition to all argument reference list, you can access the following attribute references after your data source is created. - `certified` - (Boolean) Has certification been performed on profile. - `cores` - (Integer) Amount of cores. +- `full_system_profile` - (Boolean) Requires full system for deployment. - `memory` - (Integer) Amount of memory (in GB). +- `saps` - (Integer) SAP application performance standard. +- `supported_systems` - (List) List of supported systems. - `type` - (String) Type of profile. +- `workload_type` - (List) List of workload types. + \ No newline at end of file diff --git a/website/docs/d/pi_sap_profiles.html.markdown b/website/docs/d/pi_sap_profiles.html.markdown index 630242ee68f..9c1c124f97b 100644 --- a/website/docs/d/pi_sap_profiles.html.markdown +++ b/website/docs/d/pi_sap_profiles.html.markdown @@ -7,35 +7,41 @@ description: |- --- # ibm_pi_sap_profiles + Retrieve information about all SAP profiles. For more information, see [getting started with IBM Power Systems Virtual Servers](https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started). ## Example usage + ```terraform data "ibm_pi_sap_profiles" "example" { pi_cloud_instance_id = "" } ``` -**Notes** +### Notes + - Please find [supported Regions](https://cloud.ibm.com/apidocs/power-cloud#endpoint) for endpoints. - If a Power cloud instance is provisioned at `lon04`, The provider level attributes should be as follows: - `region` - `lon` - `zone` - `lon04` -Example usage: - ```terraform - provider "ibm" { - region = "lon" - zone = "lon04" - } - ``` + Example usage: + + ```terraform + provider "ibm" { + region = "lon" + zone = "lon04" + } + ``` ## Argument reference + Review the argument references that you can specify for your data source. - `pi_cloud_instance_id` - (Required, String) The GUID of the service instance associated with an account. ## Attribute reference + In addition to all argument reference list, you can access the following attribute references after your data source is created. - `profiles` - (List) List of all the SAP Profiles. @@ -43,6 +49,10 @@ In addition to all argument reference list, you can access the following attribu Nested scheme for `profiles`: - `certified` - (Boolean) Has certification been performed on profile. - `cores` - (Integer) Amount of cores. + - `full_system_profile` - (Boolean) Requires full system for deployment. - `memory` - (Integer) Amount of memory (in GB). - `profile_id` - (String) SAP Profile ID. + - `saps` - (Integer) SAP application performance standard. + - `supported_systems` - (List) List of supported systems. - `type` - (String) Type of profile. + - `workload_type` - (List) List of workload types.