diff --git a/docs/data-sources/compute_datastore_cluster.md b/docs/data-sources/compute_datastore_cluster.md index 43ebdab..31d875e 100644 --- a/docs/data-sources/compute_datastore_cluster.md +++ b/docs/data-sources/compute_datastore_cluster.md @@ -32,9 +32,12 @@ data "cloudtemple_compute_datastore_cluster" "name" { ## Schema -### Optional +### Required - `datacenter_id` (String) + +### Optional + - `host_cluster_id` (String) - `host_id` (String) - `machine_manager_id` (String) diff --git a/internal/provider/data_source_compute_datastore_cluster.go b/internal/provider/data_source_compute_datastore_cluster.go index bdaaf90..7346237 100644 --- a/internal/provider/data_source_compute_datastore_cluster.go +++ b/internal/provider/data_source_compute_datastore_cluster.go @@ -61,28 +61,24 @@ func dataSourceDatastoreCluster() *schema.Resource { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"id"}, - AtLeastOneOf: []string{"id", "name"}, }, "datacenter_id": { Type: schema.TypeString, - Optional: true, + Required: true, Default: "", ConflictsWith: []string{"id"}, - AtLeastOneOf: []string{"id", "name"}, }, "host_id": { Type: schema.TypeString, Optional: true, Default: "", ConflictsWith: []string{"id"}, - AtLeastOneOf: []string{"id", "name"}, }, "host_cluster_id": { Type: schema.TypeString, Optional: true, Default: "", ConflictsWith: []string{"id"}, - AtLeastOneOf: []string{"id", "name"}, }, // Out diff --git a/internal/provider/data_source_compute_network.go b/internal/provider/data_source_compute_network.go index e726018..39a74a9 100644 --- a/internal/provider/data_source_compute_network.go +++ b/internal/provider/data_source_compute_network.go @@ -62,44 +62,52 @@ func dataSourceNetwork() *schema.Resource { ConflictsWith: []string{"id"}, }, "machine_manager_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "datacenter_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "virtual_machine_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "type": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringInSlice([]string{"Network", "DistributedVirtualPortgroup"}, false), + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{"Network", "DistributedVirtualPortgroup"}, false), + ConflictsWith: []string{"id"}, }, "virtual_switch_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "host_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "folder_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "host_cluster_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, // Out diff --git a/internal/provider/data_source_compute_virtual_switch.go b/internal/provider/data_source_compute_virtual_switch.go index 6f99f61..228f7a9 100644 --- a/internal/provider/data_source_compute_virtual_switch.go +++ b/internal/provider/data_source_compute_virtual_switch.go @@ -57,19 +57,22 @@ func dataSourceVirtualSwitch() *schema.Resource { ConflictsWith: []string{"id"}, }, "machine_manager_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "datacenter_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, "host_cluster_id": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.IsUUID, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.IsUUID, + ConflictsWith: []string{"id"}, }, // Out