Skip to content

Commit ea6c97a

Browse files
committed
Self review, changelog
Signed-off-by: Dainius Serplis <dserplis@vmware.com>
1 parent a06e6ae commit ea6c97a

9 files changed

+30
-44
lines changed

.changes/v4.0.0/1375-features.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* **New Data Source:** `vcd_tm_edge_cluster` to read and sync TM Edge Clusters [GH-1375]
2+
* **New Resource:** `vcd_tm_edge_cluster_qos` to manage QoS settings for TM Edge Clusters [GH-1375]
3+
* **New Data Source:** `vcd_tm_edge_cluster_qos` to read QoS settings for TM Edge Clusters [GH-1375]

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ require (
7171
)
7272

7373
//replace github.com/vmware/go-vcloud-director/v3 => github.com/Didainius/go-vcloud-director/v3 v2.12.1-0.20211018060826-c7f8ab32330e
74-
replace github.com/vmware/go-vcloud-director/v3 => github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241218070848-7438f3a2dacd
74+
replace github.com/vmware/go-vcloud-director/v3 => github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241219055930-5632625dd670

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
22
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
3-
github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241218070848-7438f3a2dacd h1:ge5eLNUWIP0VGZMT0+/Ka1RQJU9dJtQHpSu6k0X3fZk=
4-
github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241218070848-7438f3a2dacd/go.mod h1:68KHsVns52dsq/w5JQYzauaU/+NAi1FmCxhBrFc/VoQ=
3+
github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241219055930-5632625dd670 h1:NjHoGj5LNQuYuOwjZ0gQd2rIamFra8SGc3Up6IOHARs=
4+
github.com/Didainius/go-vcloud-director/v3 v3.0.0-alpha.4.0.20241219055930-5632625dd670/go.mod h1:68KHsVns52dsq/w5JQYzauaU/+NAi1FmCxhBrFc/VoQ=
55
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
66
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
77
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg=

vcd/datasource_vcd_tm_edge_cluster_qos.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func datasourceVcdTmEdgeClusterQos() *schema.Resource {
4444
"egress_burst_size_bytes": {
4545
Type: schema.TypeString,
4646
Computed: true,
47-
Description: fmt.Sprintf("Ingress burst size bytes for %s", labelTmEdgeCluster),
47+
Description: fmt.Sprintf("Egress burst size bytes for %s", labelTmEdgeCluster),
4848
},
4949
},
5050
}

vcd/resource_generic_crud.go

-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ func readDatasource[O any, I any](_ context.Context, d *schema.ResourceData, met
252252
util.Logger.Printf("[DEBUG] Overriding %s field 'name' to '%s' for datasource lookup", c.entityLabel, c.overrideDefaultNameField)
253253
}
254254
entityName := d.Get(fieldName).(string)
255-
256255
retrievedEntity, err := c.getEntityFunc(entityName)
257256
if err != nil {
258257
return diag.Errorf("error getting %s by Name '%s': %s", c.entityLabel, entityName, err)

vcd/resource_vcd_tm_edge_cluster_qos.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,28 @@ func resourceVcdTmEdgeClusterQos() *schema.Resource {
3636
Description: fmt.Sprintf("Region ID of %s", labelTmEdgeCluster),
3737
},
3838
"ingress_committed_bandwidth_mbps": {
39-
Type: schema.TypeString,
39+
Type: schema.TypeString, // string + validation due to usual problem of differentiation between 0 and empty value for TypeInt
4040
Optional: true,
4141
Description: fmt.Sprintf("Ingress committed bandwidth in Mbps for %s", labelTmEdgeCluster),
4242
ValidateFunc: emptyOrIsIntAndAtLeast(1),
4343
RequiredWith: []string{"ingress_burst_size_bytes"},
4444
},
4545
"ingress_burst_size_bytes": {
46-
Type: schema.TypeString,
46+
Type: schema.TypeString, // string + validation due to usual problem of differentiation between 0 and empty value for TypeInt
4747
Optional: true,
4848
Description: fmt.Sprintf("Ingress burst size bytes for %s", labelTmEdgeCluster),
4949
ValidateFunc: emptyOrIsIntAndAtLeast(1),
5050
RequiredWith: []string{"ingress_committed_bandwidth_mbps"},
5151
},
5252
"egress_committed_bandwidth_mbps": {
53-
Type: schema.TypeString,
53+
Type: schema.TypeString, // string + validation due to usual problem of differentiation between 0 and empty value for TypeInt
5454
Optional: true,
5555
Description: fmt.Sprintf("Egress committed bandwidth in Mbps for %s", labelTmEdgeCluster),
5656
ValidateFunc: emptyOrIsIntAndAtLeast(1),
5757
RequiredWith: []string{"egress_burst_size_bytes"},
5858
},
5959
"egress_burst_size_bytes": {
60-
Type: schema.TypeString,
60+
Type: schema.TypeString, // string + validation due to usual problem of differentiation between 0 and empty value for TypeInt
6161
Optional: true,
6262
Description: fmt.Sprintf("Ingress burst size bytes for %s", labelTmEdgeCluster),
6363
ValidateFunc: emptyOrIsIntAndAtLeast(1),
@@ -92,7 +92,6 @@ func resourceVcdTmEdgeClusterQosCreate(ctx context.Context, d *schema.ResourceDa
9292

9393
func resourceVcdTmEdgeClusterQosUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
9494
vcdClient := meta.(*VCDClient)
95-
9695
c := crudConfig[*govcd.TmEdgeCluster, types.TmEdgeCluster]{
9796
entityLabel: labelTmEdgeClusterQos,
9897
getTypeFunc: getTmEdgeClusterQosType,
@@ -115,7 +114,6 @@ func resourceVcdTmEdgeClusterQosRead(ctx context.Context, d *schema.ResourceData
115114

116115
func resourceVcdTmEdgeClusterQosDelete(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
117116
vcdClient := meta.(*VCDClient)
118-
119117
c := crudConfig[*govcd.TmEdgeCluster, types.TmEdgeCluster]{
120118
entityLabel: labelTmEdgeClusterQos,
121119
getEntityFunc: vcdClient.GetTmEdgeClusterById,
@@ -126,7 +124,6 @@ func resourceVcdTmEdgeClusterQosDelete(ctx context.Context, d *schema.ResourceDa
126124

127125
func resourceVcdTmEdgeClusterQosImport(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
128126
vcdClient := meta.(*VCDClient)
129-
130127
ec, err := vcdClient.GetTmEdgeClusterByName(d.Id())
131128
if err != nil {
132129
return nil, fmt.Errorf("error retrieving %s by Name '%s': %s", labelTmEdgeClusterQos, d.Id(), err)

website/docs/d/tm_edge_cluster.html.markdown

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ The following arguments are supported:
3737

3838
## Attribute Reference
3939

40-
* `node_count` - NodeCount contains number of transport nodes in the Edge Cluster. If this
41-
information is not available, nodeCount will be set to `-1`
40+
* `node_count` - Number of transport nodes in the Edge Cluster. If this information is not
41+
available, it will be set to `-1`
4242
* `org_count` - Number of organization using this Edge Cluster
4343
* `vpc_count` - Number of VPCs using this Edge Cluster
4444
* `average_cpu_usage_percentage` - Average CPU utilization percentage across all member nodes
@@ -47,14 +47,14 @@ The following arguments are supported:
4747
* `UP` - The Edge Cluster is healthy
4848
* `DOWN` - The Edge Cluster is down
4949
* `DEGRADED` - The Edge Cluster is not operating at capacity. One or more member nodes are down or inactive
50-
* `UNKNOWN` - The Edge Cluster state is unknown. If UNKNOWN, avgMemoryUsagePercentage and avgCpuUsagePercentage will be not be set
50+
* `UNKNOWN` - The Edge Cluster state is unknown. If UNKNOWN, `average_cpu_usage_percentage` and `average_memory_usage_percentage` will be not be set
5151
* `status` - Represents current status of the networking entity. One of:
52-
* `PENDING` - Desired entity configuration has been received by system and is pending realization.
53-
* `CONFIGURING` - The system is in process of realizing the entity.
54-
* `REALIZED` - The entity is successfully realized in the system.
52+
* `PENDING` - Desired entity configuration has been received by system and is pending realization
53+
* `CONFIGURING` - The system is in process of realizing the entity
54+
* `REALIZED` - The entity is successfully realized in the system
5555
* `REALIZATION_FAILED` - There are some issues and the system is not able to realize the entity
5656
* `UNKNOWN` - Current state of entity is unknown
5757
* `deployment_type` - Deployment type for transport nodes in the Edge Cluster. Possible values are:
58-
* `VIRTUAL_MACHINE` - If all members are of type VIRTUAL_MACHINE
59-
* `PHYSICAL_MACHINE` - If all members are of type PHYSICAL_MACHINE
58+
* `VIRTUAL_MACHINE` - If all members are of type _VIRTUAL_MACHINE_
59+
* `PHYSICAL_MACHINE` - If all members are of type _PHYSICAL_MACHINE_
6060
* `UNKNOWN` - If there are no members or their type is not known

website/docs/d/tm_edge_cluster_qos.html.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ layout: "vcd"
33
page_title: "VMware Cloud Director: vcd_tm_edge_cluster_qos"
44
sidebar_current: "docs-vcd-data-source-tm-edge-cluster-qos"
55
description: |-
6-
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS.
6+
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS data source.
77
---
88

99
# vcd\_tm\_edge\_cluster\_qos
1010

11-
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS.
11+
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS data source.
1212

1313
## Example Usage
1414

website/docs/r/tm_edge_cluster_qos.html.markdown

+9-22
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ layout: "vcd"
33
page_title: "VMware Cloud Director: vcd_tm_edge_cluster_qos"
44
sidebar_current: "docs-vcd-resource-tm-edge-cluster-qos"
55
description: |-
6-
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS.
6+
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS resource.
77
---
88

99
# vcd\_tm\_edge\_cluster\_qos
1010

11-
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS.
11+
Provides a VMware Cloud Foundation Tenant Manager Edge Cluster QoS resource.
1212

13-
-> This resource does not actually create an Edge Cluster QoS, but configures QoS for a given
13+
-> This resource does not create an Edge Cluster QoS entity, but configures QoS for a given
1414
`edge_cluster_id`. Similarly, `terraform destroy` operation does not remove Edge Cluster, but resets
15-
QoS settings to unlimited.
15+
QoS settings to default (unlimited).
1616

1717
## Example Usage
1818

@@ -44,28 +44,14 @@ The following arguments are supported:
4444
* `edge_cluster_id` - (Required) An ID of Edge Cluster. Can be looked up using
4545
[vcd_tm_edge_cluster](/providers/vmware/vcd/latest/docs/data-sources/tm_edge_cluster) data source
4646
* `egress_committed_bandwidth_mbps` - (Optional) Committed egress bandwidth specified in Mbps.
47-
Bandwidth is limited to line rate when the value configured is greater than line rate. Traffic
48-
exceeding bandwidth will be dropped
47+
Bandwidth is limited to line rate. Traffic exceeding bandwidth will be dropped
4948
* `egress_burst_size_bytes` - (Optional) Egress burst size in bytes
5049
* `ingress_committed_bandwidth_mbps` - (Optional) Committed ingress bandwidth specified in Mbps.
51-
Bandwidth is limited to line rate when the value configured is greater than line rate. Traffic
52-
exceeding bandwidth will be dropped
50+
Bandwidth is limited to line rate. Traffic exceeding bandwidth will be dropped
5351
* `ingress_burst_size_bytes` - (Optional) Ingres burst size in bytes
5452

5553
-> Choosing to set _egress_ or _ingress_ requires both of that traffic direction must be set
5654

57-
## Attribute Reference
58-
59-
The following attributes are exported on this resource:
60-
61-
* `max_virtual_services` - Maximum number of virtual services this NSX-T ALB Service Engine Group can run
62-
* `reserved_virtual_services` - Number of reserved virtual services
63-
* `deployed_virtual_services` - Number of deployed virtual services
64-
* `ha_mode` defines High Availability Mode for Service Engine Group. One off:
65-
* ELASTIC_N_PLUS_M_BUFFER - Service Engines will scale out to N active nodes with M nodes as buffer.
66-
* ELASTIC_ACTIVE_ACTIVE - Active-Active with scale out.
67-
* LEGACY_ACTIVE_STANDBY - Traditional single Active-Standby configuration
68-
6955
## Importing
7056

7157
~> **Note:** The current implementation of Terraform import can only import resources into the
@@ -78,7 +64,8 @@ path for it. An example is below:
7864
[docs-import]: https://www.terraform.io/docs/import/
7965

8066
```
81-
terraform import vcd_tm_ip_space.imported my-ip-space-name
67+
terraform import vcd_tm_edge_cluster_qos.imported my-region-name.my-edge-cluster-name
8268
```
8369

84-
The above would import the `my-ip-space-name` IP Space.
70+
The above would import the `my-edge-cluster-name` Edge Cluster QoS settings that is in
71+
`my-region-name` Region.

0 commit comments

Comments
 (0)