vps

package
v5.8.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIpv6ToVps

func AddIpv6ToVps(c gotransip.Client, vpsName string, ipv6Address net.IP) error

AddIpv6ToVps adds IpV6 address to Vps

func AddVpsToPrivateNetwork

func AddVpsToPrivateNetwork(c gotransip.Client, vpsName, privateNetworkName string) error

AddVpsToPrivateNetwork connects given Vps to PrivateNetwork

func CancelAddon

func CancelAddon(c gotransip.Client, vpsName, addonName string) error

CancelAddon cancels contract for Vps's given addon

func CancelPrivateNetwork

func CancelPrivateNetwork(c gotransip.Client, privateNetworkName string, endTime gotransip.CancellationTime) error

CancelPrivateNetwork cancels contract for PrivateNetwork per endTime

func CancelVps

func CancelVps(c gotransip.Client, vpsName string, endTime gotransip.CancellationTime) error

CancelVps cancels contract for Vps per endTime

func CloneVps

func CloneVps(c gotransip.Client, vpsName string) error

CloneVps clones a Vps

func CloneVpsToAvailabilityZone

func CloneVpsToAvailabilityZone(c gotransip.Client, vpsName, availabilityZone string) error

CloneVpsToAvailabilityZone clones a Vps to a specific availability zone

func CreateSnapshot

func CreateSnapshot(c gotransip.Client, vpsName, description string) error

CreateSnapshot creates a snapshot for Vps with given description

func GetAllIps

func GetAllIps(c gotransip.Client) ([]net.IP, error)

GetAllIps returns IP addresses for all VPSes

func GetIpsForVps

func GetIpsForVps(c gotransip.Client, vpsName string) ([]net.IP, error)

GetIpsForVps returns all IP addresses bound to given VPS

func HandoverVps

func HandoverVps(c gotransip.Client, vpsName, targetAccountname string) error

HandoverVps hands Vps over to target TransIP account

func InstallOperatingSystem

func InstallOperatingSystem(c gotransip.Client, vpsName, operatingSystemName, hostname string) error

InstallOperatingSystem installs given operatingSystem on Vps, preseeded by hostname

func InstallOperatingSystemUnattended

func InstallOperatingSystemUnattended(c gotransip.Client, vpsName, operatingSystemName, base64InstallText string) error

InstallOperatingSystemUnattended installs given operatingSystem on Vps, preseeded by contents of the installText

func OrderAddon

func OrderAddon(c gotransip.Client, vpsName string, addons []string) error

OrderAddon orders addons to a VPS

func OrderPrivateNetwork

func OrderPrivateNetwork(c gotransip.Client) error

OrderPrivateNetwork orders a private Network

func OrderVps

func OrderVps(c gotransip.Client, productName string, addons []string, operatingSystemName, hostname string) error

OrderVps orders a VPS with optional addons

func OrderVpsInAvailabilityZone

func OrderVpsInAvailabilityZone(c gotransip.Client, productName string, addons []string, operatingSystemName, hostname, availabilityZone string) error

OrderVpsInAvailabilityZone orders a VPS with optional addons in a specific availability zone

func RemoveSnapshot

func RemoveSnapshot(c gotransip.Client, vpsName, snapshotName string) error

RemoveSnapshot removes snapshot by snapshotName for Vps

func RemoveVpsFromPrivateNetwork

func RemoveVpsFromPrivateNetwork(c gotransip.Client, vpsName, privateNetworkName string) error

RemoveVpsFromPrivateNetwork disconnects given Vps from PrivateNetwork

func Reset

func Reset(c gotransip.Client, vpsName string) error

Reset resets given Vps

func RevertSnapshot

func RevertSnapshot(c gotransip.Client, vpsName, snapshotName string) error

RevertSnapshot reverts snapshot with snapshotName for Vps

func RevertSnapshotToOtherVps

func RevertSnapshotToOtherVps(c gotransip.Client, sourceVpsName, snapshotName, destinationVpsName string) error

RevertSnapshotToOtherVps uses a snapshot from sourceVpsName to revert to destinationVpsName

func RevertVpsBackup

func RevertVpsBackup(c gotransip.Client, vpsName string, vpsBackupID int64) error

RevertVpsBackup reverts backup for Vps

func SetCustomerLock

func SetCustomerLock(c gotransip.Client, vpsName string, enabled bool) error

SetCustomerLock locks or unlocks any actions on given Vps

func Start

func Start(c gotransip.Client, vpsName string) error

Start starts given Vps

func Stop

func Stop(c gotransip.Client, vpsName string) error

Stop stops given Vps

func UpdatePtrRecord

func UpdatePtrRecord(c gotransip.Client, ipAddress net.IP, ptrRecord string) error

UpdatePtrRecord updates the PTR record for given ipAddress

func UpgradeVps

func UpgradeVps(c gotransip.Client, vpsName, upgradeToProductName string) error

UpgradeVps upgrades given Vps to new contract name

Types

type AvailabilityZone

type AvailabilityZone struct {
	Name      string `xml:"name"`
	Country   string `xml:"country"`
	IsDefault bool   `xml:"isDefault"`
}

AvailabilityZone represents an availability zone as described at https://api.transip.nl/docs/transip.nl/class-Transip_AvailabilityZone.html

func GetAvailableAvailabilityZones

func GetAvailableAvailabilityZones(c gotransip.Client) ([]AvailabilityZone, error)

GetAvailableAvailabilityZones returns a list of available availability zones

type Backup

type Backup struct {
	ID               int64        `xml:"id"`
	Created          util.XMLTime `xml:"dateTimeCreate"`
	DiskSize         int64        `xml:"diskSize"`
	OperatingSystem  string       `xml:"operatingSystem"`
	AvailabilityZone string       `xml:"availabilityZone"`
}

Backup represents a Transip_VpsBackup object https://api.transip.nl/docs/transip.nl/class-Transip_VpsBackup.html

func GetVpsBackupsByVps

func GetVpsBackupsByVps(c gotransip.Client, vpsName string) ([]Backup, error)

GetVpsBackupsByVps gets all Backups for a Vps

type OperatingSystem

type OperatingSystem struct {
	Name                  string `xml:"name"`
	Description           string `xml:"description"`
	IsPreinstallableImage bool   `xml:"isPreinstallableImage"`
}

OperatingSystem represents a Transip_OperatingSystem object as described at https://api.transip.nl/docs/transip.nl/class-Transip_OperatingSystem.html

func GetOperatingSystems

func GetOperatingSystems(c gotransip.Client) ([]OperatingSystem, error)

GetOperatingSystems returns a list of all OperatingSystem available for installation

type PrivateNetwork

type PrivateNetwork struct {
	Name string `xml:"name"`
}

PrivateNetwork represents a Transip_PrivateNetwork object https://api.transip.nl/docs/transip.nl/class-Transip_PrivateNetwork.html

func GetAllPrivateNetworks

func GetAllPrivateNetworks(c gotransip.Client) ([]PrivateNetwork, error)

GetAllPrivateNetworks returns list of all private networks

func GetPrivateNetworksByVps

func GetPrivateNetworksByVps(c gotransip.Client, vpsName string) ([]PrivateNetwork, error)

GetPrivateNetworksByVps returns a list of private networks for given Vps

type Product

type Product struct {
	Name         string  `xml:"name"`
	Description  string  `xml:"description"`
	Price        float64 `xml:"price"`
	RenewalPrice float64 `xml:"renewalPrice"`
}

Product represents a Transip_Product object as described at https://api.transip.nl/docs/transip.nl/class-Transip_Product.html

func GetActiveAddonsForVps

func GetActiveAddonsForVps(c gotransip.Client, vpsName string) ([]Product, error)

GetActiveAddonsForVps returns a list of all the active addons for given Vps

func GetAvailableAddons

func GetAvailableAddons(c gotransip.Client) ([]Product, error)

GetAvailableAddons returns a list of al available VPS addons

func GetAvailableAddonsForVps

func GetAvailableAddonsForVps(c gotransip.Client, vpsName string) ([]Product, error)

GetAvailableAddonsForVps returns list of all available addons for a given Vps

func GetAvailableProducts

func GetAvailableProducts(c gotransip.Client) ([]Product, error)

GetAvailableProducts returns a list of al available VPS products

func GetAvailableUpgrades

func GetAvailableUpgrades(c gotransip.Client, vpsName string) ([]Product, error)

GetAvailableUpgrades returns list of all available upgrades for given Vps

func GetCancellableAddonsForVps

func GetCancellableAddonsForVps(c gotransip.Client, vpsName string) ([]Product, error)

GetCancellableAddonsForVps returns a list of all cancellable addons for given Vps

type Snapshot

type Snapshot struct {
	Name             string       `xml:"name"`
	Description      string       `xml:"description"`
	Created          util.XMLTime `xml:"dateTimeCreate"`
	AvailabilityZone string       `xml:"availabilityZone"`
}

Snapshot represents a Transip_Snapshot object as described at https://api.transip.nl/docs/transip.nl/class-Transip_Snapshot.html

func GetSnapshotsByVps

func GetSnapshotsByVps(c gotransip.Client, vpsName string) ([]Snapshot, error)

GetSnapshotsByVps gets all Snapshots for a Vps

type Status

type Status string

Status represents the possibles states a Vps can be in

var (
	// StatusCreated means the VPS was provisioned and is waiting for install
	StatusCreated Status = "created"
	// StatusInstalling means the VPS is currently installing it's OS
	StatusInstalling Status = "installing"
	// StatusRunning means the VPS is running and operating normally
	StatusRunning Status = "running"
	// StatusStopped means the VPS was stopped
	StatusStopped Status = "stopped"
	// StatusPaused means the VPS is currently in a suspended state
	StatusPaused Status = "paused"
	// StatusFailPaused means something went wrong and the VPS got suspended
	StatusFailPaused Status = "failPaused"
)

type TrafficInformation

type TrafficInformation struct {
	From  time.Time
	End   time.Time
	Used  int64
	Total int64
	Max   int64
}

TrafficInformation holds information about a VPS's traffic usage for a specific period

func GetPooledTrafficInformation

func GetPooledTrafficInformation(c gotransip.Client) (TrafficInformation, error)

GetPooledTrafficInformation returns PooledTraffic information for the account

func GetTrafficInformationForVps

func GetTrafficInformationForVps(c gotransip.Client, vpsName string) (TrafficInformation, error)

GetTrafficInformationForVps returns traffic information for this contract period for given Vps

type Vps

type Vps struct {
	Name             string `xml:"name"`
	Description      string `xml:"description"`
	OperatingSystem  string `xml:"operatingSystem"`
	DiskSize         int64  `xml:"diskSize"`
	MemorySize       int64  `xml:"memorySize"`
	Processors       int64  `xml:"cpus"`
	Status           Status `xml:"status"`
	IPv4Address      net.IP `xml:"ipAddress"`
	IPv6Address      net.IP `xml:"ipv6Address"`
	MACAddress       string `xml:"macAddress"`
	IsBlocked        bool   `xml:"isBlocked"`
	IsCustomerLocked bool   `xml:"isCustomerLocked"`
	AvailabilityZone string `xml:"availabilityZone"`
}

Vps represents a Transip_Vps object https://api.transip.nl/docs/transip.nl/class-Transip_Vps.html

func GetVps

func GetVps(c gotransip.Client, vpsName string) (Vps, error)

GetVps returns Vps for given name or error if when it failed to retrieve Vps from API

func GetVpses

func GetVpses(c gotransip.Client) ([]Vps, error)

GetVpses returns Vpses or error when it failed to retrieve list of Vpses from API

Jump to

Keyboard shortcuts

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