provider/scaleway: improve schema resources (#13522)
improve readability by removing unecessary schema type declarations this changeset does not include any semantic changes
This commit is contained in:
parent
ebb169a79f
commit
41e14baa57
|
@ -13,43 +13,43 @@ func dataSourceScalewayBootscript() *schema.Resource {
|
|||
Read: dataSourceScalewayBootscriptRead,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"name_filter": &schema.Schema{
|
||||
"name_filter": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"architecture": &schema.Schema{
|
||||
"architecture": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Optional: true,
|
||||
},
|
||||
// Computed values.
|
||||
"organization": &schema.Schema{
|
||||
"organization": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"public": &schema.Schema{
|
||||
"public": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"boot_cmd_args": &schema.Schema{
|
||||
"boot_cmd_args": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"dtb": &schema.Schema{
|
||||
"dtb": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"initrd": &schema.Schema{
|
||||
"initrd": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"kernel": &schema.Schema{
|
||||
"kernel": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -12,32 +12,32 @@ func dataSourceScalewayImage() *schema.Resource {
|
|||
Read: dataSourceScalewayImageRead,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Computed: true,
|
||||
},
|
||||
"name_filter": &schema.Schema{
|
||||
"name_filter": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"architecture": &schema.Schema{
|
||||
"architecture": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
// Computed values.
|
||||
"organization": &schema.Schema{
|
||||
"organization": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"public": &schema.Schema{
|
||||
"public": {
|
||||
Type: schema.TypeBool,
|
||||
Computed: true,
|
||||
},
|
||||
"creation_date": &schema.Schema{
|
||||
"creation_date": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -18,11 +18,11 @@ func resourceScalewayIP() *schema.Resource {
|
|||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"server": &schema.Schema{
|
||||
"server": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"ip": &schema.Schema{
|
||||
"ip": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -19,11 +19,11 @@ func resourceScalewaySecurityGroup() *schema.Resource {
|
|||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"description": &schema.Schema{
|
||||
"description": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
|
|
|
@ -15,11 +15,11 @@ func resourceScalewaySecurityGroupRule() *schema.Resource {
|
|||
Update: resourceScalewaySecurityGroupRuleUpdate,
|
||||
Delete: resourceScalewaySecurityGroupRuleDelete,
|
||||
Schema: map[string]*schema.Schema{
|
||||
"security_group": &schema.Schema{
|
||||
"security_group": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"action": &schema.Schema{
|
||||
"action": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
|
@ -30,7 +30,7 @@ func resourceScalewaySecurityGroupRule() *schema.Resource {
|
|||
return
|
||||
},
|
||||
},
|
||||
"direction": &schema.Schema{
|
||||
"direction": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
|
@ -41,11 +41,11 @@ func resourceScalewaySecurityGroupRule() *schema.Resource {
|
|||
return
|
||||
},
|
||||
},
|
||||
"ip_range": &schema.Schema{
|
||||
"ip_range": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"protocol": &schema.Schema{
|
||||
"protocol": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
|
||||
|
@ -56,7 +56,7 @@ func resourceScalewaySecurityGroupRule() *schema.Resource {
|
|||
return
|
||||
},
|
||||
},
|
||||
"port": &schema.Schema{
|
||||
"port": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
},
|
||||
|
|
|
@ -19,45 +19,45 @@ func resourceScalewayServer() *schema.Resource {
|
|||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"image": &schema.Schema{
|
||||
"image": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"type": &schema.Schema{
|
||||
"type": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"bootscript": &schema.Schema{
|
||||
"bootscript": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"tags": &schema.Schema{
|
||||
"tags": {
|
||||
Type: schema.TypeList,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
},
|
||||
Optional: true,
|
||||
},
|
||||
"enable_ipv6": &schema.Schema{
|
||||
"enable_ipv6": {
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
},
|
||||
"dynamic_ip_required": &schema.Schema{
|
||||
"dynamic_ip_required": {
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
},
|
||||
"security_group": &schema.Schema{
|
||||
"security_group": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
"volume": &schema.Schema{
|
||||
"volume": {
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
|
@ -68,36 +68,36 @@ func resourceScalewayServer() *schema.Resource {
|
|||
Required: true,
|
||||
ValidateFunc: validateVolumeSize,
|
||||
},
|
||||
"type": &schema.Schema{
|
||||
"type": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ValidateFunc: validateVolumeType,
|
||||
},
|
||||
"volume_id": &schema.Schema{
|
||||
"volume_id": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"private_ip": &schema.Schema{
|
||||
"private_ip": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"public_ip": &schema.Schema{
|
||||
"public_ip": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"public_ipv6": &schema.Schema{
|
||||
"public_ipv6": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"state": &schema.Schema{
|
||||
"state": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
"state_detail": &schema.Schema{
|
||||
"state_detail": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -21,21 +21,21 @@ func resourceScalewayVolume() *schema.Resource {
|
|||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
},
|
||||
"size_in_gb": &schema.Schema{
|
||||
"size_in_gb": {
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
ValidateFunc: validateVolumeSize,
|
||||
},
|
||||
"type": &schema.Schema{
|
||||
"type": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ValidateFunc: validateVolumeType,
|
||||
},
|
||||
"server": &schema.Schema{
|
||||
"server": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -16,12 +16,12 @@ func resourceScalewayVolumeAttachment() *schema.Resource {
|
|||
Read: resourceScalewayVolumeAttachmentRead,
|
||||
Delete: resourceScalewayVolumeAttachmentDelete,
|
||||
Schema: map[string]*schema.Schema{
|
||||
"server": &schema.Schema{
|
||||
"server": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"volume": &schema.Schema{
|
||||
"volume": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
|
|
Loading…
Reference in New Issue