Skip to content

Commit dc58780

Browse files
committed
rename resources config -> configuration
Signed-off-by: Stoyan Zhelyazkov <stoyan.zhelyazkov@broadcom.com>
1 parent 57e762a commit dc58780

8 files changed

+99
-99
lines changed

docs/data-sources/config_profile.md renamed to docs/data-sources/configuration_profile.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
subcategory: "Host and Cluster Management"
3-
page_title: "VMware vSphere: vsphere_config_profile"
3+
page_title: "VMware vSphere: vsphere_configuration_profile"
44
sidebar_current: "docs-vsphere-data-source-config-profile"
55
description: |-
66
Provides a vSphere cluster configuration profile data source.
77
---
88

9-
# vsphere_config_profile
9+
# vsphere_configuration_profile
1010

11-
The `vsphere_config_profile` data source can be used to export the configuration and schema
11+
The `vsphere_configuration_profile` data source can be used to export the configuration and schema
1212
of a cluster that is already managed via configuration profiles.
1313

1414
## Example Usage
@@ -23,7 +23,7 @@ data "vsphere_compute_cluster" "compute_cluster" {
2323
datacenter_id = data.vsphere_datacenter.datacenter.id
2424
}
2525
26-
data "vsphere_config_profile" "profile" {
26+
data "vsphere_configuration_profile" "profile" {
2727
cluster_id = data.vsphere_compute_cluster.compute_cluster.id
2828
}
2929
```
@@ -38,6 +38,6 @@ The following arguments are supported:
3838

3939
The following attributes are exported:
4040

41-
* `id` - A custom identifier for the profile. The value for this attribute is constructed using the `cluster_id` in the following format - `config_profile_${cluster_id}`.
41+
* `id` - A custom identifier for the profile. The value for this attribute is constructed using the `cluster_id` in the following format - `configuration_profile_${cluster_id}`.
4242
* `schema`- The JSON schema for the profile.
43-
* `config` - The current configuration which is active on the cluster.
43+
* `configuration` - The current configuration which is active on the cluster.
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
subcategory: "Host and Cluster Management"
3-
page_title: "VMware vSphere: vsphere_config_profile"
3+
page_title: "VMware vSphere: vsphere_configuration_profile"
44
sidebar_current: "docs-vsphere-resource-config-profile"
55
description: |-
66
Provides a vSphere cluster configuration profile resource.
77
---
88

9-
# vsphere_config_profile
9+
# vsphere_configuration_profile
1010

11-
The `vsphere_config_profile` resource can be used to configure profile-based host management on a vSphere compute cluster.
11+
The `vsphere_configuration_profile` resource can be used to configure profile-based host management on a vSphere compute cluster.
1212
The source for the configuration can either be a ESXi host that is part of the compute cluster or a JSON file, but not both at the same time.
1313

1414
It is allowed to switch from one type of configuration source to the other at any time.
1515

16-
Deleting a `vsphere_config_profile` resource has no effect on the compute cluster. Once management via configuration
16+
Deleting a `vsphere_configuration_profile` resource has no effect on the compute cluster. Once management via configuration
1717
profiles is turned ot it is not possible to disable it.
1818

1919
~> **NOTE:** This resource requires a vCenter and will not work on
@@ -56,21 +56,21 @@ data "vsphere_host" "host" {
5656
}
5757
5858
# Configure a profile on "cluster-01" using one of its hosts as a reference
59-
resource "vsphere_config_profile" "profile1" {
60-
cluster_id = data.vsphere_compute_cluster.cluster1.id
59+
resource "vsphere_configuration_profile" "profile1" {
60+
cluster_id = data.vsphere_compute_cluster.cluster1.id
6161
reference_host_id = data.vsphere_host.host.id
6262
}
6363
6464
# Copy the configuration of "cluster-01" onto "cluster-02"
65-
resource "vsphere_config_profile" "profile2" {
66-
cluster_id = data.vsphere_compute_cluster.cluster2.id
67-
config = vsphere_config_profile.profile1.config
65+
resource "vsphere_configuration_profile" "profile2" {
66+
cluster_id = data.vsphere_compute_cluster.cluster2.id
67+
configuration = vsphere_configuration_profile.profile1.configuration
6868
}
6969
7070
# Copy the configuration of "cluster-01" onto "cluster-03"
71-
resource "vsphere_config_profile" "profile3" {
72-
cluster_id = data.vsphere_compute_cluster.cluster3.id
73-
config = vsphere_config_profile.profile1.config
71+
resource "vsphere_configuration_profile" "profile3" {
72+
cluster_id = data.vsphere_compute_cluster.cluster3.id
73+
configuration = vsphere_configuration_profile.profile1.configuration
7474
}
7575
```
7676

@@ -89,9 +89,9 @@ data "vsphere_compute_cluster" "cluster1" {
8989
datacenter_id = data.vsphere_datacenter.datacenter.id
9090
}
9191
92-
resource "vsphere_config_profile" "profile1" {
93-
cluster_id = data.vsphere_compute_cluster.cluster1.id
94-
config = file("/Users/you/terraform/cluster_config_1.json")
92+
resource "vsphere_configuration_profile" "profile1" {
93+
cluster_id = data.vsphere_compute_cluster.cluster1.id
94+
configuration = file("/Users/you/terraform/cluster_config_1.json")
9595
}
9696
```
9797

@@ -102,13 +102,13 @@ The following arguments are supported:
102102
* `cluster_id` - (Required) The identifier of the cluster.
103103
* `reference_host_id` - (Optional) The identifier of the host to use as a configuration source.
104104
The host needs to be a member of the cluster identified by `cluster_id`. This argument can only be specified if
105-
`config` is not set.
106-
* `config` - (Optional) The configuration JSON provided as a plain string. This argument can only be specified if `reference_host_id` is not set.
105+
`configuration` is not set.
106+
* `configuration` - (Optional) The configuration JSON provided as a plain string. This argument can only be specified if `reference_host_id` is not set.
107107

108108
## Attribute Reference
109109

110110
The following attributes are exported:
111111

112-
* `id` - A custom identifier for the profile. The value for this attribute is constructed using the `cluster_id` in the following format - `config_profile_${cluster_id}`.
112+
* `id` - A custom identifier for the profile. The value for this attribute is constructed using the `cluster_id` in the following format - `configuration_profile_${cluster_id}`.
113113
* `schema`- The JSON schema for the profile.
114-
* `config` - The current configuration which is active on the cluster.
114+
* `configuration` - The current configuration which is active on the cluster.

vsphere/data_source_vsphere_config_profile.go renamed to vsphere/data_source_vsphere_configuration_profile.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"github.com/vmware/terraform-provider-vsphere/vsphere/internal/helper/configprofile"
1313
)
1414

15-
func dataSourceVSphereConfigProfile() *schema.Resource {
15+
func dataSourceVSphereConfigurationProfile() *schema.Resource {
1616
return &schema.Resource{
17-
ReadContext: dataSourceVSphereConfigProfileRead,
17+
ReadContext: dataSourceVSphereConfigurationProfileRead,
1818
Schema: map[string]*schema.Schema{
19-
"config": {
19+
"configuration": {
2020
Type: schema.TypeString,
2121
Computed: true,
2222
Description: "The configuration json.",
@@ -35,7 +35,7 @@ func dataSourceVSphereConfigProfile() *schema.Resource {
3535
}
3636
}
3737

38-
func dataSourceVSphereConfigProfileRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
38+
func dataSourceVSphereConfigurationProfileRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
3939
client := meta.(*Client).restClient
4040
return configprofile.ReadConfigProfile(ctx, client, d)
4141
}

vsphere/data_source_vsphere_config_profile_test.go renamed to vsphere/data_source_vsphere_configuration_profile_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ resource "vsphere_compute_cluster" "cluster1" {
6262
host_system_ids = [vsphere_host.h1.id]
6363
}
6464
65-
resource "vsphere_config_profile" "profile1" {
65+
resource "vsphere_configuration_profile" "profile1" {
6666
reference_host_id = vsphere_host.h1.id
6767
cluster_id = vsphere_compute_cluster.cluster1.id
6868
}
6969
70-
data "vsphere_config_profile" "profile2" {
70+
data "vsphere_configuration_profile" "profile2" {
7171
cluster_id = vsphere_config_profile.profile1.cluster_id
7272
}
7373
`,

vsphere/internal/helper/configprofile/config_profile_helper.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ import (
1414
func ReadConfigProfile(ctx context.Context, client *rest.Client, d *schema.ResourceData) diag.Diagnostics {
1515
m := configuration.NewManager(client)
1616

17-
clusterId := d.Get("cluster_id").(string)
17+
clusterID := d.Get("cluster_id").(string)
1818

19-
d.SetId(fmt.Sprintf("config_profile_%s", clusterId))
19+
d.SetId(fmt.Sprintf("config_profile_%s", clusterID))
2020

21-
tflog.Debug(ctx, fmt.Sprintf("reading configuration for cluster: %s", clusterId))
22-
config, err := m.GetConfiguration(clusterId)
21+
tflog.Debug(ctx, fmt.Sprintf("reading configuration for cluster: %s", clusterID))
22+
config, err := m.GetConfiguration(clusterID)
2323
if err != nil {
2424
return diag.FromErr(fmt.Errorf("failed to retrieve cluster configuration: %s", err))
2525
}
2626

27-
_ = d.Set("config", config.Config)
27+
_ = d.Set("configuration", config.Config)
2828

29-
tflog.Debug(ctx, fmt.Sprintf("reading configuration schema for cluster: %s", clusterId))
30-
configSchema, err := m.GetSchema(clusterId)
29+
tflog.Debug(ctx, fmt.Sprintf("reading configuration schema for cluster: %s", clusterID))
30+
configSchema, err := m.GetSchema(clusterID)
3131
if err != nil {
3232
return diag.FromErr(fmt.Errorf("failed to retrieve configuration schema: %s", err))
3333
}

vsphere/provider.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func Provider() *schema.Provider {
110110
"vsphere_compute_cluster_vm_dependency_rule": resourceVSphereComputeClusterVMDependencyRule(),
111111
"vsphere_compute_cluster_vm_group": resourceVSphereComputeClusterVMGroup(),
112112
"vsphere_compute_cluster_vm_host_rule": resourceVSphereComputeClusterVMHostRule(),
113-
"vsphere_config_profile": resourceVSphereConfigProfile(),
113+
"vsphere_configuration_profile": resourceVSphereConfigurationProfile(),
114114
"vsphere_content_library": resourceVSphereContentLibrary(),
115115
"vsphere_content_library_item": resourceVSphereContentLibraryItem(),
116116
"vsphere_custom_attribute": resourceVSphereCustomAttribute(),
@@ -153,7 +153,7 @@ func Provider() *schema.Provider {
153153
DataSourcesMap: map[string]*schema.Resource{
154154
"vsphere_compute_cluster": dataSourceVSphereComputeCluster(),
155155
"vsphere_compute_cluster_host_group": dataSourceVSphereComputeClusterHostGroup(),
156-
"vsphere_config_profile": dataSourceVSphereConfigProfile(),
156+
"vsphere_configuration_profile": dataSourceVSphereConfigurationProfile(),
157157
"vsphere_content_library": dataSourceVSphereContentLibrary(),
158158
"vsphere_content_library_item": dataSourceVSphereContentLibraryItem(),
159159
"vsphere_custom_attribute": dataSourceVSphereCustomAttribute(),

0 commit comments

Comments
 (0)