cloudamqp

package
v0.0.0-...-8d5ac9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError map[string]interface{}

APIError represents a CloudAMQP API Error response

func (APIError) Empty

func (e APIError) Empty() bool

Empty returns true if empty.

func (APIError) Error

func (e APIError) Error() string

type Client

type Client struct {
	Instances *InstanceService
	// contains filtered or unexported fields
}

Client is a sling client for instance resources

func NewClient

func NewClient(httpClient *http.Client, baseURL *url.URL, token string) *Client

NewClient returns a new CloudAMQP API client. If a nil httpClient is given, the http.DefaultClient will be used. If a nil baseURL is given, the defaultBaseURL will be used.

type CreateInstanceParams

type CreateInstanceParams struct {
	Name       string `url:"name"`
	Plan       string `url:"plan"`
	Region     string `url:"region"`
	VpcSubnet  string `url:"vpc_subnet,omitempty"`
	Nodes      int    `url:"nodes,omitempty"`
	RmqVersion string `url:"rmq_version,omitempty"`
}

CreateInstanceParams are the parameters for OrganizationService.Create.

type Instance

type Instance struct {
	ID     int    `json:"id"`
	Plan   string `json:"plan"`
	Region string `json:"region"`
	Name   string `json:"name"`
	URL    string `json:"url,omitempty"`
	APIKey string `json:"apikey,omitempty"`
}

Instance represents a CloudAMQP instance. Based on https://customer.cloudamqp.com/team/api.

type InstanceService

type InstanceService struct {
	// contains filtered or unexported fields
}

InstanceService provides methods for accessing CloudAMQP instance API endpoints. https://customer.cloudamqp.com/team/api

func (*InstanceService) Create

Create a new CloudAMP instance. https://customer.cloudamqp.com/team/api

func (*InstanceService) CreateAndWait

func (s *InstanceService) CreateAndWait(params *CreateInstanceParams, timeoutInSeconds float64) (*Instance, *http.Response, error)

CreateAndWait Create a new CloudAMP instance and waits for it to be available https://customer.cloudamqp.com/team/api

func (*InstanceService) Delete

func (s *InstanceService) Delete(id int) (*http.Response, error)

Delete a CloudAMQP instance. https://customer.cloudamqp.com/team/api

func (*InstanceService) Get

func (s *InstanceService) Get(id int) (*Instance, *http.Response, error)

Get a CloudAMQP instance. https://customer.cloudamqp.com/team/api

func (*InstanceService) List

func (s *InstanceService) List() ([]Instance, *http.Response, error)

List instances available to the authenticated session. https://customer.cloudamqp.com/team/api

func (*InstanceService) Update

func (s *InstanceService) Update(id int, params *UpdateInstanceParams) (*Instance, *http.Response, error)

Update a CloudAMQP instance. https://customer.cloudamqp.com/team/api

type UpdateInstanceParams

type UpdateInstanceParams struct {
	Name  string `url:"name,omitempty"`
	Plan  string `url:"plan,omitempty"`
	Nodes int    `url:"nodes,omitempty"`
}

UpdateInstanceParams are the parameters for OrganizationService.Create.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL