diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index bd4461aa2..b1b16df76 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -153,48 +153,48 @@ }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/aa", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/alert", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/api", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/dc", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/group", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/lb", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/server", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/CenturyLinkCloud/clc-sdk/status", - "Comment": "0.0.2-20-gd546567", - "Rev": "d546567abc945ad52d1906fc6c7caa8f903e7445" + "Comment": "0.0.2-27-gedd0930", + "Rev": "edd0930276e7f1a5f2cf3e7835b5dc42a3217669" }, { "ImportPath": "github.com/DreamItGetIT/statuscake", diff --git a/vendor/github.com/CenturyLinkCloud/clc-sdk/api/api.go b/vendor/github.com/CenturyLinkCloud/clc-sdk/api/api.go index 0146179dc..d70579d42 100644 --- a/vendor/github.com/CenturyLinkCloud/clc-sdk/api/api.go +++ b/vendor/github.com/CenturyLinkCloud/clc-sdk/api/api.go @@ -92,6 +92,7 @@ func (c *Client) Do(req *http.Request, ret interface{}) error { } req.Header.Add("User-Agent", c.config.UserAgent) + req.Header.Add("Api-Client", c.config.UserAgent) req.Header.Add("Accept", "application/json") if req.Body != nil { req.Header.Add("Content-Type", "application/json") diff --git a/vendor/github.com/CenturyLinkCloud/clc-sdk/dc/dc.go b/vendor/github.com/CenturyLinkCloud/clc-sdk/dc/dc.go index 03e33a1a6..781476013 100644 --- a/vendor/github.com/CenturyLinkCloud/clc-sdk/dc/dc.go +++ b/vendor/github.com/CenturyLinkCloud/clc-sdk/dc/dc.go @@ -61,5 +61,5 @@ type CapabilitiesResponse struct { NetworkId string `json:"networkId"` Type string `json:"type"` AccountID string `json:"accountID"` - } `json:deployableNetworks` + } `json:"deployableNetworks"` } diff --git a/vendor/github.com/CenturyLinkCloud/clc-sdk/group/group.go b/vendor/github.com/CenturyLinkCloud/clc-sdk/group/group.go index e764aea78..44634ca9f 100644 --- a/vendor/github.com/CenturyLinkCloud/clc-sdk/group/group.go +++ b/vendor/github.com/CenturyLinkCloud/clc-sdk/group/group.go @@ -169,9 +169,9 @@ type GroupDefaults struct { CPU string `json:"cpu,omitempty"` MemoryGB string `json:"memoryGB,omitempty"` NetworkID string `json:"networkId,omitempty"` - primaryDns string `json:"primaryDns,omitempty"` - secondaryDns string `json:"secondaryDns,omitempty"` - templateName string `json:"templateName,omitempty"` + PrimaryDns string `json:"primaryDns,omitempty"` + SecondaryDns string `json:"secondaryDns,omitempty"` + TemplateName string `json:"templateName,omitempty"` } // request body for /v2/groups/ALIAS/ID/horizontalAutoscalePolicy diff --git a/vendor/github.com/CenturyLinkCloud/clc-sdk/server/server.go b/vendor/github.com/CenturyLinkCloud/clc-sdk/server/server.go index d47666c0d..e231189c5 100644 --- a/vendor/github.com/CenturyLinkCloud/clc-sdk/server/server.go +++ b/vendor/github.com/CenturyLinkCloud/clc-sdk/server/server.go @@ -3,6 +3,7 @@ package server import ( "fmt" "regexp" + "time" "github.com/CenturyLinkCloud/clc-sdk/api" "github.com/CenturyLinkCloud/clc-sdk/status" @@ -313,26 +314,34 @@ func UpdateCustomfields(fields []api.Customfields) api.Update { } type Server struct { - Name string `json:"name"` - Description string `json:"description,omitempty"` - GroupID string `json:"groupId"` - SourceServerID string `json:"sourceServerId"` - IsManagedOS bool `json:"isManagedOS,omitempty"` - PrimaryDNS string `json:"primaryDns,omitempty"` - SecondaryDNS string `json:"secondaryDns,omitempty"` - NetworkID string `json:"networkId,omitempty"` - IPaddress string `json:"ipAddress,omitempty"` - Password string `json:"password,omitempty"` - CPU int `json:"cpu"` - MemoryGB int `json:"memoryGB"` - Type string `json:"type"` - Storagetype string `json:"storageType,omitempty"` - Customfields []api.Customfields `json:"customFields,omitempty"` - Additionaldisks []Disk `json:"additionalDisks,omitempty"` + Name string `json:"name"` + Description string `json:"description,omitempty"` + GroupID string `json:"groupId"` + SourceServerID string `json:"sourceServerId"` + IsManagedOS bool `json:"isManagedOS,omitempty"` + IsManagedBackup bool `json:"isManagedBackup,omitempty"` + PrimaryDNS string `json:"primaryDns,omitempty"` + SecondaryDNS string `json:"secondaryDns,omitempty"` + NetworkID string `json:"networkId,omitempty"` + IPaddress string `json:"ipAddress,omitempty"` + Password string `json:"password,omitempty"` + SourceServerPassword string `json:"sourceServerPassword,omitempty"` + CPU int `json:"cpu"` + CPUAutoscalePolicyID string `json:"cpuAutoscalePolicyId,omitempty"` + MemoryGB int `json:"memoryGB"` + Type string `json:"type"` + Storagetype string `json:"storageType,omitempty"` + AntiAffinityPolicyID string `json:"antiAffinityPolicyId,omitempty"` + Customfields []api.Customfields `json:"customFields,omitempty"` + Additionaldisks []Disk `json:"additionalDisks,omitempty"` + TTL *time.Time `json:"ttl,omitempty"` + Packages []Package `json:"packages,omitempty"` + ConfigurationID string `json:"configurationId,omitempty"` + OSType string `json:"osType,omitempty"` } func (s *Server) Valid() bool { - return s.Name != "" && s.CPU != 0 && s.MemoryGB != 0 && s.GroupID != "" && s.SourceServerID != "" + return s.Name != "" && s.CPU != 0 && s.MemoryGB != 0 && s.GroupID != "" && s.SourceServerID != "" && s.Type != "" } type Response struct { diff --git a/vendor/github.com/CenturyLinkCloud/clc-sdk/status/status.go b/vendor/github.com/CenturyLinkCloud/clc-sdk/status/status.go index b429aadf4..480aac442 100644 --- a/vendor/github.com/CenturyLinkCloud/clc-sdk/status/status.go +++ b/vendor/github.com/CenturyLinkCloud/clc-sdk/status/status.go @@ -30,6 +30,13 @@ func (s *Service) Get(id string) (*Response, error) { return status, err } +func (s *Service) GetBlueprint(id string) (*BlueprintOperation, error) { + url := fmt.Sprintf("%s/operations/%s/status/%s", s.config.BaseURL, s.config.Alias, id) + status := &BlueprintOperation{} + err := s.client.Get(url, status) + return status, err +} + func (s *Service) Poll(id string, poll chan *Response) error { for { status, err := s.Get(id) @@ -128,3 +135,35 @@ func (q *QueuedOperation) Status() *Status { } return st } + +/* BlueprintOperation is a status object representing a running blueprint job + { + "requestType":"blueprintOperation", + "status":"succeeded", + "summary":{ + "blueprintId":51229, + "locationId":"CA1", + "links":[ + { + "rel":"network", + "href":"/v2-experimental/networks/ZZBB/CA1/6955e7c39b5648df91bfb32e5d0aa24b", + "id":"6955e7c39b5648df91bfb32e5d0aa24b" + } + ] + }, + "source":{"userName":"ack","requestedAt":"2016-03-24T16:47:04Z"} + } +*/ +type BlueprintOperation struct { + RequestType string `json:"requestType,omitempty"` + Status string `json:"status,omitempty"` + Summary struct { + BlueprintID int `json:"blueprintId,omitempty"` + LocationID string `json:"locationId,omitempty"` + Links api.Links `json:"links,omitempty"` + } `json:"summary,omitempty"` + Source struct { + UserName string `json:"userName"` + RequestedAt time.Time `json:"requestedAt,omitempty"` + } `json:"source,omitempty"` +}