Commit 4f22fd25 authored by Seth Vargo's avatar Seth Vargo

Merge pull request #1875 from ryanuber/f-dofix

builder/digitalocean: fix response decoding after api changes
parents 07b61f2c 78d6dda0
...@@ -5,12 +5,16 @@ ...@@ -5,12 +5,16 @@
package digitalocean package digitalocean
type Region struct { type Region struct {
Id uint `json:"id,omitempty"` //only in v1 api Slug string `json:"slug"`
Slug string `json:"slug"` //presen in both api Name string `json:"name"`
Name string `json:"name"` //presen in both api
Sizes []string `json:"sizes,omitempty"` //only in v2 api // v1 only
Available bool `json:"available,omitempty"` //only in v2 api Id uint `json:"id,omitempty"`
Features []string `json:"features,omitempty"` //only in v2 api
// v2 only
Sizes []string `json:"sizes,omitempty"`
Available bool `json:"available,omitempty"`
Features []string `json:"features,omitempty"`
} }
type RegionsResp struct { type RegionsResp struct {
...@@ -18,16 +22,19 @@ type RegionsResp struct { ...@@ -18,16 +22,19 @@ type RegionsResp struct {
} }
type Size struct { type Size struct {
Id uint `json:"id,omitempty"` //only in v1 api Slug string `json:"slug"`
Name string `json:"name,omitempty"` //only in v1 api
Slug string `json:"slug"` //presen in both api // v1 only
Memory uint `json:"memory,omitempty"` //only in v2 api Id uint `json:"id,omitempty"`
VCPUS uint `json:"vcpus,omitempty"` //only in v2 api Name string `json:"name,omitempty"`
Disk uint `json:"disk,omitempty"` //only in v2 api
Transfer float64 `json:"transfer,omitempty"` //only in v2 api // v2 only
PriceMonthly float64 `json:"price_monthly,omitempty"` //only in v2 api Memory uint `json:"memory,omitempty"`
PriceHourly float64 `json:"price_hourly,omitempty"` //only in v2 api VCPUS uint `json:"vcpus,omitempty"`
Regions []string `json:"regions,omitempty"` //only in v2 api Disk uint `json:"disk,omitempty"`
Transfer float64 `json:"transfer,omitempty"`
PriceMonthly float64 `json:"price_monthly,omitempty"`
PriceHourly float64 `json:"price_hourly,omitempty"`
} }
type SizesResp struct { type SizesResp struct {
...@@ -35,14 +42,15 @@ type SizesResp struct { ...@@ -35,14 +42,15 @@ type SizesResp struct {
} }
type Image struct { type Image struct {
Id uint `json:"id"` //presen in both api Id uint `json:"id"`
Name string `json:"name"` //presen in both api Name string `json:"name"`
Slug string `json:"slug"` //presen in both api Slug string `json:"slug"`
Distribution string `json:"distribution"` //presen in both api Distribution string `json:"distribution"`
Public bool `json:"public,omitempty"` //only in v2 api
Regions []string `json:"regions,omitempty"` //only in v2 api // v2 only
ActionIds []string `json:"action_ids,omitempty"` //only in v2 api Public bool `json:"public,omitempty"`
CreatedAt string `json:"created_at,omitempty"` //only in v2 api ActionIds []string `json:"action_ids,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
} }
type ImagesResp struct { type ImagesResp struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment