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

add extensions as exported parameter in resource instance #1686

Merged
merged 3 commits into from
Jul 17, 2020
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: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.12

require (
github.com/Bowery/prompt v0.0.0-20190916142128-fa8279994f75 // indirect
github.com/IBM-Cloud/bluemix-go v0.0.0-20200618045128-dcf70b676caf
github.com/IBM-Cloud/bluemix-go v0.0.0-20200714095434-4dd1df3322eb
github.com/IBM-Cloud/power-go-client v1.0.37
github.com/IBM/apigateway-go-sdk v0.0.0-20200414212859-416e5948678a
github.com/IBM/dns-svcs-go-sdk v0.0.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ github.com/IBM-Cloud/bluemix-go v0.0.0-20200603114620-c69c94b21ee0 h1:ewa2N9UTJN
github.com/IBM-Cloud/bluemix-go v0.0.0-20200603114620-c69c94b21ee0/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0=
github.com/IBM-Cloud/bluemix-go v0.0.0-20200618045128-dcf70b676caf h1:s/1pbrFoZkt3xSxQFSnG1TFabt+MNBaTAzenkXsonE4=
github.com/IBM-Cloud/bluemix-go v0.0.0-20200618045128-dcf70b676caf/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0=
github.com/IBM-Cloud/bluemix-go v0.0.0-20200714095434-4dd1df3322eb h1:dGe0hrdSE5QtWkOaOzW8wTwzn1xvhYUAdWvvWmkn+eE=
github.com/IBM-Cloud/bluemix-go v0.0.0-20200714095434-4dd1df3322eb/go.mod h1:gPJbH1etcDj7qS/hBRiLuYW9CY0bRcostSKusa51xR0=
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7/go.mod h1:RiUvKuHKTBmBApDMUQzBL14pQUGKcx/IioKQPIcRQjs=
github.com/IBM-Cloud/power-go-client v1.0.0 h1:iy7ElG6CmCYOeRal07JMGtIvby0qOKBPPL9Wuf1Oo4E=
github.com/IBM-Cloud/power-go-client v1.0.0/go.mod h1:+mOxjyLeLIloR4EMHTpiDbN+FilZpiVHTwu5eqi+cbI=
Expand Down
9 changes: 9 additions & 0 deletions ibm/data_source_ibm_resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ func dataSourceIBMResourceInstance() *schema.Resource {
Computed: true,
Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource",
},

"extensions": {
Type: schema.TypeMap,
Computed: true,
Description: "The extended metadata as a map associated with the resource instance.",
},
},
}
}
Expand Down Expand Up @@ -187,6 +193,9 @@ func dataSourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{})
d.Set(ResourceCRN, instance.Crn.String())
d.Set(ResourceStatus, instance.State)
d.Set(ResourceGroupName, instance.ResourceGroupName)
if instance.Extensions != nil {
d.Set("extensions", instance.Extensions)
}

rcontroller, err := getBaseController(meta)
if err != nil {
Expand Down
9 changes: 9 additions & 0 deletions ibm/resource_ibm_resource_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ func resourceIBMResourceInstance() *schema.Resource {
Computed: true,
Description: "The URL of the IBM Cloud dashboard that can be used to explore and view details about the resource",
},

"extensions": {
Type: schema.TypeMap,
Computed: true,
Description: "The extended metadata as a map associated with the resource instance.",
},
},
}
}
Expand Down Expand Up @@ -344,6 +350,9 @@ func resourceIBMResourceInstanceRead(d *schema.ResourceData, meta interface{}) e
d.Set("service_endpoints", endpoint)
}
}
if instance.Extensions != nil {
d.Set("extensions", instance.Extensions)
}

return nil
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/resource_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ The following attributes are exported:
* `id` - The unique identifier of the resource instance.
* `status` - The status of resource instance.
* `plan` - The plan for the service offering used by this resource instance.
* `extensions` - The extended metadata as a map associated with the resource instance.
2 changes: 2 additions & 0 deletions website/docs/r/resource_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ The following attributes are exported:
* `status` - Status of resource instance.
* `guid`- Guid of the resource instance.
* `dashboard_url`- The dashboard url of the new resource instance.
* `extensions` - The extended metadata as a map associated with the resource instance.