Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Extended lint clean
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilW committed May 18, 2020
1 parent 463d206 commit 0d93440
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 202 deletions.
23 changes: 14 additions & 9 deletions brightbox/resource_brightbox_api_client.go
Expand Up @@ -28,28 +28,33 @@ func resourceBrightboxAPIClient() *schema.Resource {

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Description: "Human Readable Name",
Type: schema.TypeString,
Optional: true,
},

"description": {
Type: schema.TypeString,
Optional: true,
Description: "Verbose Description of this client",
Type: schema.TypeString,
Optional: true,
},
"secret": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
Description: "A shared secret the client must present when authenticating",
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
"permissions_group": {
Description: "Summary of the permissions granted to the client (full, storage)",
Type: schema.TypeString,
Optional: true,
Default: validPermissionsGroups[0],
ValidateFunc: validation.StringInSlice(validPermissionsGroups, false),
},
"account": {
Type: schema.TypeString,
Computed: true,
Description: "The account the API client relates to",
Type: schema.TypeString,
Computed: true,
},
},
}
Expand Down
46 changes: 29 additions & 17 deletions brightbox/resource_brightbox_cloudip.go
Expand Up @@ -39,57 +39,69 @@ func resourceBrightboxCloudip() *schema.Resource {

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Description: "Name assigned to the Cloud IP",
Type: schema.TypeString,
Optional: true,
},

"target": {
Type: schema.TypeString,
Optional: true,
Description: "The object this Cloud IP maps to",
Type: schema.TypeString,
Optional: true,
},

"status": {
Type: schema.TypeString,
Computed: true,
Description: "Current state of the Cloud IP",
Type: schema.TypeString,
Computed: true,
},

"locked": {
Type: schema.TypeString,
Computed: true,
Description: "No lock on Cloud IPs",
Type: schema.TypeString,
Computed: true,
Deprecated: "No lock on Cloud IPs",
},

"public_ip": {
Type: schema.TypeString,
Computed: true,
Description: "Old alias of the IPv4 address",
Type: schema.TypeString,
Computed: true,
},

"fqdn": {
Type: schema.TypeString,
Computed: true,
Description: "Full Domain name entry for the Cloud IP",
Type: schema.TypeString,
Computed: true,
},

"reverse_dns": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Reverse DNS entry for the Cloud IP",
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"port_translator": {
Type: schema.TypeSet,
Optional: true,
Description: "Array of Port Translators",
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"incoming": {
Description: "Incoming Port",
Type: schema.TypeInt,
Required: true,
ValidateFunc: validation.IntBetween(minPort, maxPort),
},

"outgoing": {
Description: "Outgoing Port",
Type: schema.TypeInt,
Required: true,
ValidateFunc: validation.IntBetween(minPort, maxPort),
},
"protocol": {
Description: "Transport protocol to port translate (tcp/udp)",
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"tcp", "udp"}, false),
Expand Down
107 changes: 61 additions & 46 deletions brightbox/resource_brightbox_database_server.go
Expand Up @@ -30,86 +30,101 @@ func resourceBrightboxDatabaseServer() *schema.Resource {

Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Optional: true,
Description: "Editable user label",
Type: schema.TypeString,
Optional: true,
},
"description": {
Type: schema.TypeString,
Optional: true,
Description: "Editable user label",
Type: schema.TypeString,
Optional: true,
},
"maintenance_weekday": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Numerical index of weekday (0 is Sunday, 1 is Monday...) to set when automatic updates may be performed",
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"maintenance_hour": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Number representing 24hr time start of maintenance window hour for x:00-x:59 (0-23)",
Type: schema.TypeInt,
Optional: true,
Computed: true,
},
"database_engine": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "The DBMS engine of the Database Server",
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"database_version": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "The version of the given engine in use",
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"database_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "ID of the database type to use",
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"allow_access": {
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Required: true,
MinItems: 1,
Set: schema.HashString,
Description: "An array of resources allowed to access the database. Accepted values include `any`, `IPv4 address`, `server identifier`, `server group identifier`",
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Required: true,
MinItems: 1,
Set: schema.HashString,
},
"snapshot": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: "Identifier for an SQL snapshot to use as the basis of the new instance. Creates and restores the database from the snapshot",
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},
"snapshots_schedule": {
Description: "Crontab pattern for scheduled snapshots. Must be at least hourly",
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: ValidateCronString,
},
"snapshots_schedule_next_at": {
Type: schema.TypeString,
Computed: true,
Description: "time in UTC when next approximate scheduled snapshot will be run",
Type: schema.TypeString,
Computed: true,
},

"zone": {
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
Description: "ID of the zone the database server is in",
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
"admin_username": {
Type: schema.TypeString,
Computed: true,
Description: "Initial username required to login",
Type: schema.TypeString,
Computed: true,
},
"admin_password": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
Description: "Initial password required to login, only available at creation or following a password reset request",
Type: schema.TypeString,
Computed: true,
Sensitive: true,
},
"status": {
Type: schema.TypeString,
Computed: true,
Description: "State the database server is in",
Type: schema.TypeString,
Computed: true,
},
"locked": {
Type: schema.TypeBool,
Computed: true,
Description: "Initial password required to login, only available at creation or following a password reset request",
Type: schema.TypeBool,
Computed: true,
},
},
}
Expand Down
17 changes: 9 additions & 8 deletions brightbox/resource_brightbox_firewall_policy.go
Expand Up @@ -27,19 +27,20 @@ func resourceBrightboxFirewallPolicy() *schema.Resource {

Schema: map[string]*schema.Schema{
"server_group": {
Type: schema.TypeString,
Optional: true,
Description: "The server group using this policy",
Type: schema.TypeString,
Optional: true,
},
"name": {
Type: schema.TypeString,
Optional: true,
Default: "",
Description: "Optional name for this policy",
Type: schema.TypeString,
Optional: true,
},

"description": {
Type: schema.TypeString,
Optional: true,
Default: "",
Description: "Optional description of the policy",
Type: schema.TypeString,
Optional: true,
},
},
}
Expand Down
40 changes: 24 additions & 16 deletions brightbox/resource_brightbox_firewall_rule.go
Expand Up @@ -26,36 +26,44 @@ func resourceBrightboxFirewallRule() *schema.Resource {

Schema: map[string]*schema.Schema{
"firewall_policy": {
Type: schema.TypeString,
Required: true,
Description: "The firewall policy this rule is linked to",
Type: schema.TypeString,
Required: true,
},
"protocol": {
Type: schema.TypeString,
Optional: true,
Description: "Protocol Number, or one of tcp, udp, icmp",
Type: schema.TypeString,
Optional: true,
},
"source": {
Type: schema.TypeString,
Optional: true,
Description: "Subnet, ServerGroup or ServerID",
Type: schema.TypeString,
Optional: true,
},
"source_port": {
Type: schema.TypeString,
Optional: true,
Description: "single port, multiple ports or range separated by '-' or ':'; upto 255 characters example - '80', '80,443,21' or '3000-3999'",
Type: schema.TypeString,
Optional: true,
},
"destination": {
Type: schema.TypeString,
Optional: true,
Description: "Subnet, ServerGroup or ServerID",
Type: schema.TypeString,
Optional: true,
},
"destination_port": {
Type: schema.TypeString,
Optional: true,
Description: "single port, multiple ports or range separated by '-' or ':'; upto 255 characters example - '80', '80,443,21' or '3000-3999'",
Type: schema.TypeString,
Optional: true,
},
"icmp_type_name": {
Type: schema.TypeString,
Optional: true,
Description: "ICMP type name. 'echo-request', 'echo-reply'",
Type: schema.TypeString,
Optional: true,
},
"description": {
Type: schema.TypeString,
Optional: true,
Description: "User editable label",
Type: schema.TypeString,
Optional: true,
},
},
}
Expand Down

0 comments on commit 0d93440

Please sign in to comment.