Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
NetworkDNS network.DNSBackend
NetworkLoadBalancer network.LoadBalancerBackend
NetworkVIP network.VIPBackend
NetworkZone network.ZoneBackend
StorageBlockVolume storage.BlockVolumeBackend
StormConfig storm.ConfigBackend
StormServer storm.ServerBackend
}
API is the structure that houses all of our various API clients that interact with various Storm resources.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the HTTP backend.
func (*Client) Call ¶
Call takes a path, such as "network/zone/details" and a params structure. It is recommended that the params be a map[string]interface{}, but you can use anything that serializes to the right json structure. A `interface{}` and an error are returned, in typical go fashion.
Example:
args := map[string]interface{}{
"uniq_id": "ABC123",
}
got, gotErr := apiClient.Call("bleed/asset/details", args)
if gotErr != nil {
panic(gotErr)
}
func (*Client) CallRaw ¶
CallRaw is just like Call, except it returns the raw json as a byte slice. However, in contrast to Call, CallRaw does *not* check the API response for LiquidWeb specific exceptions as defined in the type LWAPIError. As such, if calling this function directly, you must check for LiquidWeb specific exceptions yourself.
Example:
args := map[string]interface{}{
"uniq_id": "ABC123",
}
got, gotErr := apiClient.CallRaw("bleed/asset/details", args)
if gotErr != nil {
panic(gotErr)
}
// Check got now for LiquidWeb specific exceptions, as described above.