storm

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerStates = []string{
	"Building",
	"Cloning",
	"Resizing",
	"Moving",
	"Booting",
	"Stopping",
	"Restarting",
	"Rebooting",
	"Shutting Down",
	"Restoring Backup",
	"Creating Image",
	"Deleting Image",
	"Restoring Image",
	"Re-Imaging",
	"Updating Firewall",
	"Updating Network",
	"Adding IPs",
	"Removing IP",
	"Destroying",
	"Shutdown",
	"Provisioning",
}

ServerStates represents the various states the server can be in.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID               types.FlexInt                     `json:"id"`
	Active           types.NumericalBoolean            `json:"active,omitempty"`
	Available        types.NumericalBoolean            `json:"available,omitempty"`
	Category         string                            `json:"category,omitempty"`
	Description      string                            `json:"description,omitempty"`
	Disk             types.FlexInt                     `json:"disk,omitempty"`
	Featured         types.NumericalBoolean            `json:"featured,omitempty"`
	Memory           types.FlexInt                     `json:"memory,omitempty"`
	VCPU             types.FlexInt                     `json:"vcpu,omitempty"`
	ZoneAvailability map[string]types.NumericalBoolean `json:"zone_availability,omitempty"`
}

Config represents the configuration of the server.

type ConfigBackend

type ConfigBackend interface {
	Details(string) (*Config, error)
	List(ConfigListParams) (*ConfigList, error)
}

ConfigBackend is the interface for storm configs.

type ConfigClient

type ConfigClient struct {
	Backend liquidweb.Backend
}

ConfigClient is the API client for storm configs.

func (*ConfigClient) Details

func (c *ConfigClient) Details(id string) (*Config, error)

Details fetches the details for a storm config.

func (*ConfigClient) List

func (c *ConfigClient) List(params ConfigListParams) (*ConfigList, error)

List fetches a list of storm configs.

type ConfigList

type ConfigList struct {
	liquidweb.ListMeta
	Items []Config
}

ConfigList is an envelope for the API result containing either a list of storm configs or an error.

type ConfigListParams

type ConfigListParams struct {
	Available bool   `json:"available,omitempty"`
	Category  string `json:"category,omitempty"`
	PageNum   int    `json:"page_num,omitempty"`
	PageSize  int    `json:"page_size,omitempty"`
}

ConfigListParams are the set of parameters you can pass to the API for listing storm configs.

type ConfigParams

type ConfigParams struct {
	ID string `json:"id,omitempty"`
}

ConfigParams is the set of parameters used when fetching storm configuration details

type Server

type Server struct {
	ACCNT               types.FlexInt   `json:"accnt,omitempty"`
	Active              types.FlexInt   `json:"active,omitempty"`
	BackupEnabled       types.FlexInt   `json:"backup_enabled,omitempty"`
	BackupPlan          string          `json:"backup_plan,omitempty"`
	BackupQuota         types.FlexInt   `json:"backup_quota,omitempty"`
	BackupSize          string          `json:"backup_size,omitempty"`
	BandwidthQuota      string          `json:"bandwidth_quota,omitempty"`
	ConfigDescription   string          `json:"config_description,omitempty"`
	ConfigID            types.FlexInt   `json:"config_id,omitempty"`
	CreateDate          types.Timestamp `json:"create_date,omitempty"`
	DiskSpace           types.FlexInt   `json:"disk_space,omitempty"`
	Domain              string          `json:"domain,omitempty"`
	IP                  net.IP          `json:"ip,omitempty"`
	IPCount             types.FlexInt   `json:"ip_count,omitempty"`
	ManageLevel         string          `json:"manage_level,omitempty"`
	Memory              types.FlexInt   `json:"memory,omitempty"`
	Template            string          `json:"template,omitempty"`
	TemplateDescription string          `json:"template_description,omitempty"`
	Type                string          `json:"type,omitempty"`
	UniqID              string          `json:"uniq_id,omitempty"`
	VCPU                types.FlexInt   `json:"vcpu,omitempty"`
	Zone                ServerZone      `json:"zone,omitempty"`
}

Server represents the underlying Storm VPS.

type ServerBackend

type ServerBackend interface {
	Create(ServerParams) (*Server, error)
	List(ServerListParams) (*ServerList, error)
	Details(string) (*Server, error)
	Update(ServerParams) (*Server, error)
	Destroy(string) (*ServerDeletion, error)
	Status(string) (*ServerStatus, error)
	Stop(string, ...bool) (*ServerStop, error)
	Reboot(string) (*ServerReboot, error)
	Start(string) (*ServerStart, error)
}

ServerBackend is the interface for storm servers.

type ServerClient

type ServerClient struct {
	Backend liquidweb.Backend
}

ServerClient is the API client for storm servers.

func (*ServerClient) Create

func (c *ServerClient) Create(params ServerParams) (*Server, error)

Create a new storm server.

func (*ServerClient) Destroy

func (c *ServerClient) Destroy(id string) (*ServerDeletion, error)

Destroy a storm server.

func (*ServerClient) Details

func (c *ServerClient) Details(id string) (*Server, error)

Details fetches the details for a storm server.

func (*ServerClient) List

func (c *ServerClient) List(params ServerListParams) (*ServerList, error)

List will fetch a list of storm servers.

func (*ServerClient) Reboot added in v1.6.3

func (c *ServerClient) Reboot(uniqId string) (*ServerReboot, error)

Reboot a storm server.

func (*ServerClient) Start added in v1.6.3

func (c *ServerClient) Start(uniqId string) (*ServerStart, error)

Start a Storm Server.

func (*ServerClient) Status

func (c *ServerClient) Status(id string) (*ServerStatus, error)

Status returns the current status of a storm server.

func (*ServerClient) Stop added in v1.6.3

func (c *ServerClient) Stop(uniqId string, force ...bool) (*ServerStop, error)

Stop a storm server.

func (*ServerClient) Update

func (c *ServerClient) Update(params ServerParams) (*Server, error)

Update a storm server.

type ServerDeletion

type ServerDeletion struct {
	Destroyed string `json:"destroyed"`
}

ServerDeletion represents the API result when deleting a Storm Server.

type ServerList

type ServerList struct {
	liquidweb.ListMeta
	Items []Server
}

ServerList is an envelope for the API result containing either a list of storm configs or an error.

type ServerListParams

type ServerListParams struct {
	liquidweb.PageParams
	Parent string `json:"parent,omitempty"`
}

ServerListParams is the set parameters used when listing Storm Servers.

type ServerParams

type ServerParams struct {
	UniqID         string `json:"uniq_id,omitempty"`
	BackupEnabled  int    `json:"backup_enabled,omitempty"`
	BackupID       int    `json:"backup_id,omitempty"`
	BackupPlan     string `json:"backup_plan,omitempty"`
	BackupQuota    int    `json:"backup_quota,omitempty"`
	BandwidthQuota string `json:"bandwidth_quota,omitempty"`
	ConfigID       int    `json:"config_id,omitempty"`
	Domain         string `json:"domain,omitempty"`
	ImageID        int    `json:"image_id,omitempty"`
	IPCount        int    `json:"ip_count,omitempty"`
	MSSQL          string `json:"ms_sql,omitempty"`
	Password       string `json:"password,omitempty"`
	PublicSSHKey   string `json:"public_ssh_key,omitempty"`
	Template       string `json:"template,omitempty"`
	Zone           int    `json:"zone,omitempty"`
}

ServerParams is the set of parameters used when creating or updating a Storm Server.

type ServerReboot added in v1.6.3

type ServerReboot struct {
	Rebooted string `json:"rebooted"`
}

ServerReboot represents a rebooteed Storm Server response.

type ServerRunningStatus

type ServerRunningStatus struct {
	CurrentStep    string `json:"current_step,omitempty"`
	DetailedStatus string `json:"detailed_status,omitempty"`
	Name           string `json:"name,omitempty"`
	Status         string `json:"status,omitempty"`
}

ServerRunningStatus represents a detailed status step of a Storm Server.

type ServerStart added in v1.6.3

type ServerStart struct {
	Started string `json:"started"`
}

ServerStart represents a started Storm Server response.

type ServerStatus

type ServerStatus struct {
	DetailedStatus string                `json:"detailed_status,omitempty"`
	Progress       types.FlexInt         `json:"progress,omitempty"`
	Running        []ServerRunningStatus `json:"running,omitempty"`
	Status         string                `json:"status,omitempty"`
}

ServerStatus represents status of a Storm Server.

type ServerStop added in v1.6.3

type ServerStop struct {
	Shutdown string `json:"shutdown"`
}

ServerStop represents a stopped Storm Server response.

type ServerZone

type ServerZone types.FlexInt

ServerZone represents a numerical representation of the zone data. Normally, it is nested object like network.Zone

func (*ServerZone) MarshalJSON

func (sz *ServerZone) MarshalJSON() ([]byte, error)

MarshalJSON marshalls the ServerZone type.

func (*ServerZone) String

func (sz *ServerZone) String() string

func (*ServerZone) UnmarshalJSON

func (sz *ServerZone) UnmarshalJSON(b []byte) error

UnmarshalJSON parses Liquid Web's structured zone data.

Jump to

Keyboard shortcuts

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