Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Datasource] Add support_systems for sap profile #5670

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1653,10 +1653,8 @@ github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
Expand Down
30 changes: 30 additions & 0 deletions ibm/service/power/data_source_ibm_pi_sap_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
ismirlia marked this conversation as resolved.
Show resolved Hide resolved
},
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,
},
},
}
}
Expand All @@ -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
}
40 changes: 35 additions & 5 deletions ibm/service/power/data_source_ibm_pi_sap_profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).",
Expand All @@ -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,
},
},
ismirlia marked this conversation as resolved.
Show resolved Hide resolved
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,
Expand All @@ -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)
}
Expand Down
27 changes: 19 additions & 8 deletions website/docs/d/pi_sap_profile.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,51 @@ 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 = "<value of the cloud_instance_id>"
pi_sap_profile_id = "tinytest-1x4"
}
```

**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.

26 changes: 18 additions & 8 deletions website/docs/d/pi_sap_profiles.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,52 @@ 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 = "<value of the 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.

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.
Loading