Skip to content

Commit 0960168

Browse files
authored
feat: update vmware service (IBM-Cloud#5926)
* feat: update vmware service with latest api specs * fix: update go.mod file with latest vmware-go-sdk * fix: add config and refactor * refactor: fix go.mod file * docs: shorten service name * refactor: update variable name with prefix IBMCLOUD * refactor: remove optional for computed property * feat: add to subcategory list
1 parent a12cf21 commit 0960168

File tree

12 files changed

+1011
-223
lines changed

12 files changed

+1011
-223
lines changed

examples/ibm-vmware/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Examples for VMware as a Service API
1+
# Examples for VMware Cloud Foundation as a Service API
22

3-
These examples illustrate how to use the resources and data sources associated with VMware as a Service API.
3+
These examples illustrate how to use the resources and data sources associated with VMware Cloud Foundation as a Service API.
44

55
The following resources are supported:
66
* ibm_vmaas_vdc
@@ -20,7 +20,7 @@ $ terraform apply
2020

2121
Run `terraform destroy` when you don't need these resources.
2222

23-
## VMware as a Service API resources
23+
## VMware Cloud Foundation as a Service API resources
2424

2525
### Resource: ibm_vmaas_vdc
2626

@@ -62,11 +62,12 @@ resource "ibm_vmaas_vdc" "vmaas_vdc_instance" {
6262
| edges | The VMware NSX-T networking edges deployed on the virtual data center (VDC). NSX-T edges are used for bridging virtualization networking to the physical public-internet and IBM private networking. |
6363
| status_reasons | Information about why the request to create the virtual data center (VDC) cannot be completed. |
6464
| ordered_at | The time that the virtual data center (VDC) is ordered. |
65+
| org_href | The URL of the organization that owns the VDC. |
6566
| org_name | The name of the VMware Cloud Director organization that contains this virtual data center (VDC). VMware Cloud Director organizations are used to create strong boundaries between VDCs. There is a complete isolation of user administration, networking, workloads, and VMware Cloud Director catalogs between different Director organizations. |
6667
| status | Determines the state of the virtual data center. |
6768
| type | Determines whether this virtual data center is in a single-tenant or multitenant Cloud Director site. |
6869

69-
## VMware as a Service API data sources
70+
## VMware Cloud Foundation as a Service API data sources
7071

7172
### Data source: ibm_vmaas_vdc
7273

@@ -98,6 +99,7 @@ data "ibm_vmaas_vdc" "vmaas_vdc_instance" {
9899
| status_reasons | Information about why the request to create the virtual data center (VDC) cannot be completed. |
99100
| name | A human readable ID for the virtual data center (VDC). |
100101
| ordered_at | The time that the virtual data center (VDC) is ordered. |
102+
| org_href | The URL of the organization that owns the VDC. |
101103
| org_name | The name of the VMware Cloud Director organization that contains this virtual data center (VDC). VMware Cloud Director organizations are used to create strong boundaries between VDCs. There is a complete isolation of user administration, networking, workloads, and VMware Cloud Director catalogs between different Director organizations. |
102104
| ram | The RAM usage limit on the virtual data center (VDC) in GB (1024^3 bytes). Supported for VDCs deployed on a multitenant Cloud Director site. This property is applicable when the resource pool type is reserved. |
103105
| status | Determines the state of the virtual data center. |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ require (
4141
github.com/IBM/schematics-go-sdk v0.3.0
4242
github.com/IBM/sds-go-sdk v0.0.4
4343
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7
44-
github.com/IBM/vmware-go-sdk v0.1.2
44+
github.com/IBM/vmware-go-sdk v0.1.3
4545
github.com/IBM/vpc-beta-go-sdk v0.8.0
4646
github.com/IBM/vpc-go-sdk v0.64.0
4747
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ github.com/IBM/sds-go-sdk v0.0.4 h1:zkkqDzc+TgFYU/BK4Oknv8cMBXJ08WKUu7yKCyzslvE=
172172
github.com/IBM/sds-go-sdk v0.0.4/go.mod h1:HcqZfsgKMqfFxbU1RcRfF934ls+vQY97oXPGPSoIWPg=
173173
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7 h1:5lKt1rHuKaAaiZtbPfsF8dgiko/gGbVgreiut3zU128=
174174
github.com/IBM/secrets-manager-go-sdk/v2 v2.0.7/go.mod h1:RglK3v6CPe3T1myRtQCD6z+nBygXvNJwufAon0qcZok=
175-
github.com/IBM/vmware-go-sdk v0.1.2 h1:5lKWFyInWz9e2hwGsoFTEoLa1jYkD30SReN0fQ10w9M=
176-
github.com/IBM/vmware-go-sdk v0.1.2/go.mod h1:2UGPBJju3jiv5VKKBBm9a5L6bzF/aJdKOKAzJ7HaOjA=
175+
github.com/IBM/vmware-go-sdk v0.1.3 h1:uJL3kwzM0jAKsT6Gj9tE5xT9SZBVXVaJvZdxrSMx8b8=
176+
github.com/IBM/vmware-go-sdk v0.1.3/go.mod h1:OyQKRInGGsBaOyE5LIZCqH7b1DZ01BvIYa8BgGy+wWo=
177177
github.com/IBM/vpc-beta-go-sdk v0.8.0 h1:cEPpv4iw3Ba5W2d0AWg3TIbKeJ8y1nPuUuibR5Jt9eE=
178178
github.com/IBM/vpc-beta-go-sdk v0.8.0/go.mod h1:hORgIyTFRzXrZIK9IohaWmCRBBlYiDRagsufi7M6akE=
179179
github.com/IBM/vpc-go-sdk v0.64.0 h1:0x2jakapXxXYTTr0EdrwuXa6h0couSK+FTDGxd8jChA=

ibm/conns/config.go

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ type clientSession struct {
668668
mqcloudClient *mqcloudv1.MqcloudV1
669669
mqcloudClientErr error
670670

671-
// VMware as a Service
671+
// VMware Cloud Foundation as a Service
672672
vmwareClient *vmwarev1.VmwareV1
673673
vmwareClientErr error
674674

@@ -3560,25 +3560,28 @@ func (c *Config) ClientSession() (interface{}, error) {
35603560
session.mqcloudClientErr = fmt.Errorf("Error occurred while configuringMQaaS service: %q", err)
35613561
}
35623562

3563-
// VMware as a Service
3564-
// Construct the service options.
3565-
vmwareURL := ContructEndpoint(fmt.Sprintf("api.%s.vmware", c.Region), cloudEndpoint+"/v1")
3566-
vmwareClientOptions := &vmwarev1.VmwareV1Options{
3567-
Authenticator: authenticator,
3568-
URL: EnvFallBack([]string{"VMWARE_URL"}, vmwareURL),
3569-
}
3563+
// VMware Cloud Foundation as a Service
3564+
// Construct an instance of the 'VMware Cloud Foundation as a Service API' service.
3565+
if session.vmwareClientErr == nil {
3566+
// Construct the service options.
3567+
vmwareURL := ContructEndpoint(fmt.Sprintf("api.%s.vmware", c.Region), cloudEndpoint+"/v1")
3568+
vmwareClientOptions := &vmwarev1.VmwareV1Options{
3569+
Authenticator: authenticator,
3570+
URL: EnvFallBack([]string{"IBMCLOUD_VMWARE_URL"}, vmwareURL),
3571+
}
35703572

3571-
// Construct the service client.
3572-
session.vmwareClient, err = vmwarev1.NewVmwareV1(vmwareClientOptions)
3573-
if err == nil {
3574-
// Enable retries for API calls
3575-
session.vmwareClient.Service.EnableRetries(c.RetryCount, c.RetryDelay)
3576-
// Add custom header for analytics
3577-
session.vmwareClient.SetDefaultHeaders(gohttp.Header{
3578-
"X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)},
3579-
})
3580-
} else {
3581-
session.vmwareClientErr = fmt.Errorf("Error occurred while configuring VMware as a Service API service: %q", err)
3573+
// Construct the service client.
3574+
session.vmwareClient, err = vmwarev1.NewVmwareV1(vmwareClientOptions)
3575+
if err == nil {
3576+
// Enable retries for API calls
3577+
session.vmwareClient.Service.EnableRetries(c.RetryCount, c.RetryDelay)
3578+
// Add custom header for analytics
3579+
session.vmwareClient.SetDefaultHeaders(gohttp.Header{
3580+
"X-Original-User-Agent": {fmt.Sprintf("terraform-provider-ibm/%s", version.Version)},
3581+
})
3582+
} else {
3583+
session.vmwareClientErr = fmt.Errorf("Error occurred while constructing 'VMware Cloud Foundation as a Service API' service client: %q", err)
3584+
}
35823585
}
35833586

35843587
// Construct the service options.

ibm/service/vmware/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ This area is primarily for IBM provider contributors and maintainers. For inform
77
* [Find out about contributing](../../../CONTRIBUTING.md) to the IBM provider!
88
* IBM Provider Docs: [Home](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs)
99
* IBM Provider Docs: [One of the resources](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/vmaas_vdc)
10-
* IBM API Docs: [IBM API Docs for VMware as a Service](https://cloud.ibm.com/apidocs/vmware-service)
11-
* IBM SDK: [IBM SDK for VMware as a Service ](https://github.com/IBM/appconfiguration-go-admin-sdk/tree/master/vmwarev1)
10+
* IBM API Docs: [IBM API Docs for VMware Cloud Foundation as a Service](https://cloud.ibm.com/apidocs/vmware-service)
11+
* IBM SDK: [IBM SDK for VMware Cloud Foundation as a Service ](https://github.com/IBM/appconfiguration-go-admin-sdk/tree/master/vmwarev1)

0 commit comments

Comments
 (0)