spl2

package module
v0.0.0-...-c69e54b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 9 Imported by: 0

README

Servers.com API

Partial support features of https://developers.servers.com/api-documentation/v1/:

  • servers list
  • detail information about the server

Conf

Default path to config is ~/.spl.yml.

baseurl: <url>      # optional
jwttoken: <token>

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conf config

Conf ..

Functions

func GetInstances

func GetInstances() (*[]Instance, error)

GetInstances ..

func GetLocations

func GetLocations() (*[]Location, error)

GetLocations ..

func GetSSHKeys

func GetSSHKeys() (*[]SSHKey, error)

GetSSHKeys ..

func GetServers

func GetServers() (*[]Server, error)

GetServers ..

func GetServices

func GetServices(id string) (*[]Service, error)

GetServices ..

func RateLimitNotify

func RateLimitNotify(res *http.Response)

RateLimitNotify ..

Types

type Instance

type Instance struct {
	ID                 string
	OpenstackUUID      string `json:"openstack_uuid"`
	Status             string
	Name               string
	RegionID           uint   `json:"region_id"`
	RegionCode         string `json:"region_code"`
	FlavorID           string `json:"flavor_id"`
	FlavorName         string `json:"flavor_name"`
	ImageID            string `json:"image_id"`
	ImageName          string `json:"image_name"`
	PublicIPv4Address  string `json:"public_ipv4_address"`
	PublicIPv6Address  string `json:"public_ipv6_address"`
	LocalIPv4Address   string `json:"local_ipv4_address"`
	PrivateIPv4Address string `json:"private_ipv4_address"`
	IPv6Enabled        bool   `json:"ipv6_enabled"`
	GPNEnabled         bool   `json:"gpn_enabled"`
	CreatedAt          string `json:"created_at"`
	UpdatedAt          string `json:"updated_at"`
	BackupCopies       uint   `json:"backup_copies"`
}

Instance ..

func DeleteInstance

func DeleteInstance(id string) (*Instance, error)

DeleteInstance ..

func GetInstance

func GetInstance(id string) (*Instance, error)

GetInstance ..

type Location

type Location struct {
	ID                   int
	Name                 string
	Code                 string
	SupportedFeatures    []string `json:"supported_features"`
	L2SegmentsEnabled    bool     `json:"l2_segments_enabled"`
	PrivateRacksEnabled  bool     `json:"private_racks_enabled"`
	LoadBalancersEnabled bool     `json:"load_balancers_enabled"`
}

Location ..

type RateLimit

type RateLimit struct {
	Total     int
	Remaining int
	ResetTime int
}

RateLimit ..

type SSHKey

type SSHKey struct {
	Name        string
	Fingerprint string
	UpdatedAt   string `json:"updated_at"`
	CreatedAt   string `json:"created_at"`
}

SSHKey ..

type Server

type Server struct {
	ID                   string
	Title                string
	LocationID           uint   `json:"location_id"`
	LocationCode         string `json:"location_code"`
	Status               string
	OperationalStatus    string `json:"operational_status"`
	PowerStatus          string `json:"power_status"`
	Configuration        string
	ConfigurationDetails ServerConfigurationDetails `json:"configuration_details"`
	PrivateIPv4Address   string                     `json:"private_ipv4_address"`
	PublicIPv4Address    string                     `json:"public_ipv4_address"`
	LeaseStartAt         string                     `json:"lease_start_at"`
	ScheduledReleaseAt   string                     `json:"scheduled_release_at"`
	Type                 string
	RackID               string `json:"rack_id"`
	CreatedAt            string `json:"created_at"`
	UpdatedAt            string `json:"updated_at"`
}

Server ..

func GetServer

func GetServer(id string) (*Server, error)

GetServer ..

type ServerConfigurationDetails

type ServerConfigurationDetails struct {
	RAMSize                 uint   `json:"ram_size"`
	ServerModelID           uint   `json:"server_model_id"`
	ServerModelName         string `json:"server_model_name"`
	BandwidthID             uint   `json:"bandwidth_id"`
	BandwidthName           string `json:"bandwidth_name"`
	PrivateUplinkID         uint   `json:"private_uplink_id"`
	PrivateUplinkName       string `json:"private_uplink_name"`
	PublicUplinkID          uint   `json:"public_uplink_id"`
	PublicUplinkName        string `json:"public_uplink_name"`
	OperatingSystemID       uint   `json:"operating_system_id"`
	OperatingSystemFullName string `json:"operating_system_full_name"`
}

ServerConfigurationDetails ..

type Service

type Service struct {
	ID            string
	Name          string
	Type          string
	Currency      string
	Lable         string
	DateFrom      string  `json:"date_from"`
	DateTo        string  `json:"date_to"`
	UsageQuantity float64 `json:"usage_quantity"`
	Tax           float64
	Total         float64
	Subtotal      float64
	DiscountRate  float64 `json:"discount_rate"`
}

Service ..

Jump to

Keyboard shortcuts

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