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

[Refactor] Volume Onboarding #94

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions ibm/service/power/ibm_pi_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const (
Attr_Networks = "networks"
Attr_NumberOfVolumes = "number_of_volumes"
Attr_Onboardings = "onboardings"
Attr_OnboardingId = "onboarding_id"
Attr_OperatingSystem = "operating_system"
Attr_PVMInstanceID = "pvm_instance_id"
Attr_PVMInstances = "pvm_instances"
Expand Down
58 changes: 29 additions & 29 deletions ibm/service/power/resource_ibm_pi_volume_onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func ResourceIBMPIVolumeOnboarding() *schema.Resource {

Schema: map[string]*schema.Schema{

helpers.PICloudInstanceId: {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Arg_CloudInstanceID: {
Diptipowervs marked this conversation as resolved.
Show resolved Hide resolved
Description: "Cloud Instance ID - This is the service_instance_id.",
ForceNew: true,
Required: true,
Type: schema.TypeString,
},

piOnboardingVolumes: {
ismirlia marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -54,9 +54,9 @@ func ResourceIBMPIVolumeOnboarding() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
piSourceCRN: {
Type: schema.TypeString,
Required: true,
Description: "CRN of source ServiceBroker instance from where auxiliary volumes need to be onboarded",
Required: true,
Type: schema.TypeString,
},
piAuxiliaryVolumes: {
Type: schema.TypeList,
Expand All @@ -65,14 +65,14 @@ func ResourceIBMPIVolumeOnboarding() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
piAuxiliaryVolumeName: {
Type: schema.TypeString,
Required: true,
Description: "Auxiliary volume name at storage host level",
Required: true,
Type: schema.TypeString,
},
piDisplayName: {
Type: schema.TypeString,
Optional: true,
Description: "Display name of auxVolumeName once onboarded,auxVolumeName will be set to display name if not provided.",
Optional: true,
Type: schema.TypeString,
},
},
},
Expand All @@ -81,62 +81,62 @@ func ResourceIBMPIVolumeOnboarding() *schema.Resource {
},
},
piDescription: {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Description of the volume onboarding operation",
Optional: true,
Type: schema.TypeString,
},

// Computed Attribute
"create_time": {
Type: schema.TypeString,
Attr_CreateTime: {
Computed: true,
Description: "Indicates the create-time of volume onboarding operation",
},
"onboarding_id": {
Type: schema.TypeString,
},
Attr_OnboardingId: {
Computed: true,
Description: "Indicates the volume onboarding operation id",
Type: schema.TypeString,
},
"input_volumes": {
Type: schema.TypeList,
Attr_InputVolumes: {
Computed: true,
Description: "List of volumes requested to be onboarded",
Elem: &schema.Schema{Type: schema.TypeString},
Type: schema.TypeList,
},
"progress": {
Type: schema.TypeFloat,
Attr_Progress: {
Computed: true,
Description: "Indicates the progress of volume onboarding operation",
Type: schema.TypeFloat,
},
"results_onboarded_volumes": {
Type: schema.TypeList,
Attr_ResultsOnboardedVolumes: {
Computed: true,
Description: "List of volumes which are onboarded successfully",
Elem: &schema.Schema{Type: schema.TypeString},
Type: schema.TypeList,
},
"results_volume_onboarding_failures": {
Attr_ResultsVolumeOnboardingFailures: {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"failure_message": {
Type: schema.TypeString,
Attr_FailureMessage: {
Computed: true,
Description: "The failure reason for the volumes which have failed to be onboarded",
Type: schema.TypeString,
},
"volumes": {
Type: schema.TypeList,
Attr_Volumes: {
Computed: true,
Description: "List of volumes which have failed to be onboarded",
Elem: &schema.Schema{Type: schema.TypeString},
Type: schema.TypeList,
},
}},
},
"status": {
Type: schema.TypeString,
Attr_Status: {
Computed: true,
Description: "Indicates the status of volume onboarding operation",
Type: schema.TypeString,
},
},
}
Expand Down
3 changes: 1 addition & 2 deletions ibm/service/power/resource_ibm_pi_volume_onboarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,5 @@ func testAccCheckIBMPIVolumeOnboardingConfig(name string) string {
pi_display_name = "%[2]s-1"
}
}
}
`, acc.Pi_cloud_instance_id, name, acc.Pi_volume_onboarding_source_crn, acc.Pi_auxiliary_volume_name)
}`, acc.Pi_cloud_instance_id, name, acc.Pi_volume_onboarding_source_crn, acc.Pi_auxiliary_volume_name)
}
3 changes: 1 addition & 2 deletions website/docs/r/pi_volume_onboarding.html.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

subcategory: "Power Systems"
layout: "ibm"
page_title: "IBM: pi_volume_onboarding"
Expand Down Expand Up @@ -28,7 +27,7 @@ resource "ibm_pi_volume_onboarding" "testacc_volume_onboarding"{
}
```

**Note**
**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`
Expand Down
Loading