Skip to content

Commit

Permalink
sdk supports storagetype so pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
ack committed Mar 1, 2016
1 parent 82bd96e commit 6d43fd6
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions builtin/providers/clc/resource_clc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,19 @@ func resourceCLCServer() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeMap},
},

// optional: misc state storage
// optional: misc state storage. non-CLC field
"metadata": &schema.Schema{
Type: schema.TypeMap,
Optional: true,
},

// optional
"storage_type": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Default: "standard",
},

// sorta computed
"private_ip_address": &schema.Schema{
Type: schema.TypeString,
Expand All @@ -93,6 +100,7 @@ func resourceCLCServer() *schema.Resource {
Computed: true,
Default: nil,
},

// computed
"created_date": &schema.Schema{
Type: schema.TypeString,
Expand All @@ -107,21 +115,6 @@ func resourceCLCServer() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
/*
"ttl": &schema.Schema{
Type: schema.TypeInt,
Optional: true,
},
"packages": &schema.Schema{
Type: schema.TypeList,
Optional: true,
},
"metal_configuration_id": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: true,
},
*/
},
}
}
Expand All @@ -138,6 +131,7 @@ func resourceCLCServerCreate(d *schema.ResourceData, meta interface{}) error {
SourceServerID: d.Get("source_server_id").(string),
Type: d.Get("type").(string),
IPaddress: d.Get("private_ip_address").(string),
Storagetype: d.Get("storage_type").(string),
}

var err error
Expand Down Expand Up @@ -197,6 +191,7 @@ func resourceCLCServerRead(d *schema.ResourceData, meta interface{}) error {
d.Set("memory_mb", s.Details.MemoryMB)
d.Set("disk_gb", s.Details.Storagegb)
d.Set("status", s.Status)
d.Set("storage_type", s.Storagetype)
d.Set("created_date", s.ChangeInfo.CreatedDate)
d.Set("modified_date", s.ChangeInfo.ModifiedDate)
return nil
Expand Down

0 comments on commit 6d43fd6

Please sign in to comment.