Add locations

This commit is contained in:
stSolo
2022-07-07 18:46:39 +03:00
parent e4be812c68
commit 48cada2cf3
77 changed files with 520 additions and 44 deletions

View File

@@ -207,7 +207,7 @@ func dataSourceComputeRead(ctx context.Context, d *schema.ResourceData, m interf
return diag.FromErr(flattenCompute(d, compFacts))
}
func dataSourceCompute() *schema.Resource {
func DataSourceCompute() *schema.Resource {
return &schema.Resource{
SchemaVersion: 1,
@@ -302,7 +302,6 @@ func dataSourceCompute() *schema.Resource {
"extra_disks": {
Type: schema.TypeSet,
Computed: true,
MaxItems: constants.MaxExtraDisksPerCompute,
Elem: &schema.Schema{
Type: schema.TypeInt,
},

View File

@@ -35,7 +35,7 @@ import (
"bytes"
"hash/fnv"
"github.com/rudecs/terraform-provider-decort/internal/provider"
"github.com/rudecs/terraform-provider-decort/internal/statefuncs"
log "github.com/sirupsen/logrus"
"sort"
@@ -125,7 +125,7 @@ func networkSubresourceSchemaMake() map[string]*schema.Schema {
"net_type": {
Type: schema.TypeString,
Required: true,
StateFunc: provider.StateFuncToUpper,
StateFunc: statefuncs.StateFuncToUpper,
ValidateFunc: validation.StringInSlice([]string{"EXTNET", "VINS"}, false), // observe case while validating
Description: "Type of the network for this connection, either EXTNET or VINS.",
},

View File

@@ -40,7 +40,7 @@ import (
"github.com/rudecs/terraform-provider-decort/internal/constants"
"github.com/rudecs/terraform-provider-decort/internal/controller"
"github.com/rudecs/terraform-provider-decort/internal/provider"
"github.com/rudecs/terraform-provider-decort/internal/statefuncs"
log "github.com/sirupsen/logrus"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
@@ -394,7 +394,7 @@ func ResourceCompute() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
StateFunc: provider.StateFuncToUpper,
StateFunc: statefuncs.StateFuncToUpper,
ValidateFunc: validation.StringInSlice([]string{"KVM_X86", "KVM_PPC"}, false), // observe case while validating
Description: "Hardware architecture of this compute instance.",
},