cloud

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressList

type AddressList struct {
	Results    []IpAddress `json:"results,omitempty"`
	Pagination Pagination  `json:"pagination,omitempty"`
}

type Client

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

func (*Client) SSHKeys

func (c *Client) SSHKeys() *SshKeysApi

func (*Client) Servers

func (c *Client) Servers() ServersClient

type ClientWrapper

type ClientWrapper interface {
	SSHKeys() *SshKeysApi
	Servers() ServersClient
}

func NewClient

func NewClient(basePath, apiKey string) ClientWrapper

type Console

type Console struct {
	Type_ string `json:"type,omitempty"`
	Url   string `json:"url,omitempty"`
}

type IpAddress

type IpAddress struct {
	Status       string    `json:"status,omitempty"`
	Version      string    `json:"version,omitempty"`
	ZoneId       string    `json:"zoneId,omitempty"`
	CreatedAt    time.Time `json:"createdAt,omitempty"`
	Address      string    `json:"address,omitempty"`
	AddressId    string    `json:"addressId,omitempty"`
	Type_        string    `json:"type,omitempty"`
	DataCenterId string    `json:"dataCenterId,omitempty"`
	ModifiedAt   time.Time `json:"modifiedAt,omitempty"`
	ServerId     string    `json:"serverId,omitempty"`
}

type ModelError

type ModelError struct {
	Message string `json:"message,omitempty"`
	Code    string `json:"code,omitempty"`
}

type Pagination

type Pagination struct {
	Limit int32  `json:"limit,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Next  string `json:"next,omitempty"`
	Total int64  `json:"total,omitempty"`
}

type SSHKey

type SSHKey struct {
	Fingerprint string    `json:"fingerprint,omitempty"`
	Name        string    `json:"name,omitempty"`
	SshKeyId    string    `json:"sshKeyId,omitempty"`
	CreatedAt   time.Time `json:"createdAt,omitempty"`
	ModifiedAt  time.Time `json:"modifiedAt,omitempty"`
}

type SSHKeyCreate

type SSHKeyCreate struct {
	Key  string `json:"key,omitempty"`
	Name string `json:"name,omitempty"`
}

type SSHKeyList

type SSHKeyList struct {
	Results    []SSHKey   `json:"results,omitempty"`
	Pagination Pagination `json:"pagination,omitempty"`
}

type Server

type Server struct {
	PrivateIp        string    `json:"privateIp,omitempty"`
	ImageId          string    `json:"imageId,omitempty"`
	BackupsEnabled   bool      `json:"backupsEnabled,omitempty"`
	Description      string    `json:"description,omitempty"`
	SpecId           string    `json:"specId,omitempty"`
	PublicIp         string    `json:"publicIp,omitempty"`
	DataCenterId     string    `json:"dataCenterId,omitempty"`
	ModifiedAt       time.Time `json:"modifiedAt,omitempty"`
	Status           string    `json:"status,omitempty"`
	BackupScheduleId string    `json:"backupScheduleId,omitempty"`
	CreatedAt        time.Time `json:"createdAt,omitempty"`
	ZoneId           string    `json:"zoneId,omitempty"`
	Hostname         string    `json:"hostname,omitempty"`
	Username         string    `json:"username,omitempty"`
	SshKeyId         string    `json:"sshKeyId,omitempty"`
	TaskState        string    `json:"taskState,omitempty"`
	ServerId         string    `json:"serverId,omitempty"`
}

type ServerAction

type ServerAction struct {
	Status         string     `json:"status,omitempty"`
	ServerActionId string     `json:"serverActionId,omitempty"`
	CreatedAt      time.Time  `json:"createdAt,omitempty"`
	ModifiedAt     time.Time  `json:"modifiedAt,omitempty"`
	Type_          string     `json:"type,omitempty"`
	CompletedAt    *time.Time `json:"completedAt,omitempty"`
	ServerId       string     `json:"serverId,omitempty"`
}

type ServerActionList

type ServerActionList struct {
	Results    []ServerAction `json:"results,omitempty"`
	Pagination Pagination     `json:"pagination,omitempty"`
}

type ServerCreate

type ServerCreate struct {
	BackupsEnabled bool     `json:"backupsEnabled,omitempty"`
	SshKeyId       string   `json:"sshKeyId,omitempty"`
	Volumes        []string `json:"volumes,omitempty"`
	DataCenterId   string   `json:"dataCenterId,omitempty"`
	Addresses      []string `json:"addresses,omitempty"`
	Spec           string   `json:"spec,omitempty"`
	Description    string   `json:"description,omitempty"`
	ZoneId         string   `json:"zoneId,omitempty"`
	Password       string   `json:"password,omitempty"`
	Hostname       string   `json:"hostname,omitempty"`
	BootScript     string   `json:"bootScript,omitempty"`
	Username       string   `json:"username,omitempty"`
	Discount       string   `json:"discount,omitempty"`
	Image          string   `json:"image,omitempty"`
}

type ServerList

type ServerList struct {
	Results    []Server   `json:"results,omitempty"`
	Pagination Pagination `json:"pagination,omitempty"`
}

type ServersApi

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

func NewServersApi

func NewServersApi(basePath string, apiKey string) *ServersApi

func (ServersApi) AddServer

func (a ServersApi) AddServer(body ServerCreate) (Server, error)

*

  • Create a new server
  • Use to initiate the provisioning process for a new server
  • @param body server details
  • @return Server

func (a ServersApi) AddServer (body ServerCreate) (Server, error) {

func (ServersApi) Console

func (a ServersApi) Console(serverId string) (Console, error)

*

  • Get a console URL to this server
  • This URL can be viewed in a web browser, and allows you to access your server even when its network is down because of misconfigured interfaces or iptables rules, or when it is failing to boot properly.
  • @param serverId Server to access (serverId)
  • @return Console

func (a ServersApi) Console (serverId string) (Console, error) {

func (ServersApi) DestroyServer

func (a ServersApi) DestroyServer(serverId string) (ServerAction, error)

*

  • Destroy an existing server
  • Use to initiate the shutdown and destruction of an existing server.
  • @param serverId Id of server to be destroyed
  • @return ServerAction

func (a ServersApi) DestroyServer (serverId string) (ServerAction, error) {

func (ServersApi) GetServerActionById

func (a ServersApi) GetServerActionById(serverId string, serverActionId string) (ServerAction, error)

*

  • Get ServerAction by id *
  • @param serverId serverId of associated server
  • @param serverActionId Id of ServerAction to be fetched
  • @return ServerAction

func (a ServersApi) GetServerActionById (serverId string, serverActionId string) (ServerAction, error) {

func (ServersApi) GetServerActionList

func (a ServersApi) GetServerActionList(serverId string, type_ string, limit int32, offset int32) (ServerActionList, error)

*

  • List of actions performed on the specified server *
  • @param serverId serverId of associated server
  • @param type_ Action type filter (exact match)
  • @param limit Number of results to display
  • @param offset The starting position of the query
  • @return ServerActionList

func (a ServersApi) GetServerActionList (serverId string, type_ string, limit int32, offset int32) (ServerActionList, error) {

func (ServersApi) GetServerAddressById

func (a ServersApi) GetServerAddressById(serverId string, addressId string) (IpAddress, error)

*

  • Find Addresses by serverId and addressId *
  • @param serverId serverId of associated server
  • @param addressId Id of Address to be fetched
  • @return IpAddress

func (a ServersApi) GetServerAddressById (serverId string, addressId string) (IpAddress, error) {

func (ServersApi) GetServerAddressList

func (a ServersApi) GetServerAddressList(serverId string, address string, status string, type_ string, limit int32, offset int32) (AddressList, error)

*

  • List of Addresses of the specified server *
  • @param serverId serverId of associated server
  • @param address Numeric address (exact match)
  • @param status Address status (exact match)
  • @param type_ Address type (exact match)
  • @param limit Number of results to display
  • @param offset The starting position of the query
  • @return AddressList

func (a ServersApi) GetServerAddressList (serverId string, address string, status string, type_ string, limit int32, offset int32) (AddressList, error) {

func (ServersApi) GetServerById

func (a ServersApi) GetServerById(serverId string) (Server, error)

*

  • Find server by serverId *
  • @param serverId Id of server to be fetched
  • @return Server

func (a ServersApi) GetServerById (serverId string) (Server, error) {

func (ServersApi) GetServerList

func (a ServersApi) GetServerList(status string, backupsEnabled bool, limit int32, offset int32) (ServerList, error)

*

  • Get a list of servers. By default, all destroyed servers are filtered out. *
  • @param status Server status filter (exact match)
  • @param backupsEnabled BackupsEnabled flag
  • @param limit Number of results to display
  • @param offset The starting position of the query
  • @return ServerList

func (a ServersApi) GetServerList (status string, backupsEnabled bool, limit int32, offset int32) (ServerList, error) {

func (ServersApi) PatchServer

func (a ServersApi) PatchServer(serverId string, body Server) (Server, error)

*

  • Update server details *
  • @param serverId serverId of server to be updated
  • @param body Server data
  • @return Server

func (a ServersApi) PatchServer (serverId string, body Server) (Server, error) {

func (ServersApi) StartServer

func (a ServersApi) StartServer(serverId string) (ServerAction, error)

*

  • Start a server
  • Use to start a stopped server
  • @param serverId serverId of server to be started
  • @return ServerAction

func (a ServersApi) StartServer (serverId string) (ServerAction, error) {

func (ServersApi) StopServer

func (a ServersApi) StopServer(serverId string) (ServerAction, error)

*

  • Stop a server
  • Use to stop a running server
  • @param serverId serverId of server to be stopped
  • @return ServerAction

func (a ServersApi) StopServer (serverId string) (ServerAction, error) {

type ServersClient

type ServersClient interface {
	AddServer(body ServerCreate) (Server, error)
	GetServerById(serverId string) (Server, error)
	StartServer(serverId string) (ServerAction, error)
	StopServer(serverId string) (ServerAction, error)
	DestroyServer(serverId string) (ServerAction, error)
}

type SshKeysApi

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

func NewSshKeysApi

func NewSshKeysApi(basePath string, apiKey string) *SshKeysApi

func (SshKeysApi) AddSSHKey

func (a SshKeysApi) AddSSHKey(body SSHKeyCreate) (SSHKey, error)

*

  • Create a new SSH key *
  • @param body SSH key details
  • @return SSHKey

func (a SshKeysApi) AddSSHKey (body SSHKeyCreate) (SSHKey, error) {

func (SshKeysApi) DeleteSSHKey

func (a SshKeysApi) DeleteSSHKey(sshKeyId string) error

*

  • Delete a SSH key resource
  • Permanently deletes the SSH key, making it unavailable for new servers.
  • @param sshKeyId Id of SSH key to be deleted
  • @return void

func (a SshKeysApi) DeleteSSHKey (sshKeyId string) (error) {

func (SshKeysApi) GetSSHKeyById

func (a SshKeysApi) GetSSHKeyById(sshKeyId string) (SSHKey, error)

*

  • Find SSH key by sshKeyId *
  • @param sshKeyId Id of SSH key to be fetched
  • @return SSHKey

func (a SshKeysApi) GetSSHKeyById (sshKeyId string) (SSHKey, error) {

func (SshKeysApi) GetSSHKeyList

func (a SshKeysApi) GetSSHKeyList(name string, limit int32, offset int32) (SSHKeyList, error)

*

  • Get a list of SSH keys. *
  • @param name SSH key name filter (exact match)
  • @param limit Number of results to display
  • @param offset The starting position of the query
  • @return SSHKeyList

func (a SshKeysApi) GetSSHKeyList (name string, limit int32, offset int32) (SSHKeyList, error) {

Jump to

Keyboard shortcuts

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