Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
78d6dda0
Commit
78d6dda0
authored
Jan 26, 2015
by
Ryan Uber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: fix response decoding after api changes
parent
e3c2f01c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
24 deletions
+32
-24
builder/digitalocean/api.go
builder/digitalocean/api.go
+32
-24
No files found.
builder/digitalocean/api.go
View file @
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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment