gsclient

package module
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 15 Imported by: 0

README

The gridscale Go Client

Build Status Go Report Card

This is a client for the gridscale API. It can be used to make an application interact with the gridscale cloud platform to create and manage resources.

Preparation for Use

To be able to use this client a number of steps need to be taken. First a gridscale account will be required, which can be created here. Then an API-token should be created.

Installation

First the Go programming language will need to be installed. This can be done by using the official Go installation guide or by using the packages provided by your distribution.

Downloading the gridscale Go client can be done with the following go command:

go get "github.com/gridscale/gsclient-go"

Using the gridscale Client

To be able to use the gridscale Go client in an application it can be imported in a go file. This can be done with the following code:

import (
	"github.com/gridscale/gsclient-go"
)

To get access to the functions of the Go client, a Client type needs to be created. This requires a Config type. Both of these can be created with the following code:

//Using default config
config := gsclient.DefaultConfiguration("User-UUID", "API-token")

//OR Custom config
config := gsclient.NewConfiguration(
            "API-URL", 
            "User-UUID", 
            "API-token"), 
            false, //Set debug mode
            true, //Set sync mode 
            120, //Timeout (in seconds) of checking requests
            500, //Delay (in milliseconds) between requests
            100, //Maximum number of retries
        )
client := gsclient.NewClient(config)

Make sure to replace the user-UUID and API-token strings with valid credentials or variables containing valid credentials. It is recommended to use environment variables for them.

Using API endpoints

***Note: context has to be passed to all APIs of gsclient-go as the first parameter.

After having created a Client type, as shown above, it will be possible to interact with the API. An example would be the Servers Get endpoint:

cxt := context.Background()
servers := client.GetServerList(ctx)

For creating and updating/patching objects in gridscale, it will be required to use the respective CreateRequest and UpdateRequest types. For creating an SSH-key that would be SshkeyCreateRequest and SshkeyUpdateRequest. Here an example:

cxt := context.Background()
requestBody := gsclient.IPCreateRequest {
	Family: gsclient.IPv6Type,
	Name:   "IPTest",
}

client.CreateIP(ctx, requestBody)

What options are available for each create and update request can be found in the source code. After installing it should be located in:

~/go/src/github.com/gridscale/gsclient-go

Examples

Examples on how to use each resource can be found in the examples folder:

  • Firewall (firewall.go)
  • IP (ip.go)
  • ISO-image (isoimage.go)
  • Loadbalancer (loadbalancer.go)
  • Network (network.go)
  • Object Storage (objectstorage.go)
  • PaaS service (paas.go)
  • Server (server.go)
  • Storage (storage.go)
  • Storage snapshot (snapshot.go)
  • Storage snapshot schedule (snapshotschedule.go)
  • SSH-key (sshkey.go)
  • Template (template.go)

Implemented API Endpoints

Not all endpoints have been implemented in this client, but new ones will be added in the future. Here is the current list of implemented endpoints and their respective function written like endpoint (function):

  • Servers
    • Servers Get (GetServerList)
    • Server Get (GetServer)
    • Server Create (CreateServer)
    • Server Patch (UpdateServer)
    • Server Delete (DeleteServer)
    • Server Events Get (GetServerEventList)
    • Server Metrics Get (GetServerMetricList)
    • ACPI Shutdown (ShutdownServer)
    • Server On/Off (StartServer, StopServer)
    • Server's Storages Get (GetServerStorageList)
    • Server's Storage Get (GetServerStorage)
    • Server's Storage Create (CreateServerStorage)
    • Server's Storage Update (UpdateServerStorage)
    • Server's Storage Delete (DeleteServerStorage)
    • Link Storage (LinkStorage)
    • Unlink Storage (UnlinkStorage)
    • Server's Networks Get (GetServerNetworkList)
    • Server's Network Get (GetServerNetwork)
    • Server's Network Create (CreateServerNetwork)
    • Server's Network Update (UpdateServerNetwork)
    • Server's Network Delete (DeleteServerNetwork)
    • Link Network (LinkNetwork)
    • Unlink Network (UnlinkNetwork)
    • Server's IPs Get (GetServerNetworkList)
    • Server's IP Get (GetServerNetwork)
    • Server's IP Create (CreateServerNetwork)
    • Server's IP Update (UpdateServerNetwork)
    • Server's IP Delete (DeleteServerNetwork)
    • Link IP (LinkIP)
    • Unlink IP (UnlinkIP)
    • Server's ISO-Images Get (GetServerIsoImageList)
    • Server's ISO-Image Get (GetServerIsoImage)
    • Server's ISO-Image Create (CreateServerIsoImage)
    • Server's ISO-Image Update (UpdateServerIsoImage)
    • Server's ISO-Image Delete (DeleteServerIsoImage)
    • Link ISO-Image (LinkIsoimage)
    • Unlink ISO-Image (UnlinkIsoimage)
  • Storages
    • Storages Get (GetStorageList)
    • Storage Get (GetStorage)
    • Storage Create (CreateStorage)
    • Storage Patch (UpdateStorage)
    • Storage Delete (DeleteStorage)
    • Storage's events Get (GetStorageEventList)
  • Networks
    • Networks Get (GetNetworkList)
    • Network Get (GetNetwork)
    • Network Create (CreateNetwork)
    • Network Patch (UpdateNetwork)
    • Network Delete (DeleteNetwork)
    • Network Events Get (GetNetworkEventList)
    • (GetNetworkPublic) No official endpoint, but gives the Public Network
  • Loadbalancers
    • LoadBalancers Get (GetLoadBalancerList)
    • LoadBalancer Get (GetLoadBalancer)
    • LoadBalancer Create (CreateLoadBalancer)
    • LoadBalancer Patch (UpdateLoadBalancer)
    • LoadBalancer Delete (DeleteLoadBalancer)
    • LoadBalancerEvents Get (GetLoadBalancerEventList)
  • IPs
    • IPs Get (GetIPList)
    • IP Get (GetIP)
    • IP Create (CreateIP)
    • IP Patch (UpdateIP)
    • IP Delete (DeleteIP)
    • IP Events Get (GetIPEventList)
    • IP Version Get (GetIPVersion)
  • SSH-Keys
    • SSH-Keys Get (GetSshkeyList)
    • SSH-Key Get (GetSshkey)
    • SSH-Key Create (CreateSshkey)
    • SSH-Key Patch (UpdateSshkey)
    • SSH-Key Delete (DeleteSshkey)
    • SSH-Key's events Get (GetSshkeyEventList)
  • Template
    • Templates Get (GetTemplateList)
    • Template Get (GetTemplate)
    • (GetTemplateByName) No official endpoint, but gives a template which matches the exact name given.
    • Template Create (CreateTemplate)
    • Template Update (UpdateTemplate)
    • Template Delete (DeleteTemplate)
    • Template's events Get (GetTemplateEventList)
  • PaaS
    • PaaS services Get (GetPaaSServiceList)
    • PaaS service Get (GetPaaSService)
    • PaaS service Create (CreatePaaSService)
    • PaaS service Update (UpdatePaaSService)
    • PaaS service Delete (DeletePaaSService)
    • PaaS service metrics Get (GetPaaSServiceMetrics)
    • PaaS service templates Get (GetPaaSTemplateList)
    • PaaS service security zones Get (GetPaaSSecurityZoneList)
    • Paas service security zone Get (GetPaaSSecurityZone)
    • PaaS service security zone Create (CreatePaaSSecurityZone)
    • PaaS service security zone Update (UpdatePaaSSecurityZone)
    • PaaS service security zone Delete (DeletePaaSSecurityZone)
  • ISO Image
    • ISO Images Get (GetISOImageList)
    • ISO Image Get (GetISOImage)
    • ISO Image Create (CreateISOImage)
    • ISO Image Update (UpdateISOImage)
    • ISO Image Delete (DeleteISOImage)
    • ISO Image Events Get (GetISOImageEventList)
  • Object Storage
    • Object Storage's Access Keys Get (GetObjectStorageAccessKeyList)
    • Object Storage's Access Key Get (GetObjectStorageAccessKey)
    • Object Storage's Access Key Create (CreateObjectStorageAccessKey)
    • Object Storage's Access Key Delete (DeleteObjectStorageAccessKey)
    • Object Storage's Buckets Get (GetObjectStorageBucketList)
  • Storage Snapshot Scheduler
    • Storage Snapshot Schedules Get (GetStorageSnapshotScheduleList)
    • Storage Snapshot Schedule Get (GetStorageSnapshotSchedule)
    • Storage Snapshot Schedule Create (CreateStorageSnapshotSchedule)
    • Storage Snapshot Schedule Update (UpdateStorageSnapshotSchedule)
    • Storage Snapshot Schedule Delete (DeleteStorageSnapshotSchedule)
  • Storage Snapshot
    • Storage Snapshots Get (GetStorageSnapshotList)
    • Storage Snapshot Get (GetStorageSnapshot)
    • Storage Snapshot Create (CreateStorageSnapshot)
    • Storage Snapshot Update (UpdateStorageSnapshot)
    • Storage Snapshot Delete (DeleteStorageSnapshot)
    • Storage Rollback (RollbackStorage)
    • Storage Snapshot Export to S3 (ExportStorageSnapshotToS3)
  • Firewall
    • Firewalls Get (GetFirewallList)
    • Firewall Get (GetFirewall)
    • Firewall Create (CreateFirewall)
    • Firewall Update (UpdateFirewall)
    • Firewall Delete (DeleteFirewall)
    • Firewall Events Get (GetFirewallEventList)
  • Event
    • Events Get (GetEventList)
  • Label
    • Labels Get (GetLabelList)
    • Label Create (CreateLabel)
    • Label Delete (DeleteLabel)
  • Location
    • Locations Get (GetLocationList)
    • Location Get (GetLocation)
    • Location IPs Get (GetIPsByLocation)
    • Location ISO Images Get (GetISOImagesByLocation)
    • Location Networks Get (GetNetworksByLocation)
    • Location Servers Get (GetServersByLocation)
    • Location Snapshots Get (GetSnapshotsByLocation)
    • Location Storages Get (GetStoragesByLocation)
    • Location Templates Get (GetTemplatesByLocation)
  • Deleted
    • Deleted IPs Get (GetDeletedIPs)
    • Deleted ISO Images Get (GetDeletedISOImages)
    • Deleted Networks Get (GetDeletedNetworks)
    • Deleted Servers Get (GetDeletedServers)
    • Deleted Snapshots Get (GetDeletedSnapshots)
    • Deleted Storages Get (GetDeletedStorages)
    • Deleted Templates Get (GetDeletedTemplates)
    • Deleted PaaS Services Get (GetDeletedPaaSServices)

Note: The functions in this list can be called with a Client type.

Known Issues

The following issues are known to us:

  • L3security isn't read in the network relation of a server.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IPv4Type = ipAddressType{4}
	IPv6Type = ipAddressType{6}
)

Allowed IP address versions

View Source
var (
	LoadbalancerRoundrobinAlg = loadbalancerAlgorithm{"roundrobin"}
	LoadbalancerLeastConnAlg  = loadbalancerAlgorithm{"leastconn"}
)

All available loadbalancer algorithms

View Source
var (
	DefaultServerHardware   = &serverHardwareProfile{"default"}
	NestedServerHardware    = &serverHardwareProfile{"nested"}
	LegacyServerHardware    = &serverHardwareProfile{"legacy"}
	CiscoCSRServerHardware  = &serverHardwareProfile{"cisco_csr"}
	SophosUTMServerHardware = &serverHardwareProfile{"sophos_utm"}
	F5BigipServerHardware   = &serverHardwareProfile{"f5_bigip"}
	Q35ServerHardware       = &serverHardwareProfile{"q35"}
	Q35NestedServerHardware = &serverHardwareProfile{"q35_nested"}
)

All available server's hardware types

View Source
var (
	DefaultStorageType = &storageType{"storage"}
	HighStorageType    = &storageType{"storage_high"}
	InsaneStorageType  = &storageType{"storage_insane"}
)

All allowed storage type's values

View Source
var (
	PlainPasswordType = &passwordType{"plain"}
	CryptPasswordType = &passwordType{"crypt"}
)

All allowed password type's values

Functions

This section is empty.

Types

type BackendServer

type BackendServer struct {
	//Weight of the server
	Weight int `json:"weight"`

	//Host of the server. Can be URL or IP address.
	Host string `json:"host"`
}

BackendServer is the JSON struct of backend server

type Client

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

Client struct of a gridscale golang client

func NewClient

func NewClient(c *Config) *Client

NewClient creates new gridscale golang client

func (*Client) APIToken

func (c *Client) APIToken() string

APIToken returns api token

func (*Client) APIURL

func (c *Client) APIURL() string

APIURL returns api URL

func (*Client) CreateIP

func (c *Client) CreateIP(ctx context.Context, body IPCreateRequest) (IPCreateResponse, error)

CreateIP creates an IP

Note: IP address family can only be either `IPv4Type` or `IPv6Type`

See: https://gridscale.io/en//api-documentation/index.html#operation/createIp

func (*Client) CreateLabel added in v1.0.0

func (c *Client) CreateLabel(ctx context.Context, body LabelCreateRequest) (CreateResponse, error)

CreateLabel creates a new label

See: https://gridscale.io/en//api-documentation/index.html#operation/CreateLabel

func (*Client) CreateLoadBalancer

CreateLoadBalancer creates a new loadbalancer

Note: loadbalancer's algorithm can only be either `LoadbalancerRoundrobinAlg` or `LoadbalancerLeastConnAlg`

See: https://gridscale.io/en//api-documentation/index.html#operation/createLoadbalancer

func (*Client) CreateNetwork

func (c *Client) CreateNetwork(ctx context.Context, body NetworkCreateRequest) (NetworkCreateResponse, error)

CreateNetwork creates a network

See: https://gridscale.io/en//api-documentation/index.html#tag/network

func (*Client) CreateObjectStorageAccessKey

func (c *Client) CreateObjectStorageAccessKey(ctx context.Context) (ObjectStorageAccessKeyCreateResponse, error)

CreateObjectStorageAccessKey creates an object storage access key

See: https://gridscale.io/en//api-documentation/index.html#operation/createAccessKey

func (*Client) CreatePaaSSecurityZone

CreatePaaSSecurityZone creates a new PaaS security zone

See: https://gridscale.io/en//api-documentation/index.html#operation/createPaasSecurityZone

func (*Client) CreatePaaSService

CreatePaaSService creates a new PaaS service

See: https://gridscale.io/en//api-documentation/index.html#operation/createPaasService

func (*Client) CreateServer

func (c *Client) CreateServer(ctx context.Context, body ServerCreateRequest) (ServerCreateResponse, error)

CreateServer create a server

NOTE: Allowed values of `HardwareProfile`: nil, DefaultServerHardware, NestedServerHardware, LegacyServerHardware, CiscoCSRServerHardware, SophosUTMServerHardware, F5BigipServerHardware, Q35ServerHardware, Q35NestedServerHardware.

See: https://gridscale.io/en//api-documentation/index.html#operation/createServer

func (*Client) CreateServerIP

func (c *Client) CreateServerIP(ctx context.Context, id string, body ServerIPRelationCreateRequest) error

CreateServerIP create a link between a server and an IP

See: https://gridscale.io/en//api-documentation/index.html#operation/linkIpToServer

func (*Client) CreateServerIsoImage

func (c *Client) CreateServerIsoImage(ctx context.Context, id string, body ServerIsoImageRelationCreateRequest) error

CreateServerIsoImage creates a link between a server and an ISO image

See: https://gridscale.io/en//api-documentation/index.html#operation/linkIsoimageToServer

func (*Client) CreateServerNetwork

func (c *Client) CreateServerNetwork(ctx context.Context, id string, body ServerNetworkRelationCreateRequest) error

CreateServerNetwork creates a link between a network and a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/linkNetworkToServer

func (*Client) CreateServerStorage

func (c *Client) CreateServerStorage(ctx context.Context, id string, body ServerStorageRelationCreateRequest) error

CreateServerStorage create a link between a server and a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/linkStorageToServer

func (*Client) CreateStorage

func (c *Client) CreateStorage(ctx context.Context, body StorageCreateRequest) (CreateResponse, error)

CreateStorage create a storage

NOTE:

- Allowed value for `StorageType`: nil, DefaultStorageType, HighStorageType, InsaneStorageType.

- Allowed value for `PasswordType`: nil, PlainPasswordType, CryptPasswordType.

See: https://gridscale.io/en//api-documentation/index.html#operation/createStorage

func (*Client) CreateStorageSnapshot

CreateStorageSnapshot creates a new storage's snapshot

See: https://gridscale.io/en//api-documentation/index.html#operation/createSnapshot

func (*Client) CreateStorageSnapshotSchedule

CreateStorageSnapshotSchedule create a storage's snapshot scheduler

See: https://gridscale.io/en//api-documentation/index.html#operation/createSnapshotSchedule

func (*Client) CreateTemplate

func (c *Client) CreateTemplate(ctx context.Context, body TemplateCreateRequest) (CreateResponse, error)

CreateTemplate creates a template

See: https://gridscale.io/en//api-documentation/index.html#operation/createTemplate

func (*Client) DelayInterval

func (c *Client) DelayInterval() time.Duration

DelayInterval returns request delay interval

func (*Client) DeleteFirewall

func (c *Client) DeleteFirewall(ctx context.Context, id string) error

DeleteFirewall delete a specific firewall

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteFirewall

func (*Client) DeleteIP

func (c *Client) DeleteIP(ctx context.Context, id string) error

DeleteIP deletes a specific IP based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteIp

func (*Client) DeleteISOImage

func (c *Client) DeleteISOImage(ctx context.Context, id string) error

DeleteISOImage deletes a specific ISO image

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteIsoimage

func (*Client) DeleteLabel added in v1.0.0

func (c *Client) DeleteLabel(ctx context.Context, label string) error

DeleteLabel deletes a label

See: https://gridscale.io/en//api-documentation/index.html#operation/DeleteLabel

func (*Client) DeleteLoadBalancer

func (c *Client) DeleteLoadBalancer(ctx context.Context, id string) error

DeleteLoadBalancer deletes a loadbalancer

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteLoadbalancer

func (*Client) DeleteNetwork

func (c *Client) DeleteNetwork(ctx context.Context, id string) error

DeleteNetwork deletes a specific network based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteNetwork

func (*Client) DeleteObjectStorageAccessKey

func (c *Client) DeleteObjectStorageAccessKey(ctx context.Context, id string) error

DeleteObjectStorageAccessKey deletes a specific object storage access key based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteAccessKey

func (*Client) DeletePaaSSecurityZone

func (c *Client) DeletePaaSSecurityZone(ctx context.Context, id string) error

DeletePaaSSecurityZone delete a specific PaaS Security Zone based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/deletePaasSecurityZone

func (*Client) DeletePaaSService

func (c *Client) DeletePaaSService(ctx context.Context, id string) error

DeletePaaSService deletes a PaaS service

See: https://gridscale.io/en//api-documentation/index.html#operation/deletePaasService

func (*Client) DeleteServer

func (c *Client) DeleteServer(ctx context.Context, id string) error

DeleteServer deletes a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteServer

func (*Client) DeleteServerIP

func (c *Client) DeleteServerIP(ctx context.Context, serverID, ipID string) error

DeleteServerIP delete a link between a server and an IP

See: https://gridscale.io/en//api-documentation/index.html#operation/unlinkIpFromServer

func (*Client) DeleteServerIsoImage

func (c *Client) DeleteServerIsoImage(ctx context.Context, serverID, isoImageID string) error

DeleteServerIsoImage deletes a link between an ISO image and a server

See: https://gridscale.io/en//api-documentation/index.html#operation/unlinkIsoimageFromServer

func (*Client) DeleteServerNetwork

func (c *Client) DeleteServerNetwork(ctx context.Context, serverID, networkID string) error

DeleteServerNetwork deletes a link between a network and a server

See: https://gridscale.io/en//api-documentation/index.html#operation/unlinkNetworkFromServer

func (*Client) DeleteServerStorage

func (c *Client) DeleteServerStorage(ctx context.Context, serverID, storageID string) error

DeleteServerStorage delete a link between a storage and a server

See: https://gridscale.io/en//api-documentation/index.html#operation/unlinkStorageFromServer

func (*Client) DeleteSshkey

func (c *Client) DeleteSshkey(ctx context.Context, id string) error

DeleteSshkey deletes a ssh key

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteSshKey

func (*Client) DeleteStorage

func (c *Client) DeleteStorage(ctx context.Context, id string) error

DeleteStorage delete a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteStorage

func (*Client) DeleteStorageSnapshot

func (c *Client) DeleteStorageSnapshot(ctx context.Context, storageID, snapshotID string) error

DeleteStorageSnapshot deletes a specific storage's snapshot

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteSnapshot

func (*Client) DeleteStorageSnapshotSchedule

func (c *Client) DeleteStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string) error

DeleteStorageSnapshotSchedule deletes specific Storage's snapshot scheduler based on a given storage's id and scheduler's id

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteSnapshotSchedule

func (*Client) DeleteTemplate

func (c *Client) DeleteTemplate(ctx context.Context, id string) error

DeleteTemplate deletes a template

See: https://gridscale.io/en//api-documentation/index.html#operation/deleteTemplate

func (*Client) ExportStorageSnapshotToS3

func (c *Client) ExportStorageSnapshotToS3(ctx context.Context, storageID, snapshotID string, body StorageSnapshotExportToS3Request) error

ExportStorageSnapshotToS3 export a storage's snapshot to S3

See: https://gridscale.io/en//api-documentation/index.html#operation/SnapshotExportToS3

func (*Client) GetDeletedIPs added in v1.0.0

func (c *Client) GetDeletedIPs(ctx context.Context) ([]IP, error)

GetDeletedIPs gets a list of deleted IPs

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedIps

func (*Client) GetDeletedISOImages added in v1.0.0

func (c *Client) GetDeletedISOImages(ctx context.Context) ([]ISOImage, error)

GetDeletedISOImages gets a list of deleted ISO images

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedIsoimages

func (*Client) GetDeletedNetworks added in v1.0.0

func (c *Client) GetDeletedNetworks(ctx context.Context) ([]Network, error)

GetDeletedNetworks gets a list of deleted networks

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedNetworks

func (*Client) GetDeletedPaaSServices added in v1.0.0

func (c *Client) GetDeletedPaaSServices(ctx context.Context) ([]PaaSService, error)

GetDeletedPaaSServices returns a list of deleted PaaS Services

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedPaasServices

func (*Client) GetDeletedServers added in v1.0.0

func (c *Client) GetDeletedServers(ctx context.Context) ([]Server, error)

GetDeletedServers gets a list of deleted servers

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedServers

func (*Client) GetDeletedSnapshots added in v1.0.0

func (c *Client) GetDeletedSnapshots(ctx context.Context) ([]StorageSnapshot, error)

GetDeletedSnapshots gets a list of deleted storage snapshots

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedSnapshots

func (*Client) GetDeletedStorages added in v1.0.0

func (c *Client) GetDeletedStorages(ctx context.Context) ([]Storage, error)

GetDeletedStorages gets a list of deleted storages

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedStorages

func (*Client) GetDeletedTemplates added in v1.0.0

func (c *Client) GetDeletedTemplates(ctx context.Context) ([]Template, error)

GetDeletedTemplates gets a list of deleted templates

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedTemplates

func (*Client) GetEventList added in v1.0.0

func (c *Client) GetEventList(ctx context.Context) ([]Event, error)

GetEventList gets a list of events

See: https://gridscale.io/en//api-documentation/index.html#operation/EventGetAll

func (*Client) GetFirewall

func (c *Client) GetFirewall(ctx context.Context, id string) (Firewall, error)

GetFirewall gets a specific firewall based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getFirewall

func (*Client) GetFirewallEventList

func (c *Client) GetFirewallEventList(ctx context.Context, id string) ([]Event, error)

GetFirewallEventList get list of a firewall's events

See: https://gridscale.io/en//api-documentation/index.html#operation/getFirewallEvents

func (*Client) GetFirewallList

func (c *Client) GetFirewallList(ctx context.Context) ([]Firewall, error)

GetFirewallList gets a list of available firewalls

See: https://gridscale.io/en//api-documentation/index.html#operation/getFirewalls

func (*Client) GetIP

func (c *Client) GetIP(ctx context.Context, id string) (IP, error)

GetIP get a specific IP based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getIp

func (*Client) GetIPEventList

func (c *Client) GetIPEventList(ctx context.Context, id string) ([]Event, error)

GetIPEventList gets a list of an IP's events

See: https://gridscale.io/en//api-documentation/index.html#operation/getIpEvents

func (*Client) GetIPList

func (c *Client) GetIPList(ctx context.Context) ([]IP, error)

GetIPList gets a list of available IPs

https://gridscale.io/en//api-documentation/index.html#operation/getIps

func (*Client) GetIPVersion

func (c *Client) GetIPVersion(ctx context.Context, id string) int

GetIPVersion gets IP's version, returns 0 if an error was encountered

func (*Client) GetIPsByLocation added in v1.0.0

func (c *Client) GetIPsByLocation(ctx context.Context, id string) ([]IP, error)

GetIPsByLocation gets a list of IPs by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationIps

func (*Client) GetISOImage

func (c *Client) GetISOImage(ctx context.Context, id string) (ISOImage, error)

GetISOImage returns a specific ISO image based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getIsoimage

func (*Client) GetISOImageEventList

func (c *Client) GetISOImageEventList(ctx context.Context, id string) ([]Event, error)

GetISOImageEventList returns a list of events of an ISO image

See: https://gridscale.io/en//api-documentation/index.html#operation/getIsoimageEvents

func (*Client) GetISOImageList

func (c *Client) GetISOImageList(ctx context.Context) ([]ISOImage, error)

GetISOImageList returns a list of available ISO images

See: https://gridscale.io/en//api-documentation/index.html#operation/getIsoimages

func (*Client) GetISOImagesByLocation added in v1.0.0

func (c *Client) GetISOImagesByLocation(ctx context.Context, id string) ([]ISOImage, error)

GetISOImagesByLocation gets a list of ISO images by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationIsoimages

func (*Client) GetLabelList added in v1.0.0

func (c *Client) GetLabelList(ctx context.Context) ([]Label, error)

GetLabelList gets a list of available labels

See: https://gridscale.io/en//api-documentation/index.html#operation/GetLabels

func (*Client) GetLoadBalancer

func (c *Client) GetLoadBalancer(ctx context.Context, id string) (LoadBalancer, error)

GetLoadBalancer returns a loadbalancer of a given uuid

See: https://gridscale.io/en//api-documentation/index.html#operation/getLoadbalancer

func (*Client) GetLoadBalancerEventList

func (c *Client) GetLoadBalancerEventList(ctx context.Context, id string) ([]Event, error)

GetLoadBalancerEventList retrieves events of a given uuid

See: https://gridscale.io/en//api-documentation/index.html#operation/getLoadbalancerEvents

func (*Client) GetLoadBalancerList

func (c *Client) GetLoadBalancerList(ctx context.Context) ([]LoadBalancer, error)

GetLoadBalancerList returns a list of loadbalancers

See: https://gridscale.io/en//api-documentation/index.html#operation/getLoadbalancers

func (*Client) GetLocation

func (c *Client) GetLocation(ctx context.Context, id string) (Location, error)

GetLocation gets a specific location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocation

func (*Client) GetLocationList

func (c *Client) GetLocationList(ctx context.Context) ([]Location, error)

GetLocationList gets a list of available locations]

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocations

func (*Client) GetNetwork

func (c *Client) GetNetwork(ctx context.Context, id string) (Network, error)

GetNetwork get a specific network based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getNetwork

func (*Client) GetNetworkEventList

func (c *Client) GetNetworkEventList(ctx context.Context, id string) ([]Event, error)

GetNetworkEventList gets a list of a network's events

See: https://gridscale.io/en//api-documentation/index.html#tag/network

func (*Client) GetNetworkList

func (c *Client) GetNetworkList(ctx context.Context) ([]Network, error)

GetNetworkList gets a list of available networks

See: https://gridscale.io/en//api-documentation/index.html#operation/getNetworks

func (*Client) GetNetworkPublic

func (c *Client) GetNetworkPublic(ctx context.Context) (Network, error)

GetNetworkPublic gets public network

func (*Client) GetNetworksByLocation added in v1.0.0

func (c *Client) GetNetworksByLocation(ctx context.Context, id string) ([]Network, error)

GetNetworksByLocation gets a list of networks by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getDeletedNetworks

func (*Client) GetObjectStorageAccessKey

func (c *Client) GetObjectStorageAccessKey(ctx context.Context, id string) (ObjectStorageAccessKey, error)

GetObjectStorageAccessKey gets a specific object storage access key based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getAccessKey

func (*Client) GetObjectStorageAccessKeyList

func (c *Client) GetObjectStorageAccessKeyList(ctx context.Context) ([]ObjectStorageAccessKey, error)

GetObjectStorageAccessKeyList gets a list of available object storage access keys

See: https://gridscale.io/en//api-documentation/index.html#operation/getAccessKeys

func (*Client) GetObjectStorageBucketList

func (c *Client) GetObjectStorageBucketList(ctx context.Context) ([]ObjectStorageBucket, error)

GetObjectStorageBucketList gets a list of object storage buckets

See: https://gridscale.io/en//api-documentation/index.html#operation/getBuckets

func (*Client) GetPaaSSecurityZone

func (c *Client) GetPaaSSecurityZone(ctx context.Context, id string) (PaaSSecurityZone, error)

GetPaaSSecurityZone get a specific PaaS Security Zone based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasSecurityZone

func (*Client) GetPaaSSecurityZoneList

func (c *Client) GetPaaSSecurityZoneList(ctx context.Context) ([]PaaSSecurityZone, error)

GetPaaSSecurityZoneList get available security zones

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasSecurityZones

func (*Client) GetPaaSService

func (c *Client) GetPaaSService(ctx context.Context, id string) (PaaSService, error)

GetPaaSService returns a specific PaaS Service based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasService

func (*Client) GetPaaSServiceList

func (c *Client) GetPaaSServiceList(ctx context.Context) ([]PaaSService, error)

GetPaaSServiceList returns a list of PaaS Services

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasServices

func (*Client) GetPaaSServiceMetrics

func (c *Client) GetPaaSServiceMetrics(ctx context.Context, id string) ([]PaaSServiceMetric, error)

GetPaaSServiceMetrics get a specific PaaS Service's metrics based on a given id

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasServiceMetrics

func (*Client) GetPaaSTemplateList

func (c *Client) GetPaaSTemplateList(ctx context.Context) ([]PaaSTemplate, error)

GetPaaSTemplateList returns a list of PaaS service templates

See: https://gridscale.io/en//api-documentation/index.html#operation/getPaasServiceTemplates

func (*Client) GetServer

func (c *Client) GetServer(ctx context.Context, id string) (Server, error)

GetServer gets a specific server based on given list

See: https://gridscale.io/en//api-documentation/index.html#operation/getServer

func (*Client) GetServerEventList

func (c *Client) GetServerEventList(ctx context.Context, id string) ([]Event, error)

GetServerEventList gets a list of a specific server's events

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerEvents

func (*Client) GetServerIP

func (c *Client) GetServerIP(ctx context.Context, serverID, ipID string) (ServerIPRelationProperties, error)

GetServerIP gets an IP of a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedIp

func (*Client) GetServerIPList

func (c *Client) GetServerIPList(ctx context.Context, id string) ([]ServerIPRelationProperties, error)

GetServerIPList gets a list of a specific server's IPs

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedIps

func (*Client) GetServerIsoImage

func (c *Client) GetServerIsoImage(ctx context.Context, serverID, isoImageID string) (ServerIsoImageRelationProperties, error)

GetServerIsoImage gets an ISO image of a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedIsoimage

func (*Client) GetServerIsoImageList

func (c *Client) GetServerIsoImageList(ctx context.Context, id string) ([]ServerIsoImageRelationProperties, error)

GetServerIsoImageList gets a list of a specific server's ISO images

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedIsoimages

func (*Client) GetServerList

func (c *Client) GetServerList(ctx context.Context) ([]Server, error)

GetServerList gets a list of available servers

See: https://gridscale.io/en//api-documentation/index.html#operation/getServers

func (*Client) GetServerMetricList

func (c *Client) GetServerMetricList(ctx context.Context, id string) ([]ServerMetric, error)

GetServerMetricList gets a list of a specific server's metrics

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerMetrics

func (*Client) GetServerNetwork

func (c *Client) GetServerNetwork(ctx context.Context, serverID, networkID string) (ServerNetworkRelationProperties, error)

GetServerNetwork gets a network of a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedNetwork

func (*Client) GetServerNetworkList

func (c *Client) GetServerNetworkList(ctx context.Context, id string) ([]ServerNetworkRelationProperties, error)

GetServerNetworkList gets a list of a specific server's networks

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedNetworks

func (*Client) GetServerStorage

func (c *Client) GetServerStorage(ctx context.Context, serverID, storageID string) (ServerStorageRelationProperties, error)

GetServerStorage gets a storage of a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedStorage

func (*Client) GetServerStorageList

func (c *Client) GetServerStorageList(ctx context.Context, id string) ([]ServerStorageRelationProperties, error)

GetServerStorageList gets a list of a specific server's storages

See: https://gridscale.io/en//api-documentation/index.html#operation/getServerLinkedStorages

func (*Client) GetServersByLocation added in v1.0.0

func (c *Client) GetServersByLocation(ctx context.Context, id string) ([]Server, error)

GetServersByLocation gets a list of servers by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationServers

func (*Client) GetSnapshotsByLocation added in v1.0.0

func (c *Client) GetSnapshotsByLocation(ctx context.Context, id string) ([]StorageSnapshot, error)

GetSnapshotsByLocation gets a list of storage snapshots by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationSnapshots

func (*Client) GetSshkey

func (c *Client) GetSshkey(ctx context.Context, id string) (Sshkey, error)

GetSshkey gets a ssh key

See: https://gridscale.io/en//api-documentation/index.html#operation/getSshKey

func (*Client) GetSshkeyEventList

func (c *Client) GetSshkeyEventList(ctx context.Context, id string) ([]Event, error)

GetSshkeyEventList gets a ssh key's events

See: https://gridscale.io/en//api-documentation/index.html#operation/getSshKeyEvents

func (*Client) GetSshkeyList

func (c *Client) GetSshkeyList(ctx context.Context) ([]Sshkey, error)

GetSshkeyList gets a list of ssh keys

See: https://gridscale.io/en//api-documentation/index.html#operation/getSshKeys

func (*Client) GetStorage

func (c *Client) GetStorage(ctx context.Context, id string) (Storage, error)

GetStorage get a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/getStorage

func (*Client) GetStorageEventList

func (c *Client) GetStorageEventList(ctx context.Context, id string) ([]Event, error)

GetStorageEventList get list of a storage's event

See: https://gridscale.io/en//api-documentation/index.html#operation/getStorageEvents

func (*Client) GetStorageList

func (c *Client) GetStorageList(ctx context.Context) ([]Storage, error)

GetStorageList gets a list of available storages

See: https://gridscale.io/en//api-documentation/index.html#operation/getStorages

func (*Client) GetStorageSnapshot

func (c *Client) GetStorageSnapshot(ctx context.Context, storageID, snapshotID string) (StorageSnapshot, error)

GetStorageSnapshot gets a specific storage's snapshot based on given storage id and snapshot id.

See: https://gridscale.io/en//api-documentation/index.html#operation/getSnapshot

func (*Client) GetStorageSnapshotList

func (c *Client) GetStorageSnapshotList(ctx context.Context, id string) ([]StorageSnapshot, error)

GetStorageSnapshotList gets a list of storage snapshots

See: https://gridscale.io/en//api-documentation/index.html#operation/getSnapshots

func (*Client) GetStorageSnapshotSchedule

func (c *Client) GetStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string) (StorageSnapshotSchedule, error)

GetStorageSnapshotSchedule gets a specific storage snapshot scheduler based on a given storage's id and scheduler's id

See: https://gridscale.io/en//api-documentation/index.html#operation/getSnapshotSchedule

func (*Client) GetStorageSnapshotScheduleList

func (c *Client) GetStorageSnapshotScheduleList(ctx context.Context, id string) ([]StorageSnapshotSchedule, error)

GetStorageSnapshotScheduleList gets a list of available storage snapshot schedules based on a given storage's id

See: https://gridscale.io/en//api-documentation/index.html#operation/getSnapshotSchedules

func (*Client) GetStoragesByLocation added in v1.0.0

func (c *Client) GetStoragesByLocation(ctx context.Context, id string) ([]Storage, error)

GetStoragesByLocation gets a list of storages by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationStorages

func (*Client) GetTemplate

func (c *Client) GetTemplate(ctx context.Context, id string) (Template, error)

GetTemplate gets a template

See: https://gridscale.io/en//api-documentation/index.html#operation/getTemplate

func (*Client) GetTemplateByName

func (c *Client) GetTemplateByName(ctx context.Context, name string) (Template, error)

GetTemplateByName gets a template by its name

func (*Client) GetTemplateEventList

func (c *Client) GetTemplateEventList(ctx context.Context, id string) ([]Event, error)

GetTemplateEventList gets a list of a template's events

See: https://gridscale.io/en//api-documentation/index.html#operation/getTemplateEvents

func (*Client) GetTemplateList

func (c *Client) GetTemplateList(ctx context.Context) ([]Template, error)

GetTemplateList gets a list of templates

See: https://gridscale.io/en//api-documentation/index.html#operation/getTemplates

func (*Client) GetTemplatesByLocation added in v1.0.0

func (c *Client) GetTemplatesByLocation(ctx context.Context, id string) ([]Template, error)

GetTemplatesByLocation gets a list of templates by location

See: https://gridscale.io/en//api-documentation/index.html#operation/getLocationTemplates

func (*Client) HttpClient

func (c *Client) HttpClient() *http.Client

HttpClient returns http client

func (*Client) IsServerOn

func (c *Client) IsServerOn(ctx context.Context, id string) (bool, error)

IsServerOn returns true if the server's power is on, otherwise returns false

func (*Client) LinkIP

func (c *Client) LinkIP(ctx context.Context, serverID string, ipID string) error

LinkIP attaches an IP to a server

func (*Client) LinkIsoImage

func (c *Client) LinkIsoImage(ctx context.Context, serverID string, isoimageID string) error

LinkIsoImage attaches an ISO image to a server

func (*Client) LinkNetwork

func (c *Client) LinkNetwork(ctx context.Context, serverID, networkID, firewallTemplate string, bootdevice bool, order int,
	l3security []string, firewall *FirewallRules) error

LinkNetwork attaches a network to a server

func (*Client) LinkStorage

func (c *Client) LinkStorage(ctx context.Context, serverID string, storageID string, bootdevice bool) error

LinkStorage attaches a storage to a server

func (*Client) Logger

func (c *Client) Logger() logrus.Logger

Logger returns logger

func (*Client) MaxNumberOfRetries

func (c *Client) MaxNumberOfRetries() int

MaxNumberOfRetries returns max number of retries

func (*Client) RequestCheckTimeout

func (c *Client) RequestCheckTimeout() time.Duration

RequestCheckTimeout returns request check timeout

func (*Client) RollbackStorage

func (c *Client) RollbackStorage(ctx context.Context, storageID, snapshotID string, body StorageRollbackRequest) error

RollbackStorage rollbacks a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/StorageRollback

func (*Client) ShutdownServer

func (c *Client) ShutdownServer(ctx context.Context, id string) error

ShutdownServer shutdowns a specific server

func (*Client) StartServer

func (c *Client) StartServer(ctx context.Context, id string) error

StartServer starts a server

func (*Client) StopServer

func (c *Client) StopServer(ctx context.Context, id string) error

StopServer stops a server

func (*Client) Synchronous

func (c *Client) Synchronous() bool

Synchronous returns if the client is sync or not

func (*Client) UnlinkIP

func (c *Client) UnlinkIP(ctx context.Context, serverID string, ipID string) error

UnlinkIP removes a link between an IP and a server

func (*Client) UnlinkIsoImage

func (c *Client) UnlinkIsoImage(ctx context.Context, serverID string, isoimageID string) error

UnlinkIsoImage removes the link between an ISO image and a server

func (*Client) UnlinkNetwork

func (c *Client) UnlinkNetwork(ctx context.Context, serverID string, networkID string) error

UnlinkNetwork removes the link between a network and a server

func (*Client) UnlinkStorage

func (c *Client) UnlinkStorage(ctx context.Context, serverID string, storageID string) error

UnlinkStorage remove a storage from a server

func (*Client) UpdateFirewall

func (c *Client) UpdateFirewall(ctx context.Context, id string, body FirewallUpdateRequest) error

UpdateFirewall update a specific firewall

See: https://gridscale.io/en//api-documentation/index.html#operation/updateFirewall

func (*Client) UpdateIP

func (c *Client) UpdateIP(ctx context.Context, id string, body IPUpdateRequest) error

UpdateIP updates a specific IP based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/updateIp

func (*Client) UpdateISOImage

func (c *Client) UpdateISOImage(ctx context.Context, id string, body ISOImageUpdateRequest) error

UpdateISOImage updates a specific ISO Image

See: https://gridscale.io/en//api-documentation/index.html#operation/updateIsoimage

func (*Client) UpdateLoadBalancer

func (c *Client) UpdateLoadBalancer(ctx context.Context, id string, body LoadBalancerUpdateRequest) error

UpdateLoadBalancer update configuration of a loadbalancer

Note: loadbalancer's algorithm can only be either `LoadbalancerRoundrobinAlg` or `LoadbalancerLeastConnAlg`

See: https://gridscale.io/en//api-documentation/index.html#operation/updateLoadbalancer

func (*Client) UpdateNetwork

func (c *Client) UpdateNetwork(ctx context.Context, id string, body NetworkUpdateRequest) error

UpdateNetwork updates a specific network based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/updateNetwork

func (*Client) UpdatePaaSSecurityZone

func (c *Client) UpdatePaaSSecurityZone(ctx context.Context, id string, body PaaSSecurityZoneUpdateRequest) error

UpdatePaaSSecurityZone update a specific PaaS security zone based on given id

See: https://gridscale.io/en//api-documentation/index.html#operation/updatePaasSecurityZone

func (*Client) UpdatePaaSService

func (c *Client) UpdatePaaSService(ctx context.Context, id string, body PaaSServiceUpdateRequest) error

UpdatePaaSService updates a specific PaaS Service based on a given id

See: https://gridscale.io/en//api-documentation/index.html#operation/updatePaasService

func (*Client) UpdateServer

func (c *Client) UpdateServer(ctx context.Context, id string, body ServerUpdateRequest) error

UpdateServer updates a specific server

See: https://gridscale.io/en//api-documentation/index.html#operation/updateServer

func (*Client) UpdateServerIsoImage

func (c *Client) UpdateServerIsoImage(ctx context.Context, serverID, isoImageID string, body ServerIsoImageRelationUpdateRequest) error

UpdateServerIsoImage updates a link between a storage and an ISO image

See: https://gridscale.io/en//api-documentation/index.html#operation/updateServerLinkedIsoimage

func (*Client) UpdateServerNetwork

func (c *Client) UpdateServerNetwork(ctx context.Context, serverID, networkID string, body ServerNetworkRelationUpdateRequest) error

UpdateServerNetwork updates a link between a network and a server

See: https://gridscale.io/en//api-documentation/index.html#operation/updateServerLinkedNetwork

func (*Client) UpdateServerStorage

func (c *Client) UpdateServerStorage(ctx context.Context, serverID, storageID string, body ServerStorageRelationUpdateRequest) error

UpdateServerStorage updates a link between a storage and a server

See: https://gridscale.io/en//api-documentation/index.html#operation/updateServerLinkedStorage

func (*Client) UpdateSshkey

func (c *Client) UpdateSshkey(ctx context.Context, id string, body SshkeyUpdateRequest) error

UpdateSshkey updates a ssh key

See: https://gridscale.io/en//api-documentation/index.html#operation/updateSshKey

func (*Client) UpdateStorage

func (c *Client) UpdateStorage(ctx context.Context, id string, body StorageUpdateRequest) error

UpdateStorage update a storage

See: https://gridscale.io/en//api-documentation/index.html#operation/updateStorage

func (*Client) UpdateStorageSnapshot

func (c *Client) UpdateStorageSnapshot(ctx context.Context, storageID, snapshotID string, body StorageSnapshotUpdateRequest) error

UpdateStorageSnapshot updates a specific storage's snapshot

See: https://gridscale.io/en//api-documentation/index.html#operation/updateSnapshot

func (*Client) UpdateStorageSnapshotSchedule

func (c *Client) UpdateStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string,
	body StorageSnapshotScheduleUpdateRequest) error

UpdateStorageSnapshotSchedule updates specific Storage's snapshot scheduler based on a given storage's id and scheduler's id

See: https://gridscale.io/en//api-documentation/index.html#operation/updateSnapshotSchedule

func (*Client) UpdateTemplate

func (c *Client) UpdateTemplate(ctx context.Context, id string, body TemplateUpdateRequest) error

UpdateTemplate updates a template

See: https://gridscale.io/en//api-documentation/index.html#operation/updateTemplate

func (*Client) UserAgent

func (c *Client) UserAgent() string

UserAgent returns user agent

func (*Client) UserUUID

func (c *Client) UserUUID() string

UserUUID returns user UUID

type Config

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

Config config for client

func DefaultConfiguration

func DefaultConfiguration(uuid string, token string) *Config

DefaultConfiguration creates a default configuration

func NewConfiguration

func NewConfiguration(apiURL string, uuid string, token string, debugMode, sync bool, requestCheckTimeoutSecs,
	delayIntervalMilliSecs, maxNumberOfRetries int) *Config

NewConfiguration creates a new config

- Parameters:

  • apiURL string: base URL of API.
  • uuid string: UUID of user.
  • token string: API token.
  • debugMode bool: true => run client in debug mode.
  • sync bool: true => client is in synchronous mode. The client will block until Create/Update/Delete processes are completely finished. It is safer to set this parameter to `true`.
  • requestCheckTimeoutSecs int: Timeout (in second) for checking requests (for synchronous feature)
  • delayIntervalMilliSecs int: delay (in MilliSecond) between requests when checking request (or retry 5xx, 424 error code)
  • maxNumberOfRetries int: number of retries when server returns 5xx, 424 error code.

type CreateResponse

type CreateResponse struct {
	//UUID of the object being created
	ObjectUUID string `json:"object_uuid"`

	//UUID of the request
	RequestUUID string `json:"request_uuid"`
}

CreateResponse common struct of a response for creation

type Credential

type Credential struct {
	//The initial username to authenticate the Service.
	Username string `json:"username"`

	//The initial password to authenticate the Service.
	Password string `json:"password"`

	//The type of Service.
	Type string `json:"type"`
}

Credential is JSON struct of credential

type DeletedIPList added in v1.0.0

type DeletedIPList struct {
	//Array of deleted IP addresses
	List map[string]IPProperties `json:"deleted_ips"`
}

DeletedIPList is JSON struct of a list of deleted IPs

type DeletedISOImageList added in v1.0.0

type DeletedISOImageList struct {
	//List of deleted ISO-images
	List map[string]ISOImageProperties `json:"deleted_isoimages"`
}

DeletedISOImageList is JSON struct of a list of deleted SO images

type DeletedNetworkList added in v1.0.0

type DeletedNetworkList struct {
	//Array of deleted networks
	List map[string]NetworkProperties `json:"deleted_networks"`
}

DeletedNetworkList is JSON struct of a list of deleted networks

type DeletedPaaSServices added in v1.0.0

type DeletedPaaSServices struct {
	//Array of deleted PaaS services
	List map[string]PaaSServiceProperties `json:"deleted_paas_services"`
}

DeletedPaaSServices is the JSON struct of a list of deleted PaaS services

type DeletedServerList added in v1.0.0

type DeletedServerList struct {
	//Array of deleted servers
	List map[string]ServerProperties `json:"deleted_servers"`
}

DeletedServerList JSON struct of a list of deleted servers

type DeletedStorageList added in v1.0.0

type DeletedStorageList struct {
	//Array of deleted storages
	List map[string]StorageProperties `json:"deleted_storages"`
}

DeletedStorageList JSON struct of a list of storages

type DeletedStorageSnapshotList added in v1.0.0

type DeletedStorageSnapshotList struct {
	//Array of deleted snapshots
	List map[string]StorageSnapshotProperties `json:"deleted_snapshots"`
}

DeletedStorageSnapshotList is JSON structure of a list of deleted storage snapshots

type DeletedTemplateList added in v1.0.0

type DeletedTemplateList struct {
	//Array of deleted templates
	List map[string]TemplateProperties `json:"deleted_templates"`
}

DeletedTemplateList JSON struct of a list of deleted templates

type Event added in v1.0.0

type Event struct {
	//Properties of an event
	Properties EventProperties `json:"event"`
}

Event is JSOn struct of a single firewall's event

type EventList added in v1.0.0

type EventList struct {
	//Array of events
	List []EventProperties `json:"events"`
}

EventList is JSON struct of a list of events

type EventProperties added in v1.0.0

type EventProperties struct {
	//Type of object (server, storage, IP) etc
	ObjectType string `json:"object_type"`

	//The UUID of the event
	RequestUUID string `json:"request_uuid"`

	//The UUID of the objects the event was executed on
	ObjectUUID string `json:"object_uuid"`

	//The type of change
	Activity string `json:"activity"`

	//The type of request
	RequestType string `json:"request_type"`

	//True or false, whether the request was successful or not
	RequestStatus string `json:"request_status"`

	//A detailed description of the change.
	Change string `json:"change"`

	//Time the event was triggered
	Timestamp GSTime `json:"timestamp"`

	//The UUID of the user that triggered the event
	UserUUID string `json:"user_uuid"`
}

EventProperties is JSON struct of an event properties

type Firewall

type Firewall struct {
	//Properties of a firewall
	Properties FirewallProperties `json:"firewall"`
}

Firewall is JSON structure of a single firewall

type FirewallCreateRequest

type FirewallCreateRequest struct {
	//Name of firewall being created
	Name string `json:"name"`

	//Labels. Can be nil
	Labels []string `json:"labels,omitempty"`

	//FirewallRules
	Rules FirewallRules `json:"rules"`
}

FirewallCreateRequest is JSON struct of a request for creating a firewall

type FirewallCreateResponse

type FirewallCreateResponse struct {
	//Request UUID
	RequestUUID string `json:"request_uuid"`

	//The UUID of the firewall being created
	ObjectUUID string `json:"object_uuid"`
}

FirewallCreateResponse is JSON struct of a response for creating a firewall

type FirewallList

type FirewallList struct {
	//Array of firewalls
	List map[string]FirewallProperties `json:"firewalls"`
}

FirewallList is JSON structure of a list of firewalls

type FirewallProperties

type FirewallProperties struct {
	//Status indicates the status of the object
	Status string `json:"status"`

	//List of labels
	Labels []string `json:"labels"`

	//The UUID of an object is always unique, and refers to a specific object
	ObjectUUID string `json:"object_uuid"`

	//Defines the date and time of the last object change
	ChangeTime GSTime `json:"change_time"`

	//FirewallRules
	Rules FirewallRules `json:"rules"`

	//Defines the date and time the object was initially created
	CreateTime GSTime `json:"create_time"`

	//If this is a private or public Firewall-Template
	Private bool `json:"private"`

	//The information about other object which are related to this Firewall. The object could be Network.
	Relations FirewallRelation `json:"relations"`

	//Description of the ISO-Image release
	Description string `json:"description"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`
}

FirewallProperties is JSON struct of a firewall's properties

type FirewallRelation

type FirewallRelation struct {
	//Array of object (NetworkinFirewall)
	Networks []NetworkInFirewall `json:"networks"`
}

FirewallRelation is a JSON struct of a list of firewall's relations

type FirewallRuleProperties

type FirewallRuleProperties struct {
	//Enum:"udp" "tcp". Either udp or tcp
	Protocol string `json:"protocol,omitempty"`

	//A Number between 1 and 65535, port ranges are seperated by a colon for FTP.
	DstPort string `json:"dst_port,omitempty"`

	//A Number between 1 and 65535, port ranges are seperated by a colon for FTP.
	SrcPort string `json:"src_port,omitempty"`

	//A Number between 1 and 65535, port ranges are seperated by a colon for FTP.
	SrcCidr string `json:"src_cidr,omitempty"`

	//Enum:"accept" "drop". This defines what the firewall will do. Either accept or drop.
	Action string `json:"action"`

	//Description
	Comment string `json:"comment,omitempty"`

	//Either an IPv4/6 address or and IP Network in CIDR format. If this field is empty then all IPs have access to this service.
	DstCidr string `json:"dst_cidr,omitempty"`

	//The order at which the firewall will compare packets against its rules,
	// a packet will be compared against the first rule, it will either allow it to pass
	// or block it and it won t be matched against any other rules.
	// However, if it does no match the rule, then it will proceed onto rule 2.
	// Packets that do not match any rules are blocked by default.
	Order int `json:"order"`
}

FirewallRuleProperties is JSON struct of a firewall's rule properties

type FirewallRules

type FirewallRules struct {
	//Firewall template rules for inbound traffic - covers ipv6 addresses.
	RulesV6In []FirewallRuleProperties `json:"rules-v6-in,omitempty"`

	//Firewall template tules for outbound traffic - covers ipv6 addresses.
	RulesV6Out []FirewallRuleProperties `json:"rules-v6-out,omitempty"`

	//Firewall template rules for inbound traffic - covers ipv4 addresses.
	RulesV4In []FirewallRuleProperties `json:"rules-v4-in,omitempty"`

	//Firewall template tules for outbound traffic - covers ipv4 addresses.
	RulesV4Out []FirewallRuleProperties `json:"rules-v4-out,omitempty"`
}

FirewallRules is JSON struct of a list of firewall's rules

type FirewallUpdateRequest

type FirewallUpdateRequest struct {
	//New name. Leave it if you do not want to update the name
	Name string `json:"name,omitempty"`

	//New list of labels. Leave it if you do not want to update the Labels
	Labels []string `json:"labels,omitempty"`

	//FirewallRules. Leave it if you do not want to update the firewall rules
	Rules *FirewallRules `json:"rules,omitempty"`
}

FirewallUpdateRequest is JSON struct of a request for updating a firewall

type ForwardingRule

type ForwardingRule struct {
	//SSL from Letsencrypt
	LetsencryptSSL interface{} `json:"letsencrypt_ssl"`

	//Listen port
	ListenPort int `json:"listen_port"`

	//Mode of forwarding
	Mode string `json:"mode"`

	//Target port
	TargetPort int `json:"target_port"`
}

ForwardingRule is the JSON struct of forwarding rule

type GSTime

type GSTime struct {
	time.Time
}

GSTime is custom time type of Gridscale

func (GSTime) MarshalJSON

func (t GSTime) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaller for GSTime

func (*GSTime) UnmarshalJSON

func (t *GSTime) UnmarshalJSON(b []byte) error

UnmarshalJSON custom unmarshaller for GSTime

type IP

type IP struct {
	//Properties of an IP address
	Properties IPProperties `json:"ip"`
}

IP is JSON struct if a single IP

type IPCreateRequest

type IPCreateRequest struct {
	//Name of an IP address being created. Can be an empty string
	Name string `json:"name,omitempty"`

	//IP address family. Can only be either `IPv4Type` or `IPv6Type`
	Family ipAddressType `json:"family"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Sets failover mode for this IP. If true, then this IP is no longer available for DHCP and can no longer be related to any server.
	Failover bool `json:"failover,omitempty"`

	//Defines the reverse DNS entry for the IP Address (PTR Resource Record).
	ReverseDNS string `json:"reverse_dns,omitempty"`

	//List of labels.
	Labels []string `json:"labels,omitempty"`
}

IPCreateRequest is JSON struct of a request for creating an IP

type IPCreateResponse

type IPCreateResponse struct {
	//Request's UUID
	RequestUUID string `json:"request_uuid"`

	//UUID of the IP address being created
	ObjectUUID string `json:"object_uuid"`

	//The IP prefix.
	Prefix string `json:"prefix"`

	//The IP Address (v4 or v6).
	IP string `json:"ip"`
}

IPCreateResponse is JSON struct of a response for creating an IP

type IPList

type IPList struct {
	//Array of IP addresses
	List map[string]IPProperties `json:"ips"`
}

IPList is JSON struct of a list of IPs

type IPLoadbalancer

type IPLoadbalancer struct {
	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LoadbalancerName string `json:"loadbalancer_name"`

	//The UUID of loadbalancer.
	LoadbalancerUUID string `json:"loadbalancer_uuid"`
}

IPLoadbalancer is JSON struct of the relation between an IP and a Load Balancer

type IPProperties

type IPProperties struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Defines the reverse DNS entry for the IP Address (PTR Resource Record).
	ReverseDNS string `json:"reverse_dns"`

	//Enum:4 6. The IP Address family (v4 or v6)
	Family int `json:"family"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Sets failover mode for this IP. If true, then this IP is no longer available for DHCP and can no longer be related to any server.
	Failover bool `json:"failover"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//The IP prefix.
	Prefix string `json:"prefix"`

	//Defines the IP Address (v4 or v6).
	IP string `json:"ip"`

	//Defines if the object is administratively blocked. If true, it can not be deleted by the user.
	DeleteBlock bool `json:"delete_block"`

	//Total minutes the object has been running.
	UsagesInMinutes float64 `json:"usage_in_minutes"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//List of labels.
	Labels []string `json:"labels"`

	//The information about other object which are related to this IP. the object could be servers and/or loadbalancer.
	Relations IPRelations `json:"relations"`
}

IPProperties is JSON struct of an IP's properties

type IPRelations

type IPRelations struct {
	//Array of object (IPLoadbalancer)
	Loadbalancers []IPLoadbalancer `json:"loadbalancers"`

	//Array of object (IPServer)
	Servers []IPServer `json:"servers"`

	//Array of object (ServerIPRelationProperties)
	PublicIPs []ServerIPRelationProperties `json:"public_ips"`

	//Array of object (ServerStorageRelationProperties)
	Storages []ServerStorageRelationProperties `json:"storages"`
}

IPRelations is JSON struct of a list of an IP's relations

type IPServer

type IPServer struct {
	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ServerName string `json:"server_name"`

	//The UUID of the server.
	ServerUUID string `json:"server_uuid"`
}

IPServer is JSON struct of the relation between an IP and a Server

type IPUpdateRequest

type IPUpdateRequest struct {
	//New name. Leave it if you do not want to update the name
	Name string `json:"name,omitempty"`

	//Sets failover mode for this IP. If true, then this IP is no longer available for DHCP and can no longer be related to any server.
	Failover bool `json:"failover"`

	//Defines the reverse DNS entry for the IP Address (PTR Resource Record). Leave it if you do not want to update the reverse DNS.
	ReverseDNS string `json:"reverse_dns,omitempty"`

	//List of labels. Leave it if you do not want to update the labels.
	Labels []string `json:"labels,omitempty"`
}

IPUpdateRequest is JSON struct of a request for updating an IP

type ISOImage

type ISOImage struct {
	//Properties of an ISO-image
	Properties ISOImageProperties `json:"isoimage"`
}

ISOImage is JSON struct of a list an ISO image

type ISOImageCreateRequest

type ISOImageCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The source URL from which the ISO-Image should be downloaded.
	SourceURL string `json:"source_url"`

	//List of labels. Can be leave empty.
	Labels []string `json:"labels,omitempty"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`
}

ISOImageCreateRequest is JSON struct of a request for creating an ISO-Image

type ISOImageCreateResponse

type ISOImageCreateResponse struct {
	//Request's UUID
	RequestUUID string `json:"request_uuid"`

	//UUID of an ISO-image being created
	ObjectUUID string `json:"object_uuid"`
}

ISOImageCreateResponse is JSON struct of a response for creating an ISO-Image

type ISOImageList

type ISOImageList struct {
	//List of ISO-images
	List map[string]ISOImageProperties `json:"isoimages"`
}

ISOImageList is JSON struct of a list of ISO images

type ISOImageProperties

type ISOImageProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The information about other object which are related to this isoimage.
	Relations ISOImageRelation `json:"relations"`

	//Description of the ISO-Image release.
	Description string `json:"description"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//Contains the source URL of the ISO-Image that it was originally fetched from.
	SourceURL string `json:"source_url"`

	//List of labels
	Labels []string `json:"labels"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Upstream version of the ISO-Image release
	Version string `json:"version"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Total minutes the object has been running.
	UsageInMinutes int `json:"usage_in_minutes"`

	//Whether the ISO-Image is private or not.
	Private bool `json:"private"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//The capacity of an ISO-Image in GB.
	Capacity int `json:"capacity"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`
}

ISOImageProperties is JSON struct of properties of an ISO image

type ISOImageRelation

type ISOImageRelation struct {
	//Array of object (ServerinIsoimage)
	Servers []ServerinISOImage `json:"servers"`
}

ISOImageRelation is JSON struct of a list of an ISO-Image's relations

type ISOImageUpdateRequest

type ISOImageUpdateRequest struct {
	//New name. Leave it if you do not want to update the name.
	Name string `json:"name,omitempty"`

	//List of labels. Leave it if you do not want to update the list of labels.
	Labels []string `json:"labels,omitempty"`
}

ISOImageUpdateRequest is JSON struct of a request for updating an ISO-Image

type Label added in v1.0.0

type Label struct {
	//Properties of a label
	Properties LabelProperties `json:"label"`
}

Label JSON struct of a single label

type LabelCreateRequest added in v1.0.0

type LabelCreateRequest struct {
	//Name of the new label
	Label string `json:"label"`
}

LabelCreateRequest JSON struct of a request for creating a label

type LabelList added in v1.0.0

type LabelList struct {
	//List of labels
	List map[string]LabelProperties `json:"labels"`
}

LabelList JSON struct of a list of labels

type LabelProperties added in v1.0.0

type LabelProperties struct {
	//Label's name
	Label string `json:"label"`

	//Create time of a label
	CreateTime GSTime `json:"create_time"`

	//Time of the last change of a label
	ChangeTime GSTime `json:"change_time"`

	//Relations of a label
	Relations []interface{} `json:"relations"`

	//Status indicates the status of a label.
	Status string `json:"status"`
}

LabelProperties JSON struct of properties of a label

type LoadBalancer

type LoadBalancer struct {
	//Properties of a loadbalancer
	Properties LoadBalancerProperties `json:"loadbalancer"`
}

LoadBalancer is the JSON struct of a loadbalancer

type LoadBalancerCreateRequest

type LoadBalancerCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ListenIPv6UUID string `json:"listen_ipv6_uuid"`

	//The UUID of the IPv4 address the loadbalancer will listen to for incoming requests.
	ListenIPv4UUID string `json:"listen_ipv4_uuid"`

	//The algorithm used to process requests. Allowed values: `LoadbalancerRoundrobinAlg`, `LoadbalancerLeastConnAlg`
	Algorithm loadbalancerAlgorithm `json:"algorithm"`

	//An array of ForwardingRule objects containing the forwarding rules for the loadbalancer
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

	//The servers that this loadbalancer can communicate with
	BackendServers []BackendServer `json:"backend_servers"`

	//List of labels.
	Labels []string `json:"labels"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Whether the Load balancer is forced to redirect requests from HTTP to HTTPS
	RedirectHTTPToHTTPS bool `json:"redirect_http_to_https"`

	//Status indicates the status of the object.
	Status string `json:"status,omitempty"`
}

LoadBalancerCreateRequest is the JSON struct for creating a loadbalancer request

type LoadBalancerCreateResponse

type LoadBalancerCreateResponse struct {
	//Request's UUID
	RequestUUID string `json:"request_uuid"`

	//UUID of the loadbalancer being created
	ObjectUUID string `json:"object_uuid"`
}

LoadBalancerCreateResponse is the JSON struct for a loadbalancer response

type LoadBalancerProperties

type LoadBalancerProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Defines the numbering of the Data Centers on a given IATA location (e.g. where fra is the location_iata, the site is then 1, 2, 3, ...).
	LocationSite string `json:"location_site"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Forwarding rules of a loadbalancer
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//The servers that this Load balancer can communicate with.
	BackendServers []BackendServer `json:"backend_servers"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Whether the Load balancer is forced to redirect requests from HTTP to HTTPS.
	RedirectHTTPToHTTPS bool `json:"redirect_http_to_https"`

	//List of labels.
	Labels []string `json:"labels"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//Total minutes of cores used
	UsageInMinutes int `json:"usage_in_minutes"`

	//The algorithm used to process requests. Accepted values: roundrobin / leastconn.
	Algorithm string `json:"algorithm"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The UUID of the IPv6 address the Load balancer will listen to for incoming requests.
	ListenIPv6UUID string `json:"listen_ipv6_uuid"`

	//The UUID of the IPv4 address the Load balancer will listen to for incoming requests.
	ListenIPv4UUID string `json:"listen_ipv4_uuid"`
}

LoadBalancerProperties is the properties of a loadbalancer

type LoadBalancerUpdateRequest

type LoadBalancerUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ListenIPv6UUID string `json:"listen_ipv6_uuid"`

	//The UUID of the IPv4 address the loadbalancer will listen to for incoming requests.
	ListenIPv4UUID string `json:"listen_ipv4_uuid"`

	//The algorithm used to process requests. Allowed values: `LoadbalancerRoundrobinAlg`, `LoadbalancerLeastConnAlg`
	Algorithm loadbalancerAlgorithm `json:"algorithm"`

	//An array of ForwardingRule objects containing the forwarding rules for the loadbalancer
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

	//The servers that this loadbalancer can communicate with
	BackendServers []BackendServer `json:"backend_servers"`

	//List of labels.
	Labels []string `json:"labels"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Whether the Load balancer is forced to redirect requests from HTTP to HTTPS
	RedirectHTTPToHTTPS bool `json:"redirect_http_to_https"`

	//Status indicates the status of the object.
	Status string `json:"status,omitempty"`
}

LoadBalancerUpdateRequest is the JSON struct for updating a loadbalancer request

type LoadBalancers

type LoadBalancers struct {
	//Array of loadbalancers
	List map[string]LoadBalancerProperties `json:"loadbalancers"`
}

LoadBalancers is the JSON struct of a list of loadbalancers

type Location

type Location struct {
	//Properties of a location
	Properties LocationProperties `json:"location"`
}

Location JSON struct of a single location

type LocationList

type LocationList struct {
	//Array of locations
	List map[string]LocationProperties `json:"locations"`
}

LocationList JSON struct of a list of locations

type LocationProperties

type LocationProperties struct {
	//Uses IATA airport code, which works as a location identifier.
	Iata string `json:"iata"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//List of labels.
	Labels []string `json:"labels"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Country string `json:"country"`
}

LocationProperties JSON struct of properties of a location

type Network

type Network struct {
	//Properties of a network
	Properties NetworkProperties `json:"network"`
}

Network is JSON struct of a single network

type NetworkCreateRequest

type NetworkCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//List of labels. Can be empty.
	Labels []string `json:"labels,omitempty"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Defines information about MAC spoofing protection (filters layer2 and ARP traffic based on MAC source).
	//It can only be (de-)activated on a private network - the public network always has l2security enabled.
	//It will be true if the network is public, and false if the network is private.
	L2Security bool `json:"l2security,omitempty"`
}

NetworkCreateRequest is JSON of a request for creating a network

type NetworkCreateResponse

type NetworkCreateResponse struct {
	//UUID of the network being created
	ObjectUUID string `json:"object_uuid"`

	//UUID of the request
	RequestUUID string `json:"request_uuid"`
}

NetworkCreateResponse is JSON of a response for creating a network

type NetworkInFirewall

type NetworkInFirewall struct {
	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The UUID of the network you're requesting.
	NetworkUUID string `json:"network_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	NetworkName string `json:"network_name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

NetworkInFirewall is a JSON struct of a firewall's relation

type NetworkList

type NetworkList struct {
	//Array of networks
	List map[string]NetworkProperties `json:"networks"`
}

NetworkList is JSON struct of a list of networks

type NetworkPaaSSecurityZone

type NetworkPaaSSecurityZone struct {
	//IPv6 prefix of the PaaS service
	IPv6Prefix string `json:"ipv6_prefix"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`
}

type NetworkProperties

type NetworkProperties struct {
	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//True if the network is public. If private it will be false.
	PublicNet bool `json:"public_net"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//One of 'network', 'network_high' or 'network_insane'.
	NetworkType string `json:"network_type"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Defines information about MAC spoofing protection (filters layer2 and ARP traffic based on MAC source).
	//It can only be (de-)activated on a private network - the public network always has l2security enabled.
	//It will be true if the network is public, and false if the network is private.
	L2Security bool `json:"l2security"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//Defines if the object is administratively blocked. If true, it can not be deleted by the user.
	DeleteBlock bool `json:"delete_block"`

	//List of labels.
	Labels []string `json:"labels"`

	//The information about other object which are related to this network. the object could be servers and/or vlans
	Relations NetworkRelations `json:"relations"`
}

NetworkProperties is JSON struct of a network's properties

type NetworkRelations

type NetworkRelations struct {
	//Array of object (NetworkVlan)
	Vlans []NetworkVlan `json:"vlans"`

	//Array of object (NetworkServer)
	Servers []NetworkServer `json:"servers"`

	//Array of object (NetworkPaaSSecurityZone)
	PaaSSecurityZones []NetworkPaaSSecurityZone `json:"paas_security_zones"`
}

NetworkRelations is JSON struct of a list of a network's relations

type NetworkServer

type NetworkServer struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Network_mac defines the MAC address of the network interface.
	Mac string `json:"mac"`

	//Whether the server boots from this iso image or not.
	Bootdevice bool `json:"bootdevice"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Defines information about IP prefix spoof protection (it allows source traffic only from the IPv4/IPv4 network prefixes).
	//If empty, it allow no IPv4/IPv6 source traffic. If set to null, l3security is disabled (default).
	L3security []string `json:"l3security"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//The UUID of the network you're requesting.
	NetworkUUID string `json:"network_uuid"`

	//The ordering of the network interfaces. Lower numbers have lower PCI-IDs.
	Ordering int `json:"ordering"`
}

NetworkServer is JSON struct of a relation between a network and a server

type NetworkUpdateRequest

type NetworkUpdateRequest struct {
	//New name. Leave it if you do not want to update the name
	Name string `json:"name,omitempty"`

	//L2Security. Leave it if you do not want to update the l2 security
	L2Security bool `json:"l2security"`
}

NetworkUpdateRequest is JSON of a request for updating a network

type NetworkVlan

type NetworkVlan struct {
	//Vlan
	Vlan int `json:"vlan"`

	//Name of tenant
	TenantName string `json:"tenant_name"`

	//UUID of tenant
	TenantUUID string `json:"tenant_uuid"`
}

NetworkVlan is JSON struct of a relation between a network and a VLAN

type ObjectStorageAccessKey

type ObjectStorageAccessKey struct {
	//Properties of an object storage access key
	Properties ObjectStorageAccessKeyProperties `json:"access_key"`
}

ObjectStorageAccessKey is JSON structure of a single Object Storage Access Key

type ObjectStorageAccessKeyCreateResponse

type ObjectStorageAccessKeyCreateResponse struct {
	AccessKey struct {
		////The object storage secret_key.
		SecretKey string `json:"secret_key"`

		//The object storage secret_key.
		AccessKey string `json:"access_key"`
	} `json:"access_key"`

	//UUID of the request
	RequestUUID string `json:"request_uuid"`
}

ObjectStorageAccessKeyCreateResponse is JSON struct of a response for creating an object storage access key

type ObjectStorageAccessKeyList

type ObjectStorageAccessKeyList struct {
	//Array of Object Storages' access keys
	List []ObjectStorageAccessKeyProperties `json:"access_keys"`
}

ObjectStorageAccessKeyList is JSON structure of a list of Object Storage Access Keys

type ObjectStorageAccessKeyProperties

type ObjectStorageAccessKeyProperties struct {
	//The object storage secret_key.
	SecretKey string `json:"secret_key"`

	//The object storage access_key.
	AccessKey string `json:"access_key"`

	//Account this credentials belong to.
	User string `json:"user"`
}

ObjectStorageAccessKeyProperties is JSON struct of properties of an object storage access key

type ObjectStorageBucket

type ObjectStorageBucket struct {
	//Properties of a bucket
	Properties ObjectStorageBucketProperties `json:"bucket"`
}

ObjectStorageBucket is JSON struct of a single bucket

type ObjectStorageBucketList

type ObjectStorageBucketList struct {
	//Array of Buckets
	List []ObjectStorageBucketProperties `json:"buckets"`
}

ObjectStorageBucketList is JSON struct of a list of buckets

type ObjectStorageBucketProperties

type ObjectStorageBucketProperties struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The current usage of the bucket.
	Usage struct {
		//The size of the the bucket (in kb).
		SizeKb int `json:"size_kb"`

		//The number of files in the bucket.
		NumObjects int `json:"num_objects"`
	} `json:"usage"`
}

ObjectStorageBucketProperties is JSON struct of properties of a bucket

type PaaSMetricProperties

type PaaSMetricProperties struct {
	//Defines the begin of the time range.
	BeginTime GSTime `json:"begin_time"`

	//Defines the end of the time range.
	EndTime GSTime `json:"end_time"`

	//The UUID of an object is always unique, and refers to a specific object.
	PaaSServiceUUID string `json:"paas_service_uuid"`

	//CPU core usage
	CoreUsage PaaSMetricValue `json:"core_usage"`

	//Storage usage
	StorageSize PaaSMetricValue `json:"storage_size"`
}

PaaSMetricProperties JSON of properties of a PaaS metric

type PaaSMetricValue

type PaaSMetricValue struct {
	//Value
	Value float64 `json:"value"`

	//Unit of the value
	Unit string `json:"unit"`
}

PaaSMetricValue JSON of a metric value

type PaaSRelationService

type PaaSRelationService struct {
	//Array of object (ServiceObject)
	Services []ServiceObject `json:"services"`
}

PaaSRelationService JSON struct of a relation between a PaaS service and a service

type PaaSSecurityZone

type PaaSSecurityZone struct {
	//Properties of a security zone
	Properties PaaSSecurityZoneProperties `json:"paas_security_zone"`
}

PaaSSecurityZone JSON struct of a single PaaS security zone

type PaaSSecurityZoneCreateRequest

type PaaSSecurityZoneCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name,omitempty"`

	//Identifies which datacenter the object belongs to.
	LocationUUID string `json:"location_uuid,omitempty"`
}

PaaSSecurityZoneCreateRequest JSON struct of a request for creating a PaaS security zone

type PaaSSecurityZoneCreateResponse

type PaaSSecurityZoneCreateResponse struct {
	//UUID of the request
	RequestUUID string `json:"request_uuid"`

	//UUID of the security zone being created
	PaaSSecurityZoneUUID string `json:"paas_security_zone_uuid"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`
}

PaaSSecurityZoneCreateResponse JSON struct of a response for creating a PaaS security zone

type PaaSSecurityZoneProperties

type PaaSSecurityZoneProperties struct {
	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//List of labels.
	Labels []string `json:"labels"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//object (PaaSRelationService)
	Relation PaaSRelationService `json:"relation"`
}

PaaSSecurityZoneProperties JSOn struct of properties of a PaaS security zone

type PaaSSecurityZoneUpdateRequest

type PaaSSecurityZoneUpdateRequest struct {
	//The new name you give to the security zone. Leave it if you do not want to update the name
	Name string `json:"name,omitempty"`

	//Identifies which datacenter the object belongs to. Leave it if you do not want to update the location
	LocationUUID string `json:"location_uuid,omitempty"`

	//The UUID for the security zone you would like to update. Leave it if you do not want to update the security zone
	PaaSSecurityZoneUUID string `json:"paas_security_zone_uuid,omitempty"`
}

PaaSSecurityZoneUpdateRequest JSON struct of a request for updating a PaaS security zone

type PaaSSecurityZones

type PaaSSecurityZones struct {
	//Array of security zones
	List map[string]PaaSSecurityZoneProperties `json:"paas_security_zones"`
}

PaaSSecurityZones JSON struct of a list of PaaS security zones

type PaaSService

type PaaSService struct {
	//Properties of a PaaS service
	Properties PaaSServiceProperties `json:"paas_service"`
}

PaaSService is the JSON struct of a single PaaS service

type PaaSServiceCreateRequest

type PaaSServiceCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The template used to create the service, you can find an available list at the /service_templates endpoint.
	PaaSServiceTemplateUUID string `json:"paas_service_template_uuid"`

	//The template used to create the service, you can find an available list at the /service_templates endpoint.
	Labels []string `json:"labels,omitempty"`

	//The UUID of the security zone that the service is running in.
	PaaSSecurityZoneUUID string `json:"paas_security_zone_uuid,omitempty"`

	//A list of service resource limits.
	ResourceLimits []ResourceLimit `json:"resource_limits,omitempty"`

	//Contains the service parameters for the service.
	Parameters map[string]interface{} `json:"parameters,omitempty"`
}

PaaSServiceCreateRequest is JSON struct of a request for creating a PaaS service

type PaaSServiceCreateResponse

type PaaSServiceCreateResponse struct {
	//UUID of the request
	RequestUUID string `json:"request_uuid"`

	//Contains the IPv6 address and port that the Service will listen to, you can use these details to connect internally to a service.
	ListenPorts map[string]map[string]int `json:"listen_ports"`

	//The template used to create the service, you can find an available list at the /service_templates endpoint.
	PaaSServiceUUID string `json:"paas_service_uuid"`

	//Contains the initial setup credentials for Service.
	Credentials []Credential `json:"credentials"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//A list of service resource limits.
	ResourceLimits []ResourceLimit `json:"resource_limits"`

	//Contains the service parameters for the service.
	Parameters map[string]interface{} `json:"parameters"`
}

PaaSServiceCreateResponse is JSON struct of a response for creating a PaaS service

type PaaSServiceMetric

type PaaSServiceMetric struct {
	//Properties of a PaaS service metric
	Properties PaaSMetricProperties `json:"paas_service_metric"`
}

PaaSServiceMetric JSON of a single PaaS metric

type PaaSServiceMetrics

type PaaSServiceMetrics struct {
	//Array of a PaaS service's metrics
	List []PaaSMetricProperties `json:"paas_service_metrics"`
}

PaaSServiceMetrics JSON of a list of PaaS metrics

type PaaSServiceProperties

type PaaSServiceProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//List of labels.
	Labels []string `json:"labels"`

	//Contains the initial setup credentials for Service.
	Credentials []Credential `json:"credentials"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Contains the IPv6 address and port that the Service will listen to,
	//you can use these details to connect internally to a service.
	ListenPorts map[string]map[string]int `json:"listen_ports"`

	//The UUID of the security zone that the service is running in.
	SecurityZoneUUID string `json:"security_zone_uuid"`

	//The template used to create the service, you can find an available list at the /service_templates endpoint.
	ServiceTemplateUUID string `json:"service_template_uuid"`

	//Total minutes the object has been running.
	UsageInMinutes int `json:"usage_in_minutes"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//A list of service resource limits.
	ResourceLimits []ResourceLimit `json:"resource_limits"`

	//Contains the service parameters for the service.
	Parameters map[string]interface{} `json:"parameters"`
}

PaaSServiceProperties is the properties of a single PaaS service

type PaaSServiceUpdateRequest

type PaaSServiceUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Leave it if you do not want to update the name
	Name string `json:"name,omitempty"`

	//List of labels. Leave it if you do not want to update the list of labels
	Labels []string `json:"labels,omitempty"`

	//Contains the service parameters for the service. Leave it if you do not want to update the parameters
	Parameters map[string]interface{} `json:"parameters,omitempty"`

	//A list of service resource limits. Leave it if you do not want to update the resource limits
	ResourceLimits []ResourceLimit `json:"resource_limits,omitempty"`
}

PaaSServiceUpdateRequest JSON of a request for updating a PaaS service

type PaaSServices

type PaaSServices struct {
	//Array of PaaS services
	List map[string]PaaSServiceProperties `json:"paas_services"`
}

PaaSServices is the JSON struct of a list of PaaS services

type PaaSTemplate

type PaaSTemplate struct {
	//Properties of a PaaS template
	Properties PaaSTemplateProperties `json:"paas_service_template"`
}

PaaSTemplate is JSON struct for a single PaaS Template

type PaaSTemplateProperties

type PaaSTemplateProperties struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Describes the category of the service.
	Category string `json:"category"`

	//Product No
	ProductNo int `json:"product_no"`

	//List of labels.
	Labels []string `json:"labels"`

	//The amount of concurrent connections for the service.
	Resources Resource `json:"resources"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//A definition of possible service template parameters (python-cerberus compatible).
	ParametersSchema map[string]Parameter `json:"parameters_schema"`
}

PaaSTemplateProperties is JSOn struct of properties of a PaaS template

type PaaSTemplates

type PaaSTemplates struct {
	//Array of PaaS templates
	List map[string]PaaSTemplateProperties `json:"paas_service_templates"`
}

PaaSTemplates is JSON struct of a list of PaaS Templates

type Parameter

type Parameter struct {
	//Is required
	Required bool `json:"required"`

	//Is empty
	Empty bool `json:"empty"`

	//Description of parameter
	Description string `json:"description"`

	//Maximum
	Max int `json:"max"`

	//Minimum
	Min int `json:"min"`

	//Default value
	Default interface{} `json:"default"`

	//Type of parameter
	Type string `json:"type"`

	//Allowed values
	Allowed []string `json:"allowed"`

	//Regex
	Regex string `json:"regex"`
}

Parameter JSON of a parameter

type RequestError

type RequestError struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	StatusCode  int
	RequestUUID string
}

RequestError error of a request

func (RequestError) Error

func (r RequestError) Error() string

Error just returns error as string

type RequestStatus

type RequestStatus map[string]RequestStatusProperties

RequestStatus status of a request

type RequestStatusProperties

type RequestStatusProperties struct {
	Status     string `json:"status"`
	Message    string `json:"message"`
	CreateTime GSTime `json:"create_time"`
}

RequestStatusProperties JSON struct of properties of a request's status

type Resource

type Resource struct {
	//The amount of memory required by the service, either RAM(MB) or SSD Storage(GB).
	Memory int `json:"memory"`

	//The amount of concurrent connections for the service.
	Connections int `json:"connections"`
}

Resource JSON of a resource

type ResourceLimit

type ResourceLimit struct {
	//The name of the resource you would like to cap.
	Resource string `json:"resource"`

	//The maximum number of the specific resource your service can use.
	Limit int `json:"limit"`
}

ResourceLimit is JSON struct of resource limit

type S3auth

type S3auth struct {
	//Host of S3
	Host string `json:"host"`

	//Access key of S3
	AccessKey string `json:"access_key"`

	//Secret key of S3
	SecretKey string `json:"secret_key"`
}

S3auth JSON struct of S3 authentication data

type S3data

type S3data struct {
	//Host of S3
	Host string `json:"host"`

	//Bucket that file will be uploaded to
	Bucket string `json:"bucket"`

	//Name of the file being uploaded
	Filename string `json:"filename"`

	//Is the file private?
	Private bool `json:"private"`
}

S3data JSON struct of info about snapshot being uploaded

type Server

type Server struct {
	//Properties of a server
	Properties ServerProperties `json:"server"`
}

Server JSON struct of a single server

type ServerCreateRequest

type ServerCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The amount of server memory in GB.
	Memory int `json:"memory"`

	//The number of server cores.
	Cores int `json:"cores"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Specifies the hardware settings for the virtual machine.
	//Allowed values: nil, DefaultServerHardware, NestedServerHardware, LegacyServerHardware, CiscoCSRServerHardware,
	//SophosUTMServerHardware, F5BigipServerHardware, Q35ServerHardware, Q35NestedServerHardware.
	//HardwareProfile = nil => server hardware is normal type
	HardwareProfile *serverHardwareProfile `json:"hardware_profile,omitempty"`

	//Defines which Availability-Zone the Server is placed. Can be empty
	AvailablityZone string `json:"availability_zone,omitempty"`

	//List of labels. Can be empty.
	Labels []string `json:"labels,omitempty"`

	//Status indicates the status of the object. Can be empty
	Status string `json:"status,omitempty"`

	//If the server should be auto-started in case of a failure (default=true when AutoRecovery=nil).
	AutoRecovery *bool `json:"auto_recovery,omitempty"`

	//The information about other object which are related to this server. the object could be ip, storage, network, and isoimage.
	//*Caution: This field will be deprecated.
	Relations *ServerCreateRequestRelations `json:"relations,omitempty"`
}

ServerCreateRequest JSON struct of a request for creating a server

type ServerCreateRequestIP

type ServerCreateRequestIP struct {
	//UUID of the IP address being attached to the server
	IPaddrUUID string `json:"ipaddr_uuid"`
}

ServerCreateRequestIP JSON struct of a relation between a server and an IP address

type ServerCreateRequestIsoimage

type ServerCreateRequestIsoimage struct {
	//UUID of the ISO-image being attached to the server
	IsoimageUUID string `json:"isoimage_uuid"`
}

ServerCreateRequestIsoimage JSON struct of a relation between a server and an ISO-Image

type ServerCreateRequestNetwork

type ServerCreateRequestNetwork struct {
	//UUID of the networks being attached to the server
	NetworkUUID string `json:"network_uuid"`

	//Is the network a boot device?
	BootDevice bool `json:"bootdevice,omitempty"`
}

ServerCreateRequestNetwork JSON struct of a relation between a server and a network

type ServerCreateRequestRelations

type ServerCreateRequestRelations struct {
	//Array of objects (ServerCreateRequestIsoimage)
	IsoImages []ServerCreateRequestIsoimage `json:"isoimages"`

	//Array of objects (ServerCreateRequestNetwork)
	Networks []ServerCreateRequestNetwork `json:"networks"`

	//Array of objects (ServerCreateRequestIP)
	PublicIPs []ServerCreateRequestIP `json:"public_ips"`

	//Array of objects (ServerCreateRequestStorage)
	Storages []ServerCreateRequestStorage `json:"storages"`
}

ServerCreateRequestRelations JSOn struct of a list of a server's relations

type ServerCreateRequestStorage

type ServerCreateRequestStorage struct {
	//UUID of the storage being attached to the server
	StorageUUID string `json:"storage_uuid"`

	//Is the storage a boot device?
	BootDevice bool `json:"bootdevice,omitempty"`
}

ServerCreateRequestStorage JSON struct of a relation between a server and a storage

type ServerCreateResponse

type ServerCreateResponse struct {
	//UUID of object being created. Same as ServerUUID.
	ObjectUUID string `json:"object_uuid"`

	//UUID of the request
	RequestUUID string `json:"request_uuid"`

	//UUID of server being created. Same as ObjectUUID.
	ServerUUID string `json:"server_uuid"`

	//UUIDs of attached networks
	NetworkUUIDs []string `json:"network_uuids"`

	//UUIDs of attached storages
	StorageUUIDs []string `json:"storage_uuids"`

	//UUIDs of attached IP addresses
	IPaddrUUIDs []string `json:"ipaddr_uuids"`
}

ServerCreateResponse JSON struct of a response for creating a server

type ServerIPRelation

type ServerIPRelation struct {
	//Properties of a relation between a server and IP addresses
	Properties ServerIPRelationProperties `json:"ip_relation"`
}

ServerIPRelation JSON struct of a single relation between a server and a IP address

type ServerIPRelationCreateRequest

type ServerIPRelationCreateRequest struct {
	//You can only attach 1 IPv4 and/or IPv6 to a server based on the IP address's UUID
	ObjectUUID string `json:"object_uuid"`
}

ServerIPRelationCreateRequest JSON struct of request for creating a relation between a server and a IP address

type ServerIPRelationList

type ServerIPRelationList struct {
	//Array of relations between a server and IP addresses
	List []ServerIPRelationProperties `json:"ip_relations"`
}

ServerIPRelationList JSON struct of a list of relations between a server and IP addresses

type ServerIPRelationProperties

type ServerIPRelationProperties struct {
	//The UUID of the server that this IP is attached to.
	ServerUUID string `json:"server_uuid"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The prefix of the IP Address.
	Prefix string `json:"prefix"`

	//Either 4 or 6
	Family int `json:"family"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The IP Address (v4 or v6)
	IP string `json:"ip"`
}

ServerIPRelationProperties JSON struct of properties of a relation between a server and a IP address

type ServerIsoImageRelation

type ServerIsoImageRelation struct {
	//Properties of a relation between a server and an ISO-Image
	Properties ServerIsoImageRelationProperties `json:"isoimage_relation"`
}

ServerIsoImageRelation JSON struct of a single relation between a server and an ISO-Image

type ServerIsoImageRelationCreateRequest

type ServerIsoImageRelationCreateRequest struct {
	//The UUID of the ISO-image you are requesting.
	ObjectUUID string `json:"object_uuid"`
}

ServerIsoImageRelationCreateRequest JSON struct of a request for creating a relation between a server and an ISO-Image

type ServerIsoImageRelationList

type ServerIsoImageRelationList struct {
	//Array of relations between a server and ISO-Images
	List []ServerIsoImageRelationProperties `json:"isoimage_relations"`
}

ServerIsoImageRelationList JSON struct of a list of relations between a server and ISO-Images

type ServerIsoImageRelationProperties

type ServerIsoImageRelationProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//Whether the ISO-Image is private or not.
	Private bool `json:"private"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Whether the server boots from this iso image or not.
	Bootdevice bool `json:"bootdevice"`
}

ServerIsoImageRelationProperties JSON struct of properties of a relation between a server and an ISO-Image

type ServerIsoImageRelationUpdateRequest

type ServerIsoImageRelationUpdateRequest struct {
	//Whether the server boots from this ISO-image or not.
	BootDevice bool   `json:"bootdevice"`
	Name       string `json:"name"`
}

ServerIsoImageRelationUpdateRequest JSON struct of a request for updating a relation between a server and an ISO-Image

type ServerList

type ServerList struct {
	//Array of servers
	List map[string]ServerProperties `json:"servers"`
}

ServerList JSON struct of a list of servers

type ServerMetric

type ServerMetric struct {
	//Properties of a server metric
	Properties ServerMetricProperties `json:"server_metric"`
}

ServerMetric JSON struct of a single metric of a server

type ServerMetricList

type ServerMetricList struct {
	//Array of a server's metrics
	List []ServerMetricProperties `json:"server_metrics"`
}

ServerMetricList JSON struct of a list of a server's metrics

type ServerMetricProperties

type ServerMetricProperties struct {
	//Defines the begin of the time range.
	BeginTime GSTime `json:"begin_time"`

	//Defines the end of the time range.
	EndTime GSTime `json:"end_time"`

	//The UUID of an object is always unique, and refers to a specific object.
	PaaSServiceUUID string `json:"paas_service_uuid"`

	//Core usage
	CoreUsage struct {
		//Value
		Value float64 `json:"value"`

		//Unit of value
		Unit string `json:"unit"`
	} `json:"core_usage"`

	//Storage usage
	StorageSize struct {
		//Value
		Value float64 `json:"value"`

		//Unit of value
		Unit string `json:"unit"`
	} `json:"storage_size"`
}

ServerMetricProperties JSON struct

type ServerNetworkRelation

type ServerNetworkRelation struct {
	//Properties of a relation between a server and a network
	Properties ServerNetworkRelationProperties `json:"network_relation"`
}

ServerNetworkRelation JSON struct of a single relation between a server and a network

type ServerNetworkRelationCreateRequest

type ServerNetworkRelationCreateRequest struct {
	//The uuid of network you wish to add. Only 7 private networks are allowed to be attached to a server
	ObjectUUID string `json:"object_uuid"`

	//The ordering of the network interfaces. Lower numbers have lower PCI-IDs. Can be empty.
	Ordering int `json:"ordering,omitempty"`

	//Whether the server boots from this network or not. Can be empty.
	BootDevice bool `json:"bootdevice,omitempty"`

	//Defines information about IP prefix spoof protection (it allows source traffic only from the IPv4/IPv4 network prefixes).
	//If empty, it allow no IPv4/IPv6 source traffic. If set to null, l3security is disabled (default).
	//Can be empty
	L3security []string `json:"l3security,omitempty"`

	//All rules of Firewall. Can be empty
	Firewall *FirewallRules `json:"firewall,omitempty"`

	//Instead of setting firewall rules manually, you can use a firewall template by setting UUID of the firewall template.
	//Can be empty.
	FirewallTemplateUUID string `json:"firewall_template_uuid,omitempty"`
}

ServerNetworkRelationCreateRequest JSON struct of a request for creating a relation between a server and a network

type ServerNetworkRelationList

type ServerNetworkRelationList struct {
	//Array of relations between a server and networks
	List []ServerNetworkRelationProperties `json:"network_relations"`
}

ServerNetworkRelationList JSON struct of a list of relations between a server and networks

type ServerNetworkRelationProperties

type ServerNetworkRelationProperties struct {
	//Defines information about MAC spoofing protection (filters layer2 and ARP traffic based on MAC source).
	//It can only be (de-)activated on a private network - the public network always has l2security enabled.
	//It will be true if the network is public, and false if the network is private.
	L2security bool `json:"l2security"`

	//The UUID of the Server.
	ServerUUID string `json:"server_uuid"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//True if the network is public. If private it will be false.
	//Each private network is a secure and fully transparent 2-Layer network between servers.
	//There is no limit on how many servers can be connected to the same private network.
	PublicNet bool `json:"public_net"`

	//The UUID of firewall template.
	FirewallTemplateUUID string `json:"firewall_template_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//network_mac defines the MAC address of the network interface.
	Mac string `json:"mac"`

	//Defines if this object is the bootdevice. Storages, Networks and ISO-Images can have a bootdevice configured,
	//but only one bootdevice per Storage, Network or ISO-Image.
	//The boot order is as follows => Network > ISO-Image > Storage.
	BootDevice bool `json:"bootdevice"`

	//PartnerUUID
	PartnerUUID string `json:"partner_uuid"`

	//Defines the ordering of the network interfaces. Lower numbers have lower PCI-IDs.
	Ordering int `json:"ordering"`

	//Firewall that is used to this server network relation
	Firewall FirewallRules `json:"firewall"`

	//(one of network, network_high, network_insane)
	NetworkType string `json:"network_type"`

	//The UUID of the network you're requesting.
	NetworkUUID string `json:"network_uuid"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Defines information about IP prefix spoof protection (it allows source traffic only from the IPv4/IPv4 network prefixes).
	//If empty, it allow no IPv4/IPv6 source traffic. If set to null, l3security is disabled (default).
	L3security []string `json:"l3security"`
}

ServerNetworkRelationProperties JSON struct of properties of a relation between a server and a network

type ServerNetworkRelationUpdateRequest

type ServerNetworkRelationUpdateRequest struct {
	//The ordering of the network interfaces. Lower numbers have lower PCI-IDs. Optional.
	Ordering int `json:"ordering,omitempty"`

	//The ordering of the network interfaces. Lower numbers have lower PCI-IDs. Optional.
	BootDevice bool `json:"bootdevice,omitempty"`

	//Defines information about IP prefix spoof protection (it allows source traffic only from the IPv4/IPv4 network prefixes).
	//If empty, it allow no IPv4/IPv6 source traffic. If set to null, l3security is disabled (default).
	//Can be empty
	L3security []string `json:"l3security,omitempty"`

	//All rules of Firewall. Optional.
	Firewall *FirewallRules `json:"firewall,omitempty"`

	//Instead of setting firewall rules manually, you can use a firewall template by setting UUID of the firewall template.
	//Optional.
	FirewallTemplateUUID string `json:"firewall_template_uuid,omitempty"`
}

ServerNetworkRelationUpdateRequest JSON struct of a request for updating a relation between a server and a network

type ServerPowerUpdateRequest

type ServerPowerUpdateRequest struct {
	//Power=true => server is on
	//Power=false => server if off
	Power bool `json:"power"`
}

ServerPowerUpdateRequest JSON struct of a request for updating server's power state

type ServerProperties

type ServerProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Indicates the amount of memory in GB.
	Memory int `json:"memory"`

	//Number of server cores.
	Cores int `json:"cores"`

	//Specifies the hardware settings for the virtual machine.
	HardwareProfile string `json:"hardware_profile"`

	//Status indicates the status of the object. it could be in-provisioning or active
	Status string `json:"status"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//The power status of the server.
	Power bool `json:"power"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//Which Availability-Zone the Server is placed.
	AvailabilityZone string `json:"availability_zone"`

	//If the server should be auto-started in case of a failure (default=true).
	AutoRecovery bool `json:"auto_recovery"`

	//Legacy-Hardware emulation instead of virtio hardware.
	//If enabled, hotplugging cores, memory, storage, network, etc. will not work,
	//but the server will most likely run every x86 compatible operating system.
	//This mode comes with a performance penalty, as emulated hardware does not benefit from the virtio driver infrastructure.
	Legacy bool `json:"legacy"`

	//The token used by the panel to open the websocket VNC connection to the server console.
	ConsoleToken string `json:"console_token"`

	//Total minutes of memory used.
	UsageInMinutesMemory int `json:"usage_in_minutes_memory"`

	//Total minutes of cores used.
	UsageInMinutesCores int `json:"usage_in_minutes_cores"`

	//List of labels.
	Labels []string `json:"labels"`

	//The information about other object which are related to this server. the object could be ip, storage, network, and isoimage
	Relations ServerRelations `json:"relations"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`
}

ServerProperties JSON struct of properties of a server

type ServerRelations

type ServerRelations struct {
	//Array of object (ServerIsoImageRelationProperties)
	IsoImages []ServerIsoImageRelationProperties `json:"isoimages"`

	//Array of object (ServerNetworkRelationProperties)
	Networks []ServerNetworkRelationProperties `json:"networks"`

	//Array of object (ServerIPRelationProperties)
	PublicIPs []ServerIPRelationProperties `json:"public_ips"`

	//Array of object (ServerStorageRelationProperties)
	Storages []ServerStorageRelationProperties `json:"storages"`
}

ServerRelations JSON struct of a list of server relations

type ServerStorageRelationCreateRequest

type ServerStorageRelationCreateRequest struct {
	//The UUID of the storage you are requesting. If server's hardware profile is default, nested, q35 or q35_nested,
	//you are allowed to attached 8 servers. Only 2 storage are allowed to be attached to server with other hardware profile
	ObjectUUID string `json:"object_uuid"`

	//Whether the server will boot from this storage device or not. Optional.
	BootDevice bool `json:"bootdevice,omitempty"`
}

ServerStorageRelationCreateRequest JSON struct of a request for creating a relation between a server and a storage

type ServerStorageRelationList

type ServerStorageRelationList struct {
	//Array of relations between a server and storages
	List []ServerStorageRelationProperties `json:"storage_relations"`
}

ServerStorageRelationList JSON struct of a list of relations between a server and storages

type ServerStorageRelationProperties

type ServerStorageRelationProperties struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//The capacity of a storage/ISO-Image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	//Indicates the speed of the storage. This may be (storage, storage_high or storage_insane).
	StorageType string `json:"storage_type"`

	//Defines the SCSI target ID. The SCSI defines transmission routes like Serial Attached SCSI (SAS), Fibre Channel and iSCSI.
	//The target ID is a device (e.g. disk).
	Target int `json:"target"`

	//Is the common SCSI abbreviation of the Logical Unit Number. A lun is a unique identifier for a single disk or a composite of disks.
	Lun int `json:"lun"`

	//Defines the SCSI controller id. The SCSI defines transmission routes such as Serial Attached SCSI (SAS), Fibre Channel and iSCSI.
	Controller int `json:"controller"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Defines if this object is the bootdevice. Storages, Networks and ISO-Images can have a bootdevice configured,
	//but only one bootdevice per Storage, Network or ISO-Image.
	//The boot order is as follows => Network > ISO-Image > Storage.
	BootDevice bool `json:"bootdevice"`

	//The SCSI bus id. The SCSI defines transmission routes like Serial Attached SCSI (SAS), Fibre Channel and iSCSI.
	//Each SCSI device is addressed via a specific number. Each SCSI bus can have multiple SCSI devices connected to it.
	Bus int `json:"bus"`

	//Indicates the UUID of the last used template on this storage (inherited from snapshots).
	LastUsedTemplate string `json:"last_used_template"`

	//If a template has been used that requires a license key (e.g. Windows Servers)
	//this shows the product_no of the license (see the /prices endpoint for more details).
	LicenseProductNo int `json:"license_product_no"`

	//The same as the object_uuid.
	ServerUUID string `json:"server_uuid"`
}

ServerStorageRelationProperties JSON struct of properties of a relation between a server and a storage

type ServerStorageRelationSingle

type ServerStorageRelationSingle struct {
	//Properties of a relation between a server and a storage
	Properties ServerStorageRelationProperties `json:"storage_relation"`
}

ServerStorageRelationSingle JSON struct of a single relation between a server and a storage

type ServerStorageRelationUpdateRequest

type ServerStorageRelationUpdateRequest struct {
	//The ordering of the network interfaces. Lower numbers have lower PCI-IDs. Optional.
	Ordering int `json:"ordering,omitempty"`

	//Whether the server boots from this network or not. Optional.
	BootDevice bool `json:"bootdevice,omitempty"`

	//Defines information about IP prefix spoof protection (it allows source traffic only from the IPv4/IPv4 network prefixes).
	//If empty, it allow no IPv4/IPv6 source traffic. If set to null, l3security is disabled (default). Optional.
	L3security []string `json:"l3security,omitempty"`
}

ServerStorageRelationUpdateRequest JSON struct of a request for updating a relation between a server and a storage

type ServerUpdateRequest

type ServerUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Leave it if you do not want to update the name.
	Name string `json:"name,omitempty"`

	//Defines which Availability-Zone the Server is placed. Leave it if you do not want to update the zone.
	AvailablityZone string `json:"availability_zone,omitempty"`

	//The amount of server memory in GB. Leave it if you do not want to update the memory
	Memory int `json:"memory,omitempty"`

	//The number of server cores. Leave it if you do not want to update the number of the cpu cores.
	Cores int `json:"cores,omitempty"`

	//List of labels. Leave it if you do not want to update the list of labels
	Labels []string `json:"labels,omitempty"`

	//If the server should be auto-started in case of a failure (default=true).
	//Leave it if you do not want to update this feature of the server.
	AutoRecovery *bool `json:"auto_recovery,omitempty"`
}

ServerUpdateRequest JSON of a request for updating a server

type ServerinISOImage

type ServerinISOImage struct {
	//Whether the server boots from this iso image or not.
	Bootdevice bool `json:"bootdevice"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`
}

ServerinISOImage is JSON struct of a relation between an ISO-Image and a Server

type ServiceObject

type ServiceObject struct {
	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`
}

ServiceObject JSON struct of a service object

type Sshkey

type Sshkey struct {
	//Properties of a SSH-key
	Properties SshkeyProperties `json:"sshkey"`
}

Sshkey JSON struct of a single SSH-key

type SshkeyCreateRequest

type SshkeyCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The OpenSSH public key string (all key types are supported => ed25519, ecdsa, dsa, rsa, rsa1).
	Sshkey string `json:"sshkey"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

SshkeyCreateRequest JSON struct of a request for creating a SSH-key

type SshkeyList

type SshkeyList struct {
	//Array of SSH-keys
	List map[string]SshkeyProperties `json:"sshkeys"`
}

SshkeyList JSON struct of a list of SSH-keys

type SshkeyProperties

type SshkeyProperties struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//The OpenSSH public key string (all key types are supported => ed25519, ecdsa, dsa, rsa, rsa1).
	Sshkey string `json:"sshkey"`

	//List of labels.
	Labels []string `json:"labels"`

	//The User-UUID of the account which created this SSH Key.
	UserUUID string `json:"user_uuid"`
}

SshkeyProperties JSON struct of properties of a single SSH-key

type SshkeyUpdateRequest

type SshkeyUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Optional.
	Name string `json:"name,omitempty"`

	//The OpenSSH public key string (all key types are supported => ed25519, ecdsa, dsa, rsa, rsa1). Optional.
	Sshkey string `json:"sshkey,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

SshkeyUpdateRequest JSON struct of a request for updating a SSH-key

type Storage

type Storage struct {
	//Properties of a storage
	Properties StorageProperties `json:"storage"`
}

Storage JSON struct of a single storage

type StorageAndSnapshotScheduleRelation

type StorageAndSnapshotScheduleRelation struct {
	//The interval at which the schedule will run (in minutes)
	RunInterval int `json:"run_interval"`

	//The amount of Snapshots to keep before overwriting the last created Snapshot.
	KeepSnapshots int `json:"keep_snapshots"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`

	//The date and time that the snapshot schedule will be run.
	NextRuntime GSTime `json:"next_runtime"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`
}

StorageAndSnapshotScheduleRelation JSON struct of a relation between a storage and a snapshot schedule

type StorageCreateRequest

type StorageCreateRequest struct {
	//Required (integer - minimum: 1 - maximum: 4096).
	Capacity int `json:"capacity"`

	//Helps to identify which datacenter an object belongs to. Optional.
	LocationUUID string `json:"location_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Storage type. Allowed values: nil, DefaultStorageType, HighStorageType, InsaneStorageType. Optional.
	StorageType *storageType `json:"storage_type,omitempty"`

	//An object holding important values such as hostnames, passwords, and SSH keys.
	//Creating a storage with a template is required either sshkey or password.
	//Optional
	Template *StorageTemplate `json:"template,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

StorageCreateRequest JSON struct of a request for creating a storage

type StorageList

type StorageList struct {
	//Array of storages
	List map[string]StorageProperties `json:"storages"`
}

StorageList JSON struct of a list of storages

type StorageProperties

type StorageProperties struct {
	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//If a template has been used that requires a license key (e.g. Windows Servers)
	//this shows the product_no of the license (see the /prices endpoint for more details).
	LicenseProductNo int `json:"license_product_no"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Total minutes the object has been running.
	UsageInMinutes int `json:"usage_in_minutes"`

	//Indicates the UUID of the last used template on this storage.
	LastUsedTemplate string `json:"last_used_template"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//The capacity of a storage/ISO-Image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//(one of storage, storage_high, storage_insane).
	StorageType string `json:"storage_type"`

	//The UUID of the Storage used to create this Snapshot.
	ParentUUID string `json:"parent_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Snapshots list in this storage.
	Snapshots []StorageSnapshotRelation `json:"snapshots"`

	//The information about other object which are related to this storage.
	//The object could be servers and/or snapshot schedules.
	Relations StorageRelations `json:"relations"`

	//List of labels.
	Labels []string `json:"labels"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`
}

StorageProperties JSON struct of properties of a storage

type StorageRelations

type StorageRelations struct {
	//Array of related servers
	Servers []StorageServerRelation `json:"servers"`

	//Array if related snapshot schedules
	SnapshotSchedules []StorageAndSnapshotScheduleRelation `json:"snapshot_schedules"`
}

StorageRelations JSON struct of a list of a storage's relations

type StorageRollbackRequest

type StorageRollbackRequest struct {
	//Rollback=true => storage will be restored
	Rollback bool `json:"rollback,omitempty"`
}

StorageRollbackRequest JSON struct of a request for rolling back

type StorageServerRelation

type StorageServerRelation struct {
	//Whether the server boots from this iso image or not.
	Bootdevice bool `json:"bootdevice"`

	//Defines the SCSI target ID. The SCSI defines transmission routes like Serial Attached SCSI (SAS),
	//Fibre Channel and iSCSI. The target ID is a device (e.g. disk).
	Target int `json:"target"`

	//Defines the SCSI controller id. The SCSI defines transmission routes such as Serial Attached SCSI (SAS), Fibre Channel and iSCSI.
	Controller int `json:"controller"`

	//The SCSI bus id. The SCSI defines transmission routes like Serial Attached SCSI (SAS), Fibre Channel and iSCSI.
	//Each SCSI device is addressed via a specific number. Each SCSI bus can have multiple SCSI devices connected to it.
	Bus int `json:"bus"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Is the common SCSI abbreviation of the Logical Unit Number. A lun is a unique identifier for a single disk or a composite of disks.
	Lun int `json:"lun"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

StorageServerRelation JSON struct of a relation between a storage and a server

type StorageSnapshot

type StorageSnapshot struct {
	//Properties of a snapshot
	Properties StorageSnapshotProperties `json:"snapshot"`
}

StorageSnapshot is JSON structure of a single storage snapshot

type StorageSnapshotCreateRequest

type StorageSnapshotCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Optional
	Name string `json:"name,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

StorageSnapshotCreateRequest JSON struct of a request for creating a storage snapshot

type StorageSnapshotCreateResponse

type StorageSnapshotCreateResponse struct {
	//UUID of the request
	RequestUUID string `json:"request_uuid"`

	//UUID of the snapshot being created
	ObjectUUID string `json:"object_uuid"`
}

StorageSnapshotCreateResponse JSON struct of a response for creating a storage snapshot

type StorageSnapshotExportToS3Request

type StorageSnapshotExportToS3Request struct {
	//S3 authentication data
	S3auth `json:"s3auth"`

	//S3 info about snapshot being uploaded
	S3data `json:"s3data"`
}

StorageSnapshotExportToS3Request JSON struct of a request for exporting a storage snapshot to S3

type StorageSnapshotList

type StorageSnapshotList struct {
	//Array of snapshots
	List map[string]StorageSnapshotProperties `json:"snapshots"`
}

StorageSnapshotList is JSON structure of a list of storage snapshots

type StorageSnapshotProperties

type StorageSnapshotProperties struct {
	//List of labels.
	Labels []string `json:"labels"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//Total minutes the object has been running.
	UsageInMinutes int `json:"usage_in_minutes"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//If a template has been used that requires a license key (e.g. Windows Servers)
	//this shows the product_no of the license (see the /prices endpoint for more details).
	LicenseProductNo int `json:"license_product_no"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The capacity of a storage/ISO-Image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//Uses IATA airport code, which works as a location identifier.
	LocationIata string `json:"location_iata"`

	//Uuid of the storage used to create this snapshot
	ParentUUID string `json:"parent_uuid"`
}

StorageSnapshotProperties JSON struct of properties of a storage snapshot

type StorageSnapshotRelation

type StorageSnapshotRelation struct {
	//Indicates the UUID of the last used template on this storage.
	LastUsedTemplate string `json:"last_used_template"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//The UUID of an object is always unique, and refers to a specific object.
	StorageUUID string `json:"storage_uuid"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	SchedulesSnapshotName string `json:"schedules_snapshot_name"`

	//The UUID of an object is always unique, and refers to a specific object.
	SchedulesSnapshotUUID string `json:"schedules_snapshot_uuid"`

	//Capacity of the snapshot (in GB)
	ObjectCapacity int `json:"object_capacity"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

StorageSnapshotRelation JSON struct of a relation between a storage and a snapshot

type StorageSnapshotSchedule

type StorageSnapshotSchedule struct {
	//Properties of a storage snapshot schedule
	Properties StorageSnapshotScheduleProperties `json:"snapshot_schedule"`
}

StorageSnapshotSchedule JSON struct of a single storage snapshot scheduler

type StorageSnapshotScheduleCreateRequest

type StorageSnapshotScheduleCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`

	//The interval at which the schedule will run (in minutes)
	//Allowed value >= 60
	RunInterval int `json:"run_interval"`

	//The amount of Snapshots to keep before overwriting the last created Snapshot.
	//Allowed value >= 1
	KeepSnapshots int `json:"keep_snapshots"`

	//The date and time that the snapshot schedule will be run. Optional.
	NextRuntime *GSTime `json:"next_runtime,omitempty"`
}

StorageSnapshotScheduleCreateRequest JSON struct of a request for creating a storage snapshot schedule

type StorageSnapshotScheduleCreateResponse

type StorageSnapshotScheduleCreateResponse struct {
	//UUID of the request
	RequestUUID string `json:"request_uuid"`

	//UUID of the snapshot schedule being created
	ObjectUUID string `json:"object_uuid"`
}

StorageSnapshotScheduleCreateResponse JSON struct of a response for creating a storage snapshot schedule

type StorageSnapshotScheduleList

type StorageSnapshotScheduleList struct {
	//Array of storage snapshot schedules
	List map[string]StorageSnapshotScheduleProperties `json:"snapshot_schedules"`
}

StorageSnapshotScheduleList JSON of a list of storage snapshot schedules

type StorageSnapshotScheduleProperties

type StorageSnapshotScheduleProperties struct {
	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The amount of Snapshots to keep before overwriting the last created Snapshot.
	//value >= 1
	KeepSnapshots int `json:"keep_snapshots"`

	//List of labels.
	Labels []string `json:"labels"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The date and time that the snapshot schedule will be run.
	NextRuntime GSTime `json:"next_runtime"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//Related snapshots (snapshots taken by this snapshot schedule)
	Relations StorageSnapshotScheduleRelations `json:"relations"`

	//The interval at which the schedule will run (in minutes)
	//value >= 60
	RunInterval int `json:"run_interval"`

	//Status indicates the status of the object.
	Status string `json:"status"`

	//UUID of the storage that will be used for taking snapshots
	StorageUUID string `json:"storage_uuid"`
}

StorageSnapshotScheduleProperties JSON struct of properties of a single storage snapshot schedule

type StorageSnapshotScheduleRelation

type StorageSnapshotScheduleRelation struct {
	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`
}

StorageSnapshotScheduleRelation JSON struct of a relation of a storage snapshot schedule

type StorageSnapshotScheduleRelations

type StorageSnapshotScheduleRelations struct {
	//Array of all related snapshots (snapshots taken by this snapshot schedule)
	Snapshots []StorageSnapshotScheduleRelation `json:"snapshots"`
}

StorageSnapshotScheduleRelations JSON struct of a list of relations of a storage snapshot schedule

type StorageSnapshotScheduleUpdateRequest

type StorageSnapshotScheduleUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Optional.
	Name string `json:"name,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`

	//The interval at which the schedule will run (in minutes). Optional.
	//Allowed value >= 60
	RunInterval int `json:"run_interval,omitempty"`

	//The amount of Snapshots to keep before overwriting the last created Snapshot. Optional.
	//Allowed value >= 1
	KeepSnapshots int `json:"keep_snapshots,omitempty"`

	//The date and time that the snapshot schedule will be run. Optional.
	NextRuntime *GSTime `json:"next_runtime,omitempty"`
}

StorageSnapshotScheduleUpdateRequest JSON struct of a request for updating a storage snapshot schedule

type StorageSnapshotUpdateRequest

type StorageSnapshotUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Optional
	Name string `json:"name,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

StorageSnapshotUpdateRequest JSON struct of a request for updating a storage snapshot

type StorageTemplate

type StorageTemplate struct {
	//List of SSH Keys uuid. Optional
	Sshkeys []string `json:"sshkeys,omitempty"`

	//The UUID of a template (public or private).
	TemplateUUID string `json:"template_uuid"`

	//The root (Linux) or Administrator (Windows) password to set for the installed storage. Valid only for public templates.
	//The password has to be either plaintext or a crypt string (modular crypt format - MCF). Optional.
	Password string `json:"password,omitempty"`

	//Password type. Allowed values: nil, PlainPasswordType, CryptPasswordType. Optional.
	PasswordType *passwordType `json:"password_type,omitempty"`

	//Hostname to set for the installed storage. The running server will use this as its hostname.
	//Valid only for public Linux and Windows templates. Optional.
	Hostname string `json:"hostname,omitempty"`
}

StorageTemplate JSON struct of a storage template

type StorageUpdateRequest

type StorageUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters. Optional.
	Name string `json:"name,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`

	//The Capacity of the Storage in GB. Optional.
	Capacity int `json:"capacity,omitempty"`
}

StorageUpdateRequest JSON struct of a request for updating a storage

type Template

type Template struct {
	//Properties of a template
	Properties TemplateProperties `json:"template"`
}

Template JSON struct of a single template

type TemplateCreateRequest

type TemplateCreateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//snapshot uuid for template
	SnapshotUUID string `json:"snapshot_uuid"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

TemplateCreateRequest JSON struct of a request for creating a template

type TemplateList

type TemplateList struct {
	//Array of templates
	List map[string]TemplateProperties `json:"templates"`
}

TemplateList JSON struct of a list of templates

type TemplateProperties

type TemplateProperties struct {
	//Status indicates the status of the object.
	Status string `json:"status"`

	//Status indicates the status of the object.
	Ostype string `json:"ostype"`

	//Helps to identify which datacenter an object belongs to.
	LocationUUID string `json:"location_uuid"`

	//Description of the Template.
	Version string `json:"version"`

	//Description of the Template.
	LocationIata string `json:"location_iata"`

	//Defines the date and time of the last object change.
	ChangeTime GSTime `json:"change_time"`

	//the object is private, the value will be true. Otherwise the value will be false.
	Private bool `json:"private"`

	//The UUID of an object is always unique, and refers to a specific object.
	ObjectUUID string `json:"object_uuid"`

	//If a template has been used that requires a license key (e.g. Windows Servers)
	//this shows the product_no of the license (see the /prices endpoint for more details).
	LicenseProductNo int `json:"license_product_no"`

	//Defines the date and time the object was initially created.
	CreateTime GSTime `json:"create_time"`

	//Total minutes the object has been running.
	UsageInMinutes int `json:"usage_in_minutes"`

	//The capacity of a storage/ISO-Image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

	//The OS distrobution that the Template contains.
	Distro string `json:"distro"`

	//Description of the Template.
	Description string `json:"description"`

	//The price for the current period since the last bill.
	CurrentPrice float64 `json:"current_price"`

	//The human-readable name of the location. It supports the full UTF-8 charset, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	Name string `json:"name"`

	//List of labels.
	Labels []string `json:"labels"`
}

TemplateProperties JSOn struct of properties of a template

type TemplateUpdateRequest

type TemplateUpdateRequest struct {
	//The human-readable name of the object. It supports the full UTF-8 charset, with a maximum of 64 characters.
	//Optional.
	Name string `json:"name,omitempty"`

	//List of labels. Optional.
	Labels []string `json:"labels,omitempty"`
}

TemplateUpdateRequest JSON struct of a request for updating a template

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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