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

[Resource] [Datasource] Power add VSN functionality to datasources an… #5854

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Alexander-Kita
Copy link
Collaborator

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Output from acceptance testing:

pi_virtual_serial_number (d):

=== RUN   TestAccIBMPIVirtualSerialNumber
--- PASS: TestAccIBMPIVirtualSerialNumber (29.53s)
PASS

pi_virtual_serial_numbers (d):

=== RUN   TestAccIBMPIVirtualSerialNumbers
--- PASS: TestAccIBMPIVirtualSerialNumbers (27.74s)
PASS

pi_virtual_serial_number (r)

=== RUN   TestAccIBMPIVirtualSerialNumberBasic
--- PASS: TestAccIBMPIVirtualSerialNumberBasic (44.18s)
PASS
=== RUN   TestAccIBMPIVirtualSerialNumberWithInstance
--- PASS: TestAccIBMPIVirtualSerialNumberWithInstance (310.44s)
PASS

pi_instance (d)

=== RUN   TestAccIBMPIInstanceDataSource_basic
--- PASS: TestAccIBMPIInstanceDataSource_basic (44.95s)
PASS

pi_instances (d)

=== RUN   TestAccIBMPIInstancesDataSource_basic
--- PASS: TestAccIBMPIInstancesDataSource_basic (22.78s)
PASS

pi_instance (r)

=== RUN   TestAccIBMPIInstanceBasic
--- PASS: TestAccIBMPIInstanceBasic (998.46s)
PASS
=== RUN   TestAccIBMPIInstanceVirtualSerialNumber
--- PASS: TestAccIBMPIInstanceVirtualSerialNumber (413.08s)
PASS

@@ -1703,6 +1816,12 @@ func createPVMInstance(d *schema.ResourceData, client *instance.IBMPIInstanceCli
if tags, ok := d.GetOk(Arg_UserTags); ok {
body.UserTags = flex.FlattenSet(tags.(*schema.Set))
}
if vsn, ok := d.GetOk(Arg_VirtualSerialNumber); ok {
vsnListType := vsn.([]interface{})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is declared here and passed as a parameter to the func in next line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to convert the list type (what terraform is taking) to a CreateServerVirtualSerialNumber model to send to SB

Description: "Description of virtual serial number.",
Type: schema.TypeString,
},
Attr_InstanceID: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this attr looks like redundant as it is same as Arg_InstanceID isn't?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be only when Arg_InstanceID is supplied. However, it is needed whenever the argument is not supplied as it will be a list of virtual serial numbers with different values for InstanceID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants