gsclient

package module
v3.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 18 Imported by: 6

README

gridscale Go Client Library

GitHub tag (latest SemVer) PkgGoDev gsclient-go status

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.

Prerequisites

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/v3

Using the 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/v3"

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
            500, //Delay (in milliseconds) between requests (or retry 503 error code)
            100, //Maximum number of retries when server returns 503 error code
        )
client := gsclient.NewClient(config)

To trace the duration of individual client calls, set logger to Trace level via gsclient.SetLogLevel() function. Other log levels: https://github.com/sirupsen/logrus#level-logging

gsclient.SetLogLevel(logrus.TraceLevel)

Trace message looks like following:

TRAC[2021-03-12T10:32:43+01:00] Successful method="github.com/gridscale/gsclient-go/v3.(*Client).GetServer" requestUUID=035fc625-199d-41da-93c4-f32502d101c1 timeMs=350

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. In case you want to set timeout for a specific operation, you can pass a context with timeout (via context.WithTimeout or context.WithDeadline)

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:

ctx := 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 IP that would be IPCreateRequest and IPUpdateRequest. Here an example:

ctx := context.Background()
requestBody := gsclient.IPCreateRequest{
    Name:       "IPTest",
    Family:     gsclient.IPv6Type,
    Failover:   false,
    ReverseDNS: "my-reverse-dns-entry.tld",
    Labels:     []string{"MyLabel"},
}

client.CreateIP(ctx, requestBody)

For updating/scaling server resources you could use:

myServerUuid := "[Server UUID]"
backgroundContext := context.Background()

// No hotplug available for scaling resources down, shutdown server first via ACPI
shutdownErr := client.ShutdownServer(backgroundContext, myServerUuid)
if shutdownErr != nil{
    log.Error("Shutdown server failed", shutdownErr)
    return
}

// Update servers resources
requestBody := gsclient.ServerUpdateRequest{
    Memory:          12,
    Cores:           4,
}

updateErr := client.UpdateServer(backgroundContext, myServerUuid, requestBody)
if updateErr != nil{
    log.Error("Serverupdate failed", updateErr)
    return
}

// Start server again
poweronErr := client.StartServer(backgroundContext, myServerUuid)
if poweronErr != nil{
    log.Error("Start server failed", poweronErr)
    return
}

What options are available for each create and update request can be found in the source code. After installing it should be located in $GOPATH/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) NOTE: ShutdownServer() will not run StopServer() when it fails to shutdown a server
    • 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 Create From A Backup (CreateStorageFromBackup)
    • Storage Clone (CloneStorage)
    • 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
  • Load balancers
    • 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)
  • Storage Backup
    • Storage Backups Get (GetStorageBackupList)
    • Storage Backup Delete (DeleteStorageBackup)
    • Storage Backup Rollback (RollbackStorageBackup)
  • Storage Backup Schedule
    • Storage Backup Schedules Get (GetStorageBackupScheduleList)
    • Storage Backup Schedule Get (GetStorageBackupSchedule)
    • Storage Backup Schedule Create (CreateStorageBackupSchedule)
    • Storage Backup Schedule Update (UpdateStorageBackupSchedule)
    • Storage Backup Schedule Delete (DeleteStorageBackupSchedule)
  • Firewall
    • Firewalls Get (GetFirewallList)
    • Firewall Get (GetFirewall)
    • Firewall Create (CreateFirewall)
    • Firewall Update (UpdateFirewall)
    • Firewall Delete (DeleteFirewall)
    • Firewall Events Get (GetFirewallEventList)
  • Marketplace Application
    • Marketplace Applications Get (GetMarketplaceApplicationList)
    • Marketplace Application Get (GetMarketplaceApplication)
    • Marketplace Application Create (CreateMarketplaceApplication)
    • Marketplace Application Import (ImportMarketplaceApplication)
    • Marketplace Application Update (UpdateMarketplaceApplication)
    • Marketplace Application Delete (DeleteMarketplaceApplication)
    • Marketplace Application Events Get (GetMarketplaceApplicationEventList)
  • Event
    • Events Get (GetEventList)
  • Label
    • Labels Get (GetLabelList)
  • 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)
  • SSL certificate
    • SSL certificates Get (GetSSLCertificateList)
    • SSL certificate Get (GetSSLCertificate)
    • SSL certificate Create (CreateSSLCertificate)
    • SSL certificate Delete (DeleteSSLCertificate)

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

Documentation

Overview

Package gsclient is a Go client library for talking to the gridscale API.

Index

Constants

View Source
const (
	HourIntervalVariable  = "H"
	DayIntervalVariable   = "D"
	WeekIntervalVariable  = "W"
	MonthIntervalVariable = "M"
)

All allowed interval variable's values

View Source
const (
	// ProjectLevelUsage is used to query resources' usage in project level.
	ProjectLevelUsage usageQueryLevel = iota

	// ContractLevelUsage is used to query resources' usage in contract level.
	ContractLevelUsage = iota
)

Variables

This section is empty.

Functions

func SetLogLevel added in v3.5.0

func SetLogLevel(level logrus.Level)

SetLogLevel manually sets log level. Read more: https://github.com/sirupsen/logrus#level-logging

Types

type AutoscalingProperties added in v3.6.0

type AutoscalingProperties struct {
	// Limit values of CPU core autoscaling.
	Cores AutoscalingResourceProperties `json:"cores"`

	// Limit values of storage autoscaling.
	Storage AutoscalingResourceProperties `json:"storage"`
}

AutoscalingProperties holds properties of resource autoscalings.

type AutoscalingResourceProperties added in v3.6.0

type AutoscalingResourceProperties struct {
	// Min value of a resource autoscaling.
	Min int `json:"min"`

	// Max value of a resource autoscaling.
	Max int `json:"max"`
}

AutoscalingResourceProperties holds properties (Min/Max values) of a resource autoscaling.

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"`

	// Proxy protocol version
	ProxyProtocol *string `json:"proxy_protocol,omitempty"`
}

BackendServer holds properties telling how a load balancer deals with a 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) AdvancedCreateObjectStorageAccessKey added in v3.12.1

func (c *Client) AdvancedCreateObjectStorageAccessKey(ctx context.Context, body ObjectStorageAccessKeyCreateRequest) (ObjectStorageAccessKeyCreateResponse, error)

AdvancedCreateObjectStorageAccessKey creates an object storage access key with user_uuid and/or comment.

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

func (*Client) CloneStorage

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

CloneStorage clones a specific storage.

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

func (*Client) CreateFirewall

func (c *Client) CreateFirewall(ctx context.Context, body FirewallCreateRequest) (FirewallCreateResponse, error)

CreateFirewall creates a new firewall.

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

func (*Client) CreateIP

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

CreateIP creates an IP address.

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

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

func (*Client) CreateLoadBalancer

CreateLoadBalancer creates a new load balancer.

Note: A load balancer's algorithm can only be either `LoadbalancerRoundrobinAlg` or `LoadbalancerLeastConnAlg`.

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

func (*Client) CreateLocation added in v3.8.0

func (c *Client) CreateLocation(ctx context.Context, body LocationCreateRequest) (CreateResponse, error)

CreateLocation creates a new location.

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

func (*Client) CreateMarketplaceApplication added in v3.2.0

CreateMarketplaceApplication creates a new marketplace application. Allowed values for Category are `nil`, `MarketplaceApplicationCMSCategory`, `MarketplaceApplicationProjectManagementCategory`, `MarketplaceApplicationAdminpanelCategory`, `MarketplaceApplicationCollaborationCategory`, `MarketplaceApplicationCloudStorageCategory`, `MarketplaceApplicationArchivingCategory`.

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

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) CreateSSLCertificate added in v3.6.0

func (c *Client) CreateSSLCertificate(ctx context.Context, body SSLCertificateCreateRequest) (CreateResponse, error)

CreateSSLCertificate creates a new SSL certificate.

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

func (*Client) CreateServer

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

CreateServer creates a new server in a project. Normally you want to use `Q35ServerHardware` as hardware profile.

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 creates a link between a server and an IP address.

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 creates a link between a server and a storage.

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

func (*Client) CreateSshkey

func (c *Client) CreateSshkey(ctx context.Context, body SshkeyCreateRequest) (CreateResponse, error)

CreateSshkey creates a new SSH key.

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

func (*Client) CreateStorage

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

CreateStorage creates a new storage in the project.

Possible values for StorageType are nil, HighStorageType, and InsaneStorageType.

Allowed values for PasswordType are nil, PlainPasswordType, CryptPasswordType.

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

func (*Client) CreateStorageBackupSchedule added in v3.2.0

CreateStorageBackupSchedule creates a storage backup schedule based on a given storage UUID.

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

func (*Client) CreateStorageFromBackup added in v3.3.0

func (c *Client) CreateStorageFromBackup(ctx context.Context, backupID, storageName string) (CreateResponse, error)

CreateStorageFromBackup creates a new storage from a specific backup.

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

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 creates a storage snapshot schedule.

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 new OS 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 removes 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 removes a specific IP address 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 removes a specific ISO image.

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

func (*Client) DeleteLoadBalancer

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

DeleteLoadBalancer removes a load balancer.

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

func (*Client) DeleteLocation added in v3.8.0

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

DeleteLocation removes a single Location.

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

func (*Client) DeleteMarketplaceApplication added in v3.2.0

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

DeleteMarketplaceApplication removes a marketplace application.

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

func (*Client) DeleteNetwork

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

DeleteNetwork removed a specific network based on given id.

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

func (*Client) DeleteNetworkPinnedServer added in v3.8.0

func (c *Client) DeleteNetworkPinnedServer(ctx context.Context, networkUUID, serverUUID string) error

DeleteNetworkPinnedServer removes DHCP IP from a server.

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

func (*Client) DeleteObjectStorageAccessKey

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

DeleteObjectStorageAccessKey removed 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 removes 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 removes a PaaS service.

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

func (*Client) DeleteSSLCertificate added in v3.6.0

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

DeleteSSLCertificate removes a single SSL certificate.

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

func (*Client) DeleteServer

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

DeleteServer removes 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 removes 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 removes 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 removes 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 removes 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 removes a single 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 removes a storage.

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

func (*Client) DeleteStorageBackup added in v3.2.0

func (c *Client) DeleteStorageBackup(ctx context.Context, storageID, backupID string) error

DeleteStorageBackup removes a specific storage's backup.

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

func (*Client) DeleteStorageBackupSchedule added in v3.2.0

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

DeleteStorageBackupSchedule removes a specific storage backup scheduler based on a given storage's id and a backup schedule's id.

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

func (*Client) DeleteStorageSnapshot

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

DeleteStorageSnapshot removes 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 removes 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/deleteSnapshotSchedule

func (*Client) DeleteTemplate

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

DeleteTemplate removes a single OS 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 exports a storage's snapshot to S3.

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

func (*Client) GetDeletedIPs

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

GetDeletedIPs gets a list of deleted IP adresses.

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

func (*Client) GetDeletedISOImages

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

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

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

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

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

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

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) GetDistributedStoragesUsage added in v3.8.0

func (c *Client) GetDistributedStoragesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (DistributedStoragesUsage, error)

GetDistributedStoragesUsage returns usage of all distributed storages in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetEventList

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) GetGeneralUsage added in v3.8.0

func (c *Client) GetGeneralUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (GeneralUsage, error)

GetGeneralUsage returns general usage of all resources in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

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 address'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 IP addresses.

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 address's version, returns 0 if an error was encountered.

func (*Client) GetIPsByLocation

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

GetIPsByLocation gets a list of IP adresses by location.

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

func (*Client) GetIPsUsage added in v3.8.0

func (c *Client) GetIPsUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (IPsUsage, error)

GetIPsUsage returns usage of all IP addresses' usage in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

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

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) GetISOImagesUsage added in v3.8.0

func (c *Client) GetISOImagesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (ISOImagesUsage, error)

GetISOImagesUsage returns usage of all ISO images in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetLabelList

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 load balancer 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 a load balancer's events based on a given load balancer 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 load balancers.

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

func (*Client) GetLoadBalancersUsage added in v3.8.0

func (c *Client) GetLoadBalancersUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (LoadBalancersUsage, error)

GetLoadBalancersUsage returns usage of all Load Balancers' usage in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

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) GetMarketplaceApplication added in v3.2.0

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

GetMarketplaceApplication gets a marketplace application.

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

func (*Client) GetMarketplaceApplicationEventList added in v3.2.0

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

GetMarketplaceApplicationEventList gets list of a marketplace application's events.

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

func (*Client) GetMarketplaceApplicationList added in v3.2.0

func (c *Client) GetMarketplaceApplicationList(ctx context.Context) ([]MarketplaceApplication, error)

GetMarketplaceApplicationList gets a list of available marketplace applications.

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

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 the public network.

func (*Client) GetNetworksByLocation

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 gets 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 gets 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 available 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) GetPaaSServicesUsage added in v3.8.0

func (c *Client) GetPaaSServicesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (PaaSServicesUsage, error)

GetPaaSServicesUsage returns usage of all PaaS services' usage in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

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) GetPinnedServerList added in v3.8.0

func (c *Client) GetPinnedServerList(ctx context.Context, networkUUID string) (PinnedServerList, error)

GetPinnedServerList returns a list of pinned servers in a specific network.

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

func (*Client) GetRocketStoragesUsage added in v3.8.0

func (c *Client) GetRocketStoragesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (RocketStoragesUsage, error)

GetRocketStoragesUsage returns usage of all servers in project/contract level. Args:

  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Optional, can be nil): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetSSLCertificate added in v3.6.0

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

GetSSLCertificate gets a single SSL certificate.

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

func (*Client) GetSSLCertificateList added in v3.6.0

func (c *Client) GetSSLCertificateList(ctx context.Context) ([]SSLCertificate, error)

GetSSLCertificateList gets the list of available SSL certificates in the project.

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

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 address 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 IP addresses.

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

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) GetServersUsage added in v3.8.0

func (c *Client) GetServersUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (ServersUsage, error)

GetServersUsage returns usage of all servers in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetSnapshotsByLocation

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) GetSnapshotsUsage added in v3.8.0

func (c *Client) GetSnapshotsUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (SnapshotsUsage, error)

GetSnapshotsUsage returns usage of all snapshots in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetSshkey

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

GetSshkey gets a single SSH key object.

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 the list of SSH keys in the project.

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 gets a storage.

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

func (*Client) GetStorageBackupList added in v3.2.0

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

GetStorageBackupList gets a list of available storage backups.

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

func (*Client) GetStorageBackupLocationList added in v3.8.0

func (c *Client) GetStorageBackupLocationList(ctx context.Context) ([]StorageBackupLocation, error)

GetStorageBackupLocationList returns a list of available locations to store your backup.

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

func (*Client) GetStorageBackupSchedule added in v3.2.0

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

GetStorageBackupSchedule returns a specific storage backup schedule based on a given storage's id and a backup schedule's id.

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

func (*Client) GetStorageBackupScheduleList added in v3.2.0

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

GetStorageBackupScheduleList returns a list of available storage backup schedules based on a given storage's id.

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

func (*Client) GetStorageBackupsUsage added in v3.8.0

func (c *Client) GetStorageBackupsUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (StorageBackupsUsage, error)

GetStorageBackupsUsage returns usage of all storage backups in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) GetStorageEventList

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

GetStorageEventList gets 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 schedule based on a given storage's id and schedule'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

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 an OS template object by a given ID.

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 retrieves a single template by its name. Use GetTemplate to retrieve a single template by it's ID.

func (*Client) GetTemplateEventList

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

GetTemplateEventList gets the list of events that are associated with the given template.

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 OS templates.

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

func (*Client) GetTemplatesByLocation

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) GetTemplatesUsage added in v3.8.0

func (c *Client) GetTemplatesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (TemplatesUsage, error)

GetTemplatesUsage returns usage of all templates in project/contract level. Args:

  • queryLevel (Required): resources' usage query level. Either ProjectLevelUsage or ContractLevelUsage.
  • fromTime (Required): Starting time when the usage should be calculated.
  • toTime (Optional, can be nil): End time when the usage should be calculated.
  • withoutDeleted (Required, true/false): To calculate the usage with or without deleted resources.
  • intervalVariable (Optional, can be empty ""): HourIntervalVariable, DayIntervalVariable, WeekIntervalVariable, MonthIntervalVariable, or "".

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

func (*Client) HttpClient

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

HttpClient returns http client.

func (*Client) ImportMarketplaceApplication added in v3.2.0

ImportMarketplaceApplication imports a marketplace application. Allowed values for Category are `nil`, `MarketplaceApplicationCMSCategory`, `MarketplaceApplicationProjectManagementCategory`, `MarketplaceApplicationAdminpanelCategory`, `MarketplaceApplicationCollaborationCategory`, `MarketplaceApplicationCloudStorageCategory`, `MarketplaceApplicationArchivingCategory`.

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

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 address 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) MaxNumberOfRetries

func (c *Client) MaxNumberOfRetries() int

MaxNumberOfRetries returns max number of retries.

func (*Client) PutUpdateNetwork added in v3.14.0

func (c *Client) PutUpdateNetwork(ctx context.Context, id string, body NetworkUpdatePutRequest) error

PutUpdateNetwork updates a specific network based on given id. This method uses PUT mechanism, which means all fields must be provided, even if they are not changed. If you want to update only some fields, use UpdateNetwork method instead.

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

func (*Client) RenewK8sCredentials added in v3.0.1

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

RenewK8sCredentials renews credentials for gridscale Kubernetes PaaS service templates. The credentials of a PaaS service will be renewed (if supported by service template).

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

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) RollbackStorageBackup added in v3.2.0

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

RollbackStorageBackup rollbacks a storage from a storage backup.

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

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 detaches an IP address from a server.

func (*Client) UnlinkIsoImage

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

UnlinkIsoImage detaches an ISO image from a server.

func (*Client) UnlinkNetwork

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

UnlinkNetwork detaches a network from a server.

func (*Client) UnlinkStorage

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

UnlinkStorage detaches 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 address 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 load balancer.

Note: A load balancer's algorithm can only be either `LoadbalancerRoundrobinAlg` or `LoadbalancerLeastConnAlg`.

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

func (*Client) UpdateLocation added in v3.8.0

func (c *Client) UpdateLocation(ctx context.Context, id string, body LocationUpdateRequest) error

UpdateLocation updates a specific location based on given id.

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

func (*Client) UpdateMarketplaceApplication added in v3.2.0

func (c *Client) UpdateMarketplaceApplication(ctx context.Context, id string, body MarketplaceApplicationUpdateRequest) error

UpdateMarketplaceApplication updates a marketplace application.

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

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) UpdateNetworkPinnedServer added in v3.8.0

func (c *Client) UpdateNetworkPinnedServer(ctx context.Context, networkUUID, serverUUID string, body PinServerRequest) error

UpdateNetworkPinnedServer assigns DHCP IP to a server.

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

func (*Client) UpdateObjectStorageAccessKey added in v3.12.1

func (c *Client) UpdateObjectStorageAccessKey(ctx context.Context, id string, body ObjectStorageAccessKeyUpdateRequest) error

UpdateObjectStorageAccessKey updates a specific object storage access key based on given id.

See: https://my.gridscale.io/APIDoc#tag/object-storage/operation/updateAccessKey

func (*Client) UpdatePaaSSecurityZone

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

UpdatePaaSSecurityZone updates 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 updates a storage.

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

func (*Client) UpdateStorageBackupSchedule added in v3.2.0

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

UpdateStorageBackupSchedule updates a specific storage backup schedule based on a given storage's id and a backup schedule's id.

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

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 snapshot schedule based on a given storage's id and schedule'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 an existing OS template's properties.

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.

func (*Client) WithHTTPHeaders added in v3.1.0

func (c *Client) WithHTTPHeaders(headers map[string]string)

WithHTTPHeaders adds custom HTTP headers to Client.

type Config

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

Config holds 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,
	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`.
  • delayIntervalMilliSecs int: delay (in milliseconds) between requests when checking request (or retry 503 error code).
  • maxNumberOfRetries int: number of retries when server returns 503 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 represents a common response for creation.

type CreateStorageFromBackupProperties added in v3.3.0

type CreateStorageFromBackupProperties struct {
	Name       string `json:"name"`
	BackupUUID string `json:"backup_uuid"`
}

CreateStorageFromBackupProperties holds properties of CreateStorageFromBackupRequest.

type CreateStorageFromBackupRequest added in v3.3.0

type CreateStorageFromBackupRequest struct {
	RequestProperties CreateStorageFromBackupProperties `json:"backup"`
}

CreateStorageFromBackupRequest represents a request to create a new storage from a backup.

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"`

	// If the PaaS service is a k8s cluster, this field will be set.
	KubeConfig string `json:"kubeconfig"`

	// Expiration time of k8s credential.
	ExpirationTime GSTime `json:"expiration_time"`
}

Credential represents credential used to access a PaaS service.

type DeletedIPList

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

DeletedIPList holds a list of deleted IP addresses.

type DeletedISOImageList

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

DeletedISOImageList holds a list of deleted ISO images.

type DeletedNetworkList

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

DeletedNetworkList holds a list of deleted networks.

type DeletedPaaSServices

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

DeletedPaaSServices provides a list of deleted PaaS services.

type DeletedServerList

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

DeletedServerList holds a list of deleted servers.

type DeletedStorageList

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

DeletedStorageList holds a list of storages.

type DeletedStorageSnapshotList

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

DeletedStorageSnapshotList holds a list of deleted storage snapshots.

type DeletedTemplateList

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

DeletedTemplateList Holds a list of deleted templates.

type DistributedStoragesUsage added in v3.8.0

type DistributedStoragesUsage struct {
	ResourcesUsage []StorageUsageProperties `json:"distributed_storages"`
}

DistributedStoragesUsage represents usage of distributed storages.

type Event

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

Event represent a single event.

type EventList

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

EventList holds a list of events.

type EventOperator added in v3.2.0

type EventOperator interface {
	GetEventList(ctx context.Context) ([]Event, error)
}

EventOperator provides an interface for operations on events.

type EventProperties

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"`

	// The user that triggered the event.
	// Usually the user's email if the event was triggered by request of a user,
	// otherwise a short descriptive name of the system component responsible.
	Initiator string `json:"initiator"`
}

EventProperties holds the properties of an event.

type FingerprintProperties added in v3.6.0

type FingerprintProperties struct {
	// A unique identifier generated from the MD5 fingerprint of the certificate.
	MD5 string `json:"md5"`

	// A unique identifier generated from the SHA1 fingerprint of the certificate.
	SHA1 string `json:"sha1"`

	// A unique identifier generated from the SHA256 fingerprint of the certificate.
	SHA256 string `json:"sha256"`
}

FingerprintProperties holds properties of a list unique identifiers generated from the MD5, SHA-1, and SHA-256 fingerprints of the certificate.

type Firewall

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

Firewall represents 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 represents a request for creating a new 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 represents a response for creating a firewall.

type FirewallList

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

FirewallList holds a list of firewalls.

type FirewallOperator added in v3.2.0

type FirewallOperator interface {
	GetFirewallList(ctx context.Context) ([]Firewall, error)
	GetFirewall(ctx context.Context, id string) (Firewall, error)
	CreateFirewall(ctx context.Context, body FirewallCreateRequest) (FirewallCreateResponse, error)
	UpdateFirewall(ctx context.Context, id string, body FirewallUpdateRequest) error
	DeleteFirewall(ctx context.Context, id string) error
	GetFirewallEventList(ctx context.Context, id string) ([]Event, error)
}

FirewallOperator provides an interface for operations on 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 character set, with a maximum of 64 characters.
	LocationName string `json:"location_name"`

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

FirewallProperties holds the properties of a firewall. Firewall's UUID can be used to attach a firewall to servers.

type FirewallRelation

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

FirewallRelation holds a list of firewall-network-server relations.

type FirewallRuleProperties

type FirewallRuleProperties struct {
	// Enum:"udp" "tcp". Allowed values: `TCPTransport`, `UDPTransport`.
	Protocol TransportLayerProtocol `json:"protocol"`

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

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

	// A Number between 1 and 65535, port ranges are separated 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 represents properties of a firewall rule.

type FirewallRules

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

	// Firewall template rules 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 rules for outbound traffic - covers IPv4 addresses.
	RulesV4Out []FirewallRuleProperties `json:"rules-v4-out,omitempty"`
}

FirewallRules represents 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 represent a request for updating a firewall.

type ForwardingRule

type ForwardingRule struct {
	// A valid domain name that points to the loadbalancer's IP address.
	LetsencryptSSL *string `json:"letsencrypt_ssl"`

	// The UUID of a custom certificate.
	CertificateUUID string `json:"certificate_uuid,omitempty"`

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

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

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

ForwardingRule represents a forwarding rule. It tells which port are forwarded to which port.

type GSTime

type GSTime struct {
	time.Time
}

GSTime is the custom time type of gridscale.

func (GSTime) MarshalJSON

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

MarshalJSON is the custom marshaller for GSTime.

func (GSTime) String added in v3.8.0

func (t GSTime) String() string

String returns string representation of GSTime.

func (*GSTime) UnmarshalJSON

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

UnmarshalJSON is the custom unmarshaller for GSTime.

type GeneralUsage added in v3.8.0

type GeneralUsage struct {
	ResourcesUsage GeneralUsageProperties `json:"products"`
}

GeneralUsage represents general usage.

type GeneralUsageProperties added in v3.8.0

type GeneralUsageProperties struct {
	Servers             ResourceUsageInfo `json:"servers"`
	RocketStorages      ResourceUsageInfo `json:"rocket_storages"`
	DistributedStorages ResourceUsageInfo `json:"distributed_storages"`
	StorageBackups      ResourceUsageInfo `json:"storage_backups"`
	Snapshots           ResourceUsageInfo `json:"snapshots"`
	Templates           ResourceUsageInfo `json:"templates"`
	IsoImages           ResourceUsageInfo `json:"iso_images"`
	IPAddresses         ResourceUsageInfo `json:"ip_addresses"`
	LoadBalancers       ResourceUsageInfo `json:"load_balancers"`
	PaaSServices        ResourceUsageInfo `json:"paas_services"`
}

GeneralUsageProperties holds GeneralUsage's properties.

type IP

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

IP represent a single IP address.

type IPAddressType added in v3.2.0

type IPAddressType int

IPAddressType represents IP address family

const (
	IPv4Type IPAddressType = 4
	IPv6Type IPAddressType = 6
)

Allowed IP address versions.

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"`

	// 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 represent 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 represents a response for creating an IP.

type IPList

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

IPList holds a list of IP addresses.

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 character set, with a maximum of 64 characters.
	LoadbalancerName string `json:"loadbalancer_name"`

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

IPLoadbalancer represents relation between an IP address and a Load Balancer.

type IPOperator added in v3.2.0

type IPOperator interface {
	GetIP(ctx context.Context, id string) (IP, error)
	GetIPList(ctx context.Context) ([]IP, error)
	CreateIP(ctx context.Context, body IPCreateRequest) (IPCreateResponse, error)
	DeleteIP(ctx context.Context, id string) error
	UpdateIP(ctx context.Context, id string, body IPUpdateRequest) error
	GetIPEventList(ctx context.Context, id string) ([]Event, error)
	GetIPVersion(ctx context.Context, id string) int
	GetIPsByLocation(ctx context.Context, id string) ([]IP, error)
	GetDeletedIPs(ctx context.Context) ([]IP, error)
}

IPOperator provides an interface for operations on IP addresses.

type IPProperties

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

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

	// Helps to identify which data center 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 character set, 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"`

	// **DEPRECATED** 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 load balancer.
	Relations IPRelations `json:"relations"`
}

IPProperties holds properties of an IP address. An IP address can be retrieved and attached to a server via the IP address's UUID.

type IPRelations

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

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

IPRelations holds list of an IP address's relations. Relations between an IP address, Load Balancers, and servers.

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 character set, with a maximum of 64 characters.
	ServerName string `json:"server_name"`

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

IPServer represents relation between an IP address 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 represent a request for updating an IP.

type IPUsageProperties added in v3.8.0

type IPUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

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

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

	// 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"`

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

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

	// The human-readable name of the location. It supports the full UTF-8 character set, 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"`

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

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

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

	// 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"`

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

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

	// Uuid of the partner used to create this IP address.
	PartnerUUID string `json:"partner_uuid"`

	// Uuid of the project used to create this IP address.
	ProjectUUID string `json:"project_uuid"`

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

IPUsageProperties holds properties of an IP address usage.

type IPsUsage added in v3.8.0

type IPsUsage struct {
	ResourcesUsage []IPUsageProperties `json:"ip_addresses"`
}

IPsUsage represents usage of IP addresses.

type ISOImage

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

ISOImage represent a single ISO image.

type ISOImageCreateRequest

type ISOImageCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`
}

ISOImageCreateRequest represents 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 represents a response for creating an ISO image.

type ISOImageList

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

ISOImageList hold a list of ISO images.

type ISOImageOperator added in v3.2.0

type ISOImageOperator interface {
	GetISOImageList(ctx context.Context) ([]ISOImage, error)
	GetISOImage(ctx context.Context, id string) (ISOImage, error)
	CreateISOImage(ctx context.Context, body ISOImageCreateRequest) (ISOImageCreateResponse, error)
	UpdateISOImage(ctx context.Context, id string, body ISOImageUpdateRequest) error
	DeleteISOImage(ctx context.Context, id string) error
	GetISOImageEventList(ctx context.Context, id string) ([]Event, error)
	GetISOImagesByLocation(ctx context.Context, id string) ([]ISOImage, error)
	GetDeletedISOImages(ctx context.Context) ([]ISOImage, error)
}

ISOImageOperator provides an interface for operations on 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 ISO image.
	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 character set, 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 data center 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 character set, 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 character set, 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"`

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

ISOImageProperties holds properties of an ISO image. an ISO image can be retrieved and attached to servers via ISO image's UUID.

type ISOImageRelation

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

ISOImageRelation represents a list of ISO image-server 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 represents a request for updating an ISO image.

type ISOImageUsageProperties added in v3.8.0

type ISOImageUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

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

	// 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"`

	// 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"`

	// Upstream version of the ISO image release.
	Version string `json:"version"`

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

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

	// Uuid of the project used to create this ISO image.
	ProjectUUID string `json:"project_uuid"`

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

ISOImageUsageProperties holds properties of an ISO Image usage.

type ISOImagesUsage added in v3.8.0

type ISOImagesUsage struct {
	ResourcesUsage []ISOImageUsageProperties `json:"iso_images"`
}

ISOImagesUsage represents usage of ISO images.

type Label

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

Label represents a single label.

type LabelCreateRequest

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

LabelCreateRequest represents a request for creating a label.

type LabelList

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

LabelList holds a list of labels.

type LabelOperator added in v3.2.0

type LabelOperator interface {
	GetLabelList(ctx context.Context) ([]Label, error)
}

LabelOperator provides an interface for operations on labels.

type LabelProperties

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 holds properties of a label.

type LoadBalancer

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

LoadBalancer represent a single load balancer.

type LoadBalancerCreateRequest

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

	// The human-readable name of the object. It supports the full UTF-8 character set, with a maximum of 64 characters.
	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"`

	// 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 load balancer
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

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

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

	// 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 represents a request for creating a load balancer.

type LoadBalancerCreateResponse

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

	// UUID of the load balancer being created.
	ObjectUUID string `json:"object_uuid"`
}

LoadBalancerCreateResponse represents a response for creating a load balancer.

type LoadBalancerOperator added in v3.2.0

type LoadBalancerOperator interface {
	GetLoadBalancerList(ctx context.Context) ([]LoadBalancer, error)
	GetLoadBalancer(ctx context.Context, id string) (LoadBalancer, error)
	CreateLoadBalancer(ctx context.Context, body LoadBalancerCreateRequest) (LoadBalancerCreateResponse, error)
	UpdateLoadBalancer(ctx context.Context, id string, body LoadBalancerUpdateRequest) error
	DeleteLoadBalancer(ctx context.Context, id string) error
	GetLoadBalancerEventList(ctx context.Context, id string) ([]Event, error)
}

LoadBalancerOperator provides an interface for operations on load balancers.

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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// Forwarding rules of a load balancer.
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

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

	// Helps to identify which data center 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"`

	// **DEPRECATED** 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 character set, 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 character set, 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 holds properties of a load balancer.

type LoadBalancerUpdateRequest

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

	// The human-readable name of the object. It supports the full UTF-8 character set, 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 load balancer.
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

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

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

	// 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 represents a request for updating a load balancer.

type LoadBalancerUsageProperties added in v3.8.0

type LoadBalancerUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// Forwarding rules of a load balancer.
	ForwardingRules []ForwardingRule `json:"forwarding_rules"`

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

	// 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"`

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

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

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

	// 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"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

LoadBalancerUsageProperties holds properties of a loadbalancer usage.

type LoadBalancers

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

LoadBalancers holds a list of load balancers.

type LoadBalancersUsage added in v3.8.0

type LoadBalancersUsage struct {
	ResourcesUsage []LoadBalancerUsageProperties `json:"load_balancers"`
}

LoadBalancersUsage represents usage of storage backups.

type LoadbalancerAlgorithm added in v3.2.0

type LoadbalancerAlgorithm string

LoadbalancerAlgorithm represents the algorithm that a load balancer uses to balance the incoming requests.

var (
	LoadbalancerRoundrobinAlg LoadbalancerAlgorithm = "roundrobin"
	LoadbalancerLeastConnAlg  LoadbalancerAlgorithm = "leastconn"
)

All available load balancer algorithms.

type Location

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

Location represent a single location.

type LocationCreateRequest added in v3.8.0

type LocationCreateRequest 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.
	Labels []string `json:"labels,omitempty"`

	// The location_uuid of an existing public location in which to create the private location.
	ParentLocationUUID string `json:"parent_location_uuid"`

	// The number of dedicated cpunodes to assigne to the private location.
	CPUNodeCount int `json:"cpunode_count"`

	// The product number of a valid and available dedicated cpunode article.
	ProductNo int `json:"product_no"`
}

LocationCreateRequest represent a payload of a request for creating a new location.

type LocationFeatures added in v3.8.0

type LocationFeatures struct {
	// List of available hardware profiles.
	HardwareProfiles string `json:"hardware_profiles"`

	// TRUE if the location has rocket storage feature.
	HasRocketStorage string `json:"has_rocket_storage"`

	// TRUE if the location has permission to provision server.
	HasServerProvisioning string `json:"has_server_provisioning"`

	// Region of object storage.
	ObjectStorageRegion string `json:"object_storage_region"`

	// Backup location UUID.
	BackupCenterLocationUUID string `json:"backup_center_location_uuid"`
}

LocationFeatures represent a location's list of features.

type LocationInformation added in v3.8.0

type LocationInformation struct {
	// List of certifications.
	CertificationList string `json:"certification_list"`

	// City of the locations.
	City string `json:"city"`

	// Data protection agreement.
	DataProtectionAgreement string `json:"data_protection_agreement"`

	// Geo Location.
	GeoLocation string `json:"geo_location"`

	// Green energy.
	GreenEnergy string `json:"green_energy"`

	// List of operator certificate.
	OperatorCertificationList string `json:"operator_certification_list"`

	// Owner of the location.
	Owner string `json:"owner"`

	// Website of the owner.
	OwnerWebsite string `json:"owner_website"`

	// The name of site.
	SiteName string `json:"site_name"`
}

LocationInformation represents a location's detail information.

type LocationList

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

LocationList holds a list of locations.

type LocationOperator added in v3.2.0

type LocationOperator interface {
	GetLocationList(ctx context.Context) ([]Location, error)
	GetLocation(ctx context.Context, id string) (Location, error)
	CreateLocation(ctx context.Context, body LocationCreateRequest) (CreateResponse, error)
	UpdateLocation(ctx context.Context, id string, body LocationUpdateRequest) error
	DeleteLocation(ctx context.Context, id string) error
}

LocationOperator provides an interface for operations on 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. DEPRECATED
	Status string `json:"status"`

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

	// The human-readable name of the location. It supports the full UTF-8 character set, 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 character set, with a maximum of 64 characters.
	Country string `json:"country"`

	// True if the location is active.
	Active bool `json:"active"`

	// Request change.
	ChangeRequested LocationRequestedChange `json:"change_requested"`

	// The number of dedicated cpunodes to assign to the private location.
	CPUNodeCount int `json:"cpunode_count"`

	// If this location is publicly available or a private location.
	Public bool `json:"public"`

	// The product number of a valid and available dedicated cpunode article.
	ProductNo int `json:"product_no"`

	// More detail about the location.
	LocationInformation LocationInformation `json:"location_information"`

	// Feature information of the location.
	Features LocationFeatures `json:"features"`
}

LocationProperties holds properties of a location.

type LocationRequestedChange added in v3.8.0

type LocationRequestedChange struct {
	// The requested number of dedicated cpunodes.
	CPUNodeCount int `json:"cpunode_count"`

	// The product number of a valid and available dedicated cpunode article.
	ProductNo int `json:"product_no"`

	// The location_uuid of an existing public location in which to create the private location.
	ParentLocationUUID string `json:"parent_location_uuid"`
}

LocationRequestedChange represents a location's requested change.

type LocationUpdateRequest added in v3.8.0

type LocationUpdateRequest struct {
	// Name is the human-readable name of the object. Name is an optional field.
	Name string `json:"name,omitempty"`

	// List of labels. Labels is an optional field.
	Labels *[]string `json:"labels,omitempty"`

	// The number of dedicated cpunodes to assigne to the private location.
	// CPUNodeCount is an optional field.
	CPUNodeCount *int `json:"cpunode_count,omitempty"`
}

LocationUpdateRequest represents a request for updating a location.

type Machinetype added in v3.11.0

type Machinetype string
const (
	I440fxMachineType  Machinetype = "i440fx"
	Q35BiosMachineType Machinetype = "q35_bios"
	Q35Uefi            Machinetype = "q35_uefi"
)

All available machinetypes.

type MarketplaceApplication added in v3.2.0

type MarketplaceApplication struct {
	// Properties of a market application.
	Properties MarketplaceApplicationProperties `json:"application"`
}

MarketplaceApplication represent a single market application.

type MarketplaceApplicationCategory added in v3.2.0

type MarketplaceApplicationCategory string

MarketplaceApplicationCategory represents the category in which a market application is.

var (
	MarketplaceApplicationCMSCategory               MarketplaceApplicationCategory = "CMS"
	MarketplaceApplicationProjectManagementCategory MarketplaceApplicationCategory = "project management"
	MarketplaceApplicationAdminpanelCategory        MarketplaceApplicationCategory = "Adminpanel"
	MarketplaceApplicationCollaborationCategory     MarketplaceApplicationCategory = "Collaboration"
	MarketplaceApplicationCloudStorageCategory      MarketplaceApplicationCategory = "Cloud Storage"
	MarketplaceApplicationArchivingCategory         MarketplaceApplicationCategory = "Archiving"
)

All allowed Marketplace application category's values.

type MarketplaceApplicationCreateRequest added in v3.2.0

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

	// Path to the images for the application, must be in .gz format and started with "s3//"".
	ObjectStoragePath string `json:"object_storage_path"`

	// Category of the marketplace application. Allowed values: not-set, MarketplaceApplicationCMSCategory, MarketplaceApplicationProjectManagementCategory, MarketplaceApplicationAdminpanelCategory,
	// MarketplaceApplicationCollaborationCategory, MarketplaceApplicationCloudStorageCategory, MarketplaceApplicationArchivingCategory. Optional.
	Category MarketplaceApplicationCategory `json:"category,omitempty"`

	// whether you want to publish your application or not. Optional.
	Publish *bool `json:"publish,omitempty"`

	// Application's setup, consist the number of resource for creating the application.
	Setup MarketplaceApplicationSetup `json:"setup"`

	// Metadata of application.
	Metadata *MarketplaceApplicationMetadata `json:"metadata,omitempty"`
}

MarketplaceApplicationCreateRequest represents a request for creating a marketplace application.

type MarketplaceApplicationCreateResponse added in v3.2.0

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

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

	// Unique hash for importing this marketplace application.
	UniqueHash string `json:"unique_hash"`
}

MarketplaceApplicationCreateResponse represents a response for a marketplace application's creation.

type MarketplaceApplicationImportRequest added in v3.2.0

type MarketplaceApplicationImportRequest struct {
	// Unique hash for importing this marketplace application.
	UniqueHash string `json:"unique_hash"`
}

MarketplaceApplicationImportRequest represents a request for importing a marketplace application.

type MarketplaceApplicationList added in v3.2.0

type MarketplaceApplicationList struct {
	// Array of market applications.
	List map[string]MarketplaceApplicationProperties `json:"applications"`
}

MarketplaceApplicationList holds a list of market applications.

type MarketplaceApplicationMetadata added in v3.2.0

type MarketplaceApplicationMetadata struct {
	License    string   `json:"license"`
	OS         string   `json:"os"`
	Components []string `json:"components"`
	Overview   string   `json:"overview"`
	Hints      string   `json:"hints"`
	Icon       string   `json:"icon"`
	Features   string   `json:"features"`
	TermsOfUse string   `json:"terms_of_use"`
	Author     string   `json:"author"`
	Advices    string   `json:"advices"`
}

MarketplaceApplicationMetadata holds metadata of a marketplace application.

type MarketplaceApplicationOperator added in v3.2.0

type MarketplaceApplicationOperator interface {
	GetMarketplaceApplicationList(ctx context.Context) ([]MarketplaceApplication, error)
	GetMarketplaceApplication(ctx context.Context, id string) (MarketplaceApplication, error)
	CreateMarketplaceApplication(ctx context.Context, body MarketplaceApplicationCreateRequest) (MarketplaceApplicationCreateResponse, error)
	ImportMarketplaceApplication(ctx context.Context, body MarketplaceApplicationImportRequest) (MarketplaceApplicationCreateResponse, error)
	UpdateMarketplaceApplication(ctx context.Context, id string, body MarketplaceApplicationUpdateRequest) error
	DeleteMarketplaceApplication(ctx context.Context, id string) error
	GetMarketplaceApplicationEventList(ctx context.Context, id string) ([]Event, error)
}

MarketplaceApplicationOperator aprovides an interface for operations on marketplace applications.

type MarketplaceApplicationProperties added in v3.2.0

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

	// Unique hash to allow user to import the self-created marketplace application.
	UniqueHash string `json:"unique_hash"`

	// Path to the images of the application.
	ObjectStoragePath string `json:"object_storage_path"`

	// Whether the you are the owner of application or not.
	IsApplicationOwner bool `json:"application_owner"`

	// Setup of the application.
	Setup MarketplaceApplicationSetup `json:"setup"`

	// Whether the template is published by the partner to their tenant.
	Published bool `json:"published"`

	// The date when the template is published into other tenant in the same partner.
	PublishedDate GSTime `json:"published_date"`

	// Whether the tenants want their template to be published or not.
	PublishRequested bool `json:"publish_requested"`

	// The date when the tenant requested their template to be published.
	PublishRequestedDate GSTime `json:"publish_requested_date"`

	// Whether a partner wants their tenant template published to other partners.
	PublishGlobalRequested bool `json:"publish_global_requested"`

	// The date when a partner requested their tenants template to be published.
	PublishGlobalRequestedDate GSTime `json:"publish_global_requested_date"`

	// Whether a template is published to other partner or not.
	PublishedGlobal bool `json:"published_global"`

	// The date when a template is published to other partner.
	PublishedGlobalDate GSTime `json:"published_global_date"`

	// Enum:"CMS", "project management", "Adminpanel", "Collaboration", "Cloud Storage", "Archiving".
	// Category of marketplace application.
	Category string `json:"category"`

	// Metadata of the Application.
	Metadata MarketplaceApplicationMetadata `json:"metadata"`

	// 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 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"`

	// The type of template.
	ApplicationType string `json:"application_type"`
}

MarketplaceApplicationProperties holds properties of a market application.

type MarketplaceApplicationSetup added in v3.2.0

type MarketplaceApplicationSetup struct {
	// Number of server cores.
	Cores int `json:"cores"`

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

	// The capacity of a storage in GB.
	Capacity int `json:"capacity"`
}

MarketplaceApplicationSetup represents marketplace application's setup.

type MarketplaceApplicationUpdateRequest added in v3.2.0

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

	// Path to the images for the application, must be in .gz format and started with s3// . Optional.
	ObjectStoragePath string `json:"object_storage_path,omitempty"`

	// Category of the marketplace application. Allowed values: not-set, MarketplaceApplicationCMSCategory, MarketplaceApplicationProjectManagementCategory, MarketplaceApplicationAdminpanelCategory,
	// MarketplaceApplicationCollaborationCategory, MarketplaceApplicationCloudStorageCategory, MarketplaceApplicationArchivingCategory. Optional.
	Category MarketplaceApplicationCategory `json:"category,omitempty"`

	// Whether you want to publish your application or not. Optional.
	Publish *bool `json:"publish,omitempty"`

	// Application's setup, consist the number of resource for creating the application.
	Setup *MarketplaceApplicationSetup `json:"setup,omitempty"`

	// Metadata of application.
	Metadata *MarketplaceApplicationMetadata `json:"metadata,omitempty"`
}

MarketplaceApplicationUpdateRequest represents a request for updating a marketplace application.

type Network

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

Network represents a single network.

type NetworkCreateRequest

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

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

	// 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"`

	// Defines the information if dhcp is activated for this network or not.
	DHCPActive bool `json:"dhcp_active,omitempty"`

	// The general IP Range configured for this network (/24 for private networks).
	DHCPRange string `json:"dhcp_range,omitempty"`

	// The ip reserved and communicated by the dhcp service to be the default gateway.
	DHCPGateway string `json:"dhcp_gateway,omitempty"`

	DHCPDNS string `json:"dhcp_dns,omitempty"`

	// Subrange within the ip range.
	DHCPReservedSubnet []string `json:"dhcp_reserved_subnet,omitempty"`
}

NetworkCreateRequest represents 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 represents 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 character set, 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 character set, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

NetworkInFirewall represents properties of a firewall-network-server relation. A firewall-network-server relation tells which server uses the queried firewall and in which network that the firewall is enabled.

type NetworkList

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

NetworkList holds a list of available networks.

type NetworkModel added in v3.11.0

type NetworkModel string
const (
	E1000NetworkModel   NetworkModel = "e1000"
	E1000ENetworkModel  NetworkModel = "e1000e"
	VirtIONetworkModel  NetworkModel = "virtio"
	VmxNet3NetworkModel NetworkModel = "vmxnet3"
)

All available network models.

type NetworkOperator added in v3.2.0

type NetworkOperator interface {
	GetNetwork(ctx context.Context, id string) (Network, error)
	GetNetworkList(ctx context.Context) ([]Network, error)
	CreateNetwork(ctx context.Context, body NetworkCreateRequest) (NetworkCreateResponse, error)
	DeleteNetwork(ctx context.Context, id string) error
	UpdateNetwork(ctx context.Context, id string, body NetworkUpdateRequest) error
	GetNetworkEventList(ctx context.Context, id string) ([]Event, error)
	GetNetworkPublic(ctx context.Context) (Network, error)
	GetNetworksByLocation(ctx context.Context, id string) ([]Network, error)
	GetDeletedNetworks(ctx context.Context) ([]Network, error)
	GetPinnedServerList(ctx context.Context, networkUUID string) (PinnedServerList, error)
	UpdateNetworkPinnedServer(ctx context.Context, networkUUID, serverUUID string, body PinServerRequest) error
	DeleteNetworkPinnedServer(ctx context.Context, networkUUID, serverUUID string) error
}

NetworkOperator provides an interface for operations on 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 character set, 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"`
}

NetworkPaaSSecurityZone represents a relation between a network and a PaaS security zone.

type NetworkPaaSService added in v3.9.0

type NetworkPaaSService struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// Category of the PaaS service.
	ServiceTemplateCategory string `json:"service_template_category"`

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

	// Contains the IPv6/IPv4 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"`
}

NetworkPaaSService represents a relation between a network and a Network.

type NetworkProperties

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

	// Helps to identify which data center 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 character set, 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 information if dhcp is activated for this network or not.
	DHCPActive bool `json:"dhcp_active"`

	// The general IP Range configured for this network (/24 for private networks).
	DHCPRange string `json:"dhcp_range"`

	// The ip reserved and communicated by the dhcp service to be the default gateway.
	DHCPGateway string `json:"dhcp_gateway"`

	DHCPDNS string `json:"dhcp_dns"`

	// Subrange within the ip range.
	DHCPReservedSubnet []string `json:"dhcp_reserved_subnet"`

	// Contains ips of all servers in the network which got a designated IP by the DHCP server.
	AutoAssignedServers []ServerWithIP `json:"auto_assigned_servers"`

	// Contains ips of all servers in the network which got a designated IP by the user.
	PinnedServers []ServerWithIP `json:"pinned_servers"`

	// 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 character set, 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 holds properties of a network. A network can be retrieved and attached to servers via the network UUID.

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"`

	// Array of PaaS services that are connected to this network.
	PaaSServices []NetworkPaaSService `json:"paas_services"`
}

NetworkRelations holds a list of a network's relations. The relation tells which VLANs/Servers/PaaS security zones relate to the network.

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 character set, 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 represents a relation between a network and a server.

type NetworkUpdatePutRequest added in v3.14.0

type NetworkUpdatePutRequest struct {
	// New name.
	Name string `json:"name"`

	// L2Security.
	L2Security bool `json:"l2security"`

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

	// Defines the information if dhcp is activated for this network or not.
	DHCPActive *bool `json:"dhcp_active"`

	// The general IP Range configured for this network (/24 for private networks).
	DHCPRange *string `json:"dhcp_range"`

	// The ip reserved and communicated by the dhcp service to be the default gateway.
	DHCPGateway *string `json:"dhcp_gateway"`

	DHCPDNS *string `json:"dhcp_dns"`

	// Subrange within the ip range.
	DHCPReservedSubnet *[]string `json:"dhcp_reserved_subnet"`
}

NetworkUpdatePutRequest represents a PUT request for updating a network.

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"`

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

	// Defines the information if dhcp is activated for this network or not.
	DHCPActive *bool `json:"dhcp_active,omitempty"`

	// The general IP Range configured for this network (/24 for private networks).
	DHCPRange *string `json:"dhcp_range,omitempty"`

	// The ip reserved and communicated by the dhcp service to be the default gateway.
	DHCPGateway *string `json:"dhcp_gateway,omitempty"`

	DHCPDNS *string `json:"dhcp_dns,omitempty"`

	// Subrange within the ip range.
	DHCPReservedSubnet *[]string `json:"dhcp_reserved_subnet,omitempty"`
}

NetworkUpdateRequest represents 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 represents 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 represents a single object storage access key.

type ObjectStorageAccessKeyCreateRequest added in v3.12.1

type ObjectStorageAccessKeyCreateRequest struct {
	// Comment for the access_key.
	Comment string `json:"comment,omitempty"`

	// If a user_uuid is sent along with the request, a user-specific key will get created.
	// If no user_uuid is sent along a user with write-access to the contract will still
	// only create a user-specific key for themselves while a user with admin-access to
	// the contract will create a contract-level admin key.
	UserUUID string `json:"user_uuid,omitempty"`
}

ObjectStorageAccessKeyCreateRequest represents a request for creating an 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 represents 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 holds 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"`

	// Comment for the access_key.
	Comment string `json:"comment"`

	// User UUID.
	UserUUID string `json:"user_uuid"`
}

ObjectStorageAccessKeyProperties holds properties of an object storage access key.

type ObjectStorageAccessKeyUpdateRequest added in v3.12.1

type ObjectStorageAccessKeyUpdateRequest struct {
	// Comment for the access_key.
	Comment *string `json:"comment,omitempty"`
}

ObjectStorageAccessKeyUpdateRequest represents a request for updating an object storage access key.

type ObjectStorageBucket

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

ObjectStorageBucket represents a single bucket.

type ObjectStorageBucketList

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

ObjectStorageBucketList holds a list of buckets.

type ObjectStorageBucketProperties

type ObjectStorageBucketProperties struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 holds properties of a bucket.

type ObjectStorageOperator added in v3.2.0

type ObjectStorageOperator interface {
	GetObjectStorageAccessKeyList(ctx context.Context) ([]ObjectStorageAccessKey, error)
	GetObjectStorageAccessKey(ctx context.Context, id string) (ObjectStorageAccessKey, error)
	CreateObjectStorageAccessKey(ctx context.Context) (ObjectStorageAccessKeyCreateResponse, error)
	AdvancedCreateObjectStorageAccessKey(ctx context.Context, body ObjectStorageAccessKeyCreateRequest) (ObjectStorageAccessKeyCreateResponse, error)
	UpdateObjectStorageAccessKey(ctx context.Context, id string, body ObjectStorageAccessKeyUpdateRequest) error
	DeleteObjectStorageAccessKey(ctx context.Context, id string) error
	GetObjectStorageBucketList(ctx context.Context) ([]ObjectStorageBucket, error)
}

ObjectStorageOperator provides an interface for operations on object storages.

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 holds properties of a PaaS service metric.

type PaaSMetricValue

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

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

PaaSMetricValue represents a PaaS metric value.

type PaaSOperator added in v3.2.0

type PaaSOperator interface {
	GetPaaSServiceList(ctx context.Context) ([]PaaSService, error)
	GetPaaSService(ctx context.Context, id string) (PaaSService, error)
	CreatePaaSService(ctx context.Context, body PaaSServiceCreateRequest) (PaaSServiceCreateResponse, error)
	UpdatePaaSService(ctx context.Context, id string, body PaaSServiceUpdateRequest) error
	DeletePaaSService(ctx context.Context, id string) error
	GetPaaSServiceMetrics(ctx context.Context, id string) ([]PaaSServiceMetric, error)
	GetPaaSTemplateList(ctx context.Context) ([]PaaSTemplate, error)
	GetDeletedPaaSServices(ctx context.Context) ([]PaaSService, error)
	RenewK8sCredentials(ctx context.Context, id string) error
	GetPaaSSecurityZoneList(ctx context.Context) ([]PaaSSecurityZone, error)
	GetPaaSSecurityZone(ctx context.Context, id string) (PaaSSecurityZone, error)
	CreatePaaSSecurityZone(ctx context.Context, body PaaSSecurityZoneCreateRequest) (PaaSSecurityZoneCreateResponse, error)
	UpdatePaaSSecurityZone(ctx context.Context, id string, body PaaSSecurityZoneUpdateRequest) error
	DeletePaaSSecurityZone(ctx context.Context, id string) error
}

PaaSOperator provides an interface for operations on PaaS-service-related resource.

type PaaSRelationService

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

PaaSRelationService represents a relation between a PaaS security zone and PaaS services.

type PaaSSecurityZone

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

PaaSSecurityZone represents a single PaaS security zone.

type PaaSSecurityZoneCreateRequest

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

PaaSSecurityZoneCreateRequest represents 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 represents 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 character set, 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 character set, 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 data center 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// object (PaaSRelationService).
	Relation PaaSRelationService `json:"relations"`
}

PaaSSecurityZoneProperties holds properties of a PaaS security zone. PaaS security zone can be retrieved and attached to PaaS services via security zone UUID, or attached to servers via the security zone's network UUID. To get the security zone's network UUID, check out methods `GetNetwork` and `GetNetworkList`, and retrieve the network relations.

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"`

	// 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 represents 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 holds a list of PaaS security zones.

type PaaSService

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

PaaSService represents a single PaaS service.

type PaaSServiceCreateRequest

type PaaSServiceCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 list of labels.
	Labels []string `json:"labels,omitempty"`

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

	// The UUID of the network that the service is attached to.
	NetworkUUID string `json:"network_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 represents 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 represents 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 represents a single metric of a PaaS service.

type PaaSServiceMetrics

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

PaaSServiceMetrics represents a list of metrics of a PaaS service.

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/IPv4 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 attached to.
	SecurityZoneUUID string `json:"security_zone_uuid"`

	// The UUID of the network that the service is attached to.
	NetworkUUID string `json:"network_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"`

	// The template category used to create the service.
	ServiceTemplateCategory string `json:"service_template_category"`

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

	// **DEPRECATED** 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 character set, 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 holds properties of a single PaaS service.

type PaaSServiceUpdateRequest

type PaaSServiceUpdateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// The template that you want to use in the service, you can find an available list at the /service_templates endpoint.
	PaaSServiceTemplateUUID string `json:"service_template_uuid,omitempty"`

	// The UUID of the network that the service is attached to.
	NetworkUUID string `json:"network_uuid,omitempty"`
}

PaaSServiceUpdateRequest represetns a request for updating a PaaS service.

type PaaSServiceUsageProperties added in v3.8.0

type PaaSServiceUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

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

	// 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"`

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

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

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

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

	// Uuid of the project used to create this PaaS.
	ProjectUUID string `json:"project_uuid"`

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

PaaSServiceUsageProperties holds properties of a PaaS service usage.

type PaaSServices

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

PaaSServices holds a list of available PaaS services.

type PaaSServicesUsage added in v3.8.0

type PaaSServicesUsage struct {
	ResourcesUsage []PaaSServiceUsageProperties `json:"paas_services"`
}

PaaSServicesUsage represents usage of PaaS services.

type PaaSTemplate

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

PaaSTemplate represents a single PaaS Template.

type PaaSTemplateProperties

type PaaSTemplateProperties struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// Discounted product number related to the service template.
	DiscountProductNo int `json:"discount_product_no"`

	// Time period (seconds) for which the discounted product number is valid.
	DiscountPeriod int64 `json:"discount_period"`

	// 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"`

	// Describes the flavour of the service. E.g. kubernetes, redis-store, postgres, etc.
	Flavour string `json:"flavour"`

	// Describes the version of the service.
	Version string `json:"version"`

	// Describes the release of the service.
	Release string `json:"release"`

	// Describes the performance class of the service.
	PerformanceClass string `json:"performance_class"`

	// List of service template uuids to which a performance class update is allowed.
	PerformanceClassUpdates []string `json:"performance_class_updates"`

	// List of service template uuids to which an upgrade is allowed.
	VersionUpgrades []string `json:"version_upgrades"`

	// List of service template uuids to which a patch update is allowed.
	PatchUpdates []string `json:"patch_updates"`

	// Values of the autoscaling resources.
	Autoscaling AutoscalingProperties `json:"autoscaling"`
}

PaaSTemplateProperties holds properties of a PaaS template. A PaaS template can be retrieved and used to create a new PaaS service via the PaaS template UUID.

type PaaSTemplates

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

PaaSTemplates holds 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"`

	// Immutable.
	Immutable bool `json:"immutable"`
}

Parameter represents a parameter used in PaaS template. Each type of PaaS service has diffrent set of parameters. Use method `GetPaaSTemplateList` to get infomation about parameters of a PaaS template.

type PasswordType added in v3.2.0

type PasswordType string

PasswordType denotes the representation of a password.

const (
	PlainPasswordType PasswordType = "plain"
	CryptPasswordType PasswordType = "crypt"
)

All allowed password type's values.

type PinServerRequest added in v3.8.0

type PinServerRequest struct {
	// IP which is assigned to the server
	IP string `json:"ip"`
}

PinServerRequest represents a request assigning DHCP IP to a server

type PinnedServerList added in v3.8.0

type PinnedServerList struct {
	// List of server and it's assigned DHCP IP
	List []ServerWithIP `json:"pinned_servers"`
}

PinnedServerList hold a list of pinned server with corresponding DCHP IP.

type RequestError

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

RequestError represents an 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 represents status of a request.

type RequestStatusProperties

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

RequestStatusProperties holds 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"`

	// Storage type (one of storage, storage_high, storage_insane).
	StorageType string `json:"storage_type"`
}

Resource represents the amount of concurrent connections for the service.

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 represents a resource limit. It is used to limit a specific computational resource in a PaaS service. e.g. it can be used to limit cpu count.

type ResourceUsageInfo added in v3.8.0

type ResourceUsageInfo struct {
	CurrentUsagePerMinute []Usage            `json:"current_usage_per_minute"`
	UsagePerInterval      []UsagePerInterval `json:"usage_per_interval"`
}

ResourceUsageInfo represents usage of a specific resource (e.g. server, storage, etc.).

type RocketStoragesUsage added in v3.8.0

type RocketStoragesUsage struct {
	ResourcesUsage []StorageUsageProperties `json:"rocket_storages"`
}

RocketStoragesUsage represents usage of rocket storages.

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 represents S3 authentication data, which used in `StorageSnapshotExportToS3Request`.

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 represents info about snapshot being uploaded, which used in `StorageSnapshotExportToS3Request`.

type SSHKeyOperator added in v3.2.0

type SSHKeyOperator interface {
	GetSshkey(ctx context.Context, id string) (Sshkey, error)
	GetSshkeyList(ctx context.Context) ([]Sshkey, error)
	CreateSshkey(ctx context.Context, body SshkeyCreateRequest) (CreateResponse, error)
	DeleteSshkey(ctx context.Context, id string) error
	UpdateSshkey(ctx context.Context, id string, body SshkeyUpdateRequest) error
	GetSshkeyEventList(ctx context.Context, id string) ([]Event, error)
}

SSHKeyOperator provides an interface for operations on SSH keys.

type SSLCertificate added in v3.6.0

type SSLCertificate struct {
	// Properties of a SSL certificate.
	Properties SSLCertificateProperties `json:"certificate"`
}

SSLCertificate represents a single SSL certificate.

type SSLCertificateCreateRequest added in v3.6.0

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

	// The PEM-formatted private-key of the SSL certificate.
	PrivateKey string `json:"private_key"`

	// The PEM-formatted public SSL of the SSL certificate.
	LeafCertificate string `json:"leaf_certificate"`

	// The PEM-formatted full-chain between the certificate authority and the domain's SSL certificate.
	CertificateChain string `json:"certificate_chain,omitempty"`

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

SSLCertificateCreateRequest represent a payload of a request for creating a SSL certificate.

type SSLCertificateList added in v3.6.0

type SSLCertificateList struct {
	// Array of SSL certificates.
	List map[string]SSLCertificateProperties `json:"certificates"`
}

SSLCertificateList holds a list of SSL certificates.

type SSLCertificateOperator added in v3.6.0

type SSLCertificateOperator interface {
	GetSSLCertificateList(ctx context.Context) ([]SSLCertificate, error)
	GetSSLCertificate(ctx context.Context, id string) (SSLCertificate, error)
	CreateSSLCertificate(ctx context.Context, body SSLCertificateCreateRequest) (CreateResponse, error)
	DeleteSSLCertificate(ctx context.Context, id string) error
}

SSLCertificateOperator provides an interface for operations on SSL certificates.

type SSLCertificateProperties added in v3.6.0

type SSLCertificateProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// The common domain name of the SSL certificate.
	CommonName string `json:"common_name"`

	// 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"`

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

	// Defines the date after which the certificate does not valid.
	NotValidAfter GSTime `json:"not_valid_after"`

	// Defines a list of unique identifiers generated from the MD5, SHA-1, and SHA-256 fingerprints of the certificate.
	Fingerprints FingerprintProperties `json:"fingerprints"`

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

SSLCertificateProperties holds properties of a SSL certificate. A SSL certificate can be retrieved and linked to a loadbalancer.

type Server

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

Server represents a single server.

type ServerCreateRequest

type ServerCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// Specifies the hardware settings for the virtual machine.
	// Allowed values: DefaultServerHardware, NestedServerHardware, LegacyServerHardware, CiscoCSRServerHardware,
	// SophosUTMServerHardware, F5BigipServerHardware, Q35ServerHardware, Q35NestedServerHardware.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfile ServerHardwareProfile `json:"hardware_profile,omitempty"`

	// Specifies the custom hardware settings for the virtual machine.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfileConfig *ServerHardwareProfileConfig `json:"hardware_profile_config,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 is deprecated.
	Relations *ServerCreateRequestRelations `json:"relations,omitempty"`

	// For system configuration on first boot. May contain cloud-config data or shell scripting, encoded as base64 string. Supported tools are cloud-init, Cloudbase-init, and Ignition.
	UserData *string `json:"user_data,omitempty"`
}

ServerCreateRequest represents 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 represents 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 represents 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 represents 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 holds 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 represents 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 represents a response for creating a server.

type ServerHardwareProfile added in v3.2.0

type ServerHardwareProfile string

ServerHardwareProfile represents the type of server.

const (
	DefaultServerHardware   ServerHardwareProfile = "default"
	NestedServerHardware    ServerHardwareProfile = "nested"
	LegacyServerHardware    ServerHardwareProfile = "legacy"
	CiscoCSRServerHardware  ServerHardwareProfile = "cisco_csr"
	SophosUTMServerHardware ServerHardwareProfile = "sophos_utm"
	F5BigipServerHardware   ServerHardwareProfile = "f5_bigip"
	Q35ServerHardware       ServerHardwareProfile = "q35"
)

All available server's hardware types.

type ServerHardwareProfileConfig added in v3.11.0

type ServerHardwareProfileConfig struct {
	Machinetype          Machinetype   `json:"machinetype"`
	StorageDevice        StorageDevice `json:"storage_device"`
	USBController        USBController `json:"usb_controller"`
	NestedVirtualization bool          `json:"nested_virtualization"`
	HyperVExtensions     bool          `json:"hyperv_extensions"`
	NetworkModel         NetworkModel  `json:"network_model"`
	SerialInterface      bool          `json:"serial_interface"`
	ServerRenice         bool          `json:"server_renice"`
}

type ServerIPRelation

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

ServerIPRelation represents a single relation between a server and an 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 represents a request for creating a relation between a server and an IP address.

type ServerIPRelationList

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

ServerIPRelationList holds a list of relations between a server and IP addresses.

type ServerIPRelationOperator added in v3.2.0

type ServerIPRelationOperator interface {
	GetServerIPList(ctx context.Context, id string) ([]ServerIPRelationProperties, error)
	GetServerIP(ctx context.Context, serverID, ipID string) (ServerIPRelationProperties, error)
	CreateServerIP(ctx context.Context, id string, body ServerIPRelationCreateRequest) error
	DeleteServerIP(ctx context.Context, serverID, ipID string) error
	LinkIP(ctx context.Context, serverID string, ipID string) error
	UnlinkIP(ctx context.Context, serverID string, ipID string) error
}

ServerIPRelationOperator provides an interface for operations on Server-IP relations.

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 holds properties of a relation between a server and an IP address.

type ServerIsoImageRelation

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

ServerIsoImageRelation represents 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 represents 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 holds a list of relations between a server and ISO images.

type ServerIsoImageRelationOperator added in v3.2.0

type ServerIsoImageRelationOperator interface {
	GetServerIsoImageList(ctx context.Context, id string) ([]ServerIsoImageRelationProperties, error)
	GetServerIsoImage(ctx context.Context, serverID, isoImageID string) (ServerIsoImageRelationProperties, error)
	CreateServerIsoImage(ctx context.Context, id string, body ServerIsoImageRelationCreateRequest) error
	UpdateServerIsoImage(ctx context.Context, serverID, isoImageID string, body ServerIsoImageRelationUpdateRequest) error
	DeleteServerIsoImage(ctx context.Context, serverID, isoImageID string) error
	LinkIsoImage(ctx context.Context, serverID string, isoimageID string) error
	UnlinkIsoImage(ctx context.Context, serverID string, isoimageID string) error
}

ServerIsoImageRelationOperator provides an interface for operations on server-ISO image relations.

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 character set, 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 holds 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 represents 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 holds a list of servers.

type ServerMetric

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

ServerMetric represents a single metric of a server.

type ServerMetricList

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

ServerMetricList holds 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 holds properties of a server metric.

type ServerNetworkRelation

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

ServerNetworkRelation represents 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 represents 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 holds a list of relations between a server and networks.

type ServerNetworkRelationOperator added in v3.2.0

type ServerNetworkRelationOperator interface {
	GetServerNetworkList(ctx context.Context, id string) ([]ServerNetworkRelationProperties, error)
	GetServerNetwork(ctx context.Context, serverID, networkID string) (ServerNetworkRelationProperties, error)
	CreateServerNetwork(ctx context.Context, id string, body ServerNetworkRelationCreateRequest) error
	UpdateServerNetwork(ctx context.Context, serverID, networkID string, body ServerNetworkRelationUpdateRequest) error
	DeleteServerNetwork(ctx context.Context, serverID, networkID string) error
	LinkNetwork(ctx context.Context, serverID, networkID, firewallTemplate string, bootdevice bool, order int, l3security []string, firewall *FirewallRules) error
	UnlinkNetwork(ctx context.Context, serverID string, networkID string) error
}

ServerNetworkRelationOperator provides an interface for operations on server-network relations.

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 character set, 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 boot device. Storages, Networks and ISO images can have a boot device configured,
	// but only one boot device 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 holds 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 represents a request for updating a relation between a server and a network.

type ServerOperator added in v3.2.0

type ServerOperator interface {
	GetServer(ctx context.Context, id string) (Server, error)
	GetServerList(ctx context.Context) ([]Server, error)
	GetServersByLocation(ctx context.Context, id string) ([]Server, error)
	CreateServer(ctx context.Context, body ServerCreateRequest) (ServerCreateResponse, error)
	UpdateServer(ctx context.Context, id string, body ServerUpdateRequest) error
	DeleteServer(ctx context.Context, id string) error
	StartServer(ctx context.Context, id string) error
	StopServer(ctx context.Context, id string) error
	ShutdownServer(ctx context.Context, id string) error
	IsServerOn(ctx context.Context, id string) (bool, error)
	GetServerMetricList(ctx context.Context, id string) ([]ServerMetric, error)
	GetServerEventList(ctx context.Context, id string) ([]Event, error)
	GetDeletedServers(ctx context.Context) ([]Server, error)
}

ServerOperator provides an interface for operations on servers.

type ServerPowerUpdateRequest

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

ServerPowerUpdateRequest reresents 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 character set, 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.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfile string `json:"hardware_profile"`

	// Specifies the custom hardware settings for the virtual machine.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfileConfig ServerHardwareProfileConfig `json:"hardware_profile_config"`

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

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

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

	// **DEPRECATED** 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, hot-plugging 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"`

	// Information about other objects which are related to this server. Object could be IPs, storages, networks, and ISO images.
	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"`

	// For system configuration on first boot. May contain cloud-config data or shell scripting, encoded as base64 string. Supported tools are cloud-init, Cloudbase-init, and Ignition.
	UserData string `json:"user_data"`
}

ServerProperties holds 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 holds a list of server relations. It shows the relations between a server and ISO images/Networks/IP addresses/Storages.

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 represents 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 holds a list of relations between a server and storages.

type ServerStorageRelationOperator added in v3.2.0

type ServerStorageRelationOperator interface {
	GetServerStorageList(ctx context.Context, id string) ([]ServerStorageRelationProperties, error)
	GetServerStorage(ctx context.Context, serverID, storageID string) (ServerStorageRelationProperties, error)
	CreateServerStorage(ctx context.Context, id string, body ServerStorageRelationCreateRequest) error
	UpdateServerStorage(ctx context.Context, serverID, storageID string, body ServerStorageRelationUpdateRequest) error
	DeleteServerStorage(ctx context.Context, serverID, storageID string) error
	LinkStorage(ctx context.Context, serverID string, storageID string, bootdevice bool) error
	UnlinkStorage(ctx context.Context, serverID string, storageID string) error
}

ServerStorageRelationOperator provides an interface for operations on server-storage relations.

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 character set, 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 boot device. Storages, Networks and ISO images can have a boot device configured,
	// but only one boot device 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 holds 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 represents 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 represents 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 character set, 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"`

	// Specifies the hardware settings for the virtual machine.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfile ServerHardwareProfile `json:"hardware_profile,omitempty"`

	// Specifies the custom hardware settings for the virtual machine.
	// Note: hardware_profile and hardware_profile_config parameters can't be used at the same time.
	HardwareProfileConfig *ServerHardwareProfileConfig `json:"hardware_profile_config,omitempty"`

	// For system configuration on first boot. May contain cloud-config data or shell scripting, encoded as base64 string. Supported tools are cloud-init, Cloudbase-init, and Ignition.
	UserData *string `json:"user_data,omitempty"`
}

ServerUpdateRequest represents a request for updating a server.

type ServerUsageProperties added in v3.8.0

type ServerUsageProperties 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 character set, 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"`

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

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

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

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

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

ServerUsageProperties holds properties of a server usage.

type ServerWithIP added in v3.7.0

type ServerWithIP struct {
	// UUID of the server
	ServerUUID string `json:"server_uuid"`

	// IP which is assigned to the server
	IP string `json:"ip"`
}

ServerWithIP holds a server's UUID and a corresponding IP address

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 character set, 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 represents a relation between an ISO image and a Server.

type ServersUsage added in v3.8.0

type ServersUsage struct {
	ResourcesUsage []ServerUsageProperties `json:"servers"`
}

ServersUsage represents usage of servers.

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 represents the UUID of a PaaS service relating to a PaaS security zone.

type SnapshotUsageProperties added in v3.8.0

type SnapshotUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// Uuid of the storage used to create this snapshot.
	ParentUUID string `json:"parent_uuid"`

	// Name of the storage used to create this snapshot.
	ParentName string `json:"parent_name"`

	// Uuid of the project used to create this snapshot.
	ProjectUUID string `json:"project_uuid"`

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

	// 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 capacity of a storage/ISO image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

SnapshotUsageProperties holds properties of a snapshot usage.

type SnapshotsUsage added in v3.8.0

type SnapshotsUsage struct {
	ResourcesUsage []SnapshotUsageProperties `json:"snapshots"`
}

SnapshotsUsage represents usage of snapshots.

type Sshkey

type Sshkey struct {
	// Properties of a SSH key.
	Properties SshkeyProperties `json:"sshkey"`
}

Sshkey represents a single SSH key.

type SshkeyCreateRequest

type SshkeyCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 represents a request for creating a SSH key.

type SshkeyList

type SshkeyList struct {
	// Array of SSH keys.
	List map[string]SshkeyProperties `json:"sshkeys"`
}

SshkeyList holds a list of SSH keys.

type SshkeyProperties

type SshkeyProperties struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 holds properties of a single SSH key. A SSH key can be retrieved when creating new storages and attaching them to servers.

type SshkeyUpdateRequest

type SshkeyUpdateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 represents a request for updating a SSH key.

type Storage

type Storage struct {
	// Properties of a storage.
	Properties StorageProperties `json:"storage"`
}

Storage represents 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 character set, 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 character set, 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 represents a relation between a storage and a snapshot schedule.

type StorageBackup added in v3.2.0

type StorageBackup struct {
	// Properties of a backup.
	Properties StorageBackupProperties `json:"backup"`
}

StorageBackup represents a single storage backup.

type StorageBackupList added in v3.2.0

type StorageBackupList struct {
	// Array of backups.
	List map[string]StorageBackupProperties `json:"backups"`
}

StorageBackupList holds of a list of storage backups.

type StorageBackupLocation added in v3.8.0

type StorageBackupLocation struct {
	Properties StorageBackupLocationProperties
}

StorageBackupLocation represents a backup location.

type StorageBackupLocationList added in v3.8.0

type StorageBackupLocationList struct {
	List map[string]StorageBackupLocationProperties `json:"backup_locations"`
}

StorageBackupLocationList contains a list of available location to store your backup.

type StorageBackupLocationProperties added in v3.8.0

type StorageBackupLocationProperties struct {
	// UUID of the location.
	ObjectUUID string `json:"object_uuid"`

	// Name of the location.
	Name string `json:"name"`
}

StorageBackupLocationProperties represents a backup location's properties.

type StorageBackupOperator added in v3.2.0

type StorageBackupOperator interface {
	GetStorageBackupList(ctx context.Context, id string) ([]StorageBackup, error)
	DeleteStorageBackup(ctx context.Context, storageID, backupID string) error
	RollbackStorageBackup(ctx context.Context, storageID, backupID string, body StorageRollbackRequest) error
}

StorageBackupOperator provides an interface for operations on storage backups.

type StorageBackupProperties added in v3.2.0

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

	// The name of the backup equals schedule name plus backup UUID.
	Name string `json:"name"`

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

	// The size of a backup in GB.
	Capacity int `json:"capacity"`
}

StorageBackupProperties holds the properties of a single backup.

type StorageBackupSchedule added in v3.2.0

type StorageBackupSchedule struct {
	Properties StorageBackupScheduleProperties `json:"schedule_storage_backup"`
}

StorageBackupSchedule represents a single storage backup schedule.

type StorageBackupScheduleCreateRequest added in v3.2.0

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

	// The interval at which the schedule will run (in minutes).
	// Allowed value >= 60.
	RunInterval int `json:"run_interval"`

	// The amount of backups to keep before overwriting the last created backup.
	// value >= 1.
	KeepBackups int `json:"keep_backups"`

	// The date and time that the storage backup schedule will be run.
	NextRuntime GSTime `json:"next_runtime"`

	// Status of the schedule.
	Active bool `json:"active"`

	// The UUID of the location where your backup is stored.
	BackupLocationUUID string `json:"backup_location_uuid,omitempty"`
}

StorageBackupScheduleCreateRequest represents a request for creating a storage backup schedule.

type StorageBackupScheduleCreateResponse added in v3.2.0

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

	// UUID of the storage backup schedule being created.
	ObjectUUID string `json:"object_uuid"`
}

StorageBackupScheduleCreateResponse represents a response for creating a storage backup schedule.

type StorageBackupScheduleList added in v3.2.0

type StorageBackupScheduleList struct {
	List map[string]StorageBackupScheduleProperties `json:"schedule_storage_backups"`
}

StorageBackupScheduleList contains a list of storage backup schedules.

type StorageBackupScheduleOperator added in v3.2.0

type StorageBackupScheduleOperator interface {
	GetStorageBackupScheduleList(ctx context.Context, id string) ([]StorageBackupSchedule, error)
	GetStorageBackupSchedule(ctx context.Context, storageID, scheduleID string) (StorageBackupSchedule, error)
	CreateStorageBackupSchedule(ctx context.Context, id string, body StorageBackupScheduleCreateRequest)
	UpdateStorageBackupSchedule(ctx context.Context, storageID, scheduleID string, body StorageBackupScheduleUpdateRequest) error
	DeleteStorageBackupSchedule(ctx context.Context, storageID, scheduleID string) error
}

StorageBackupScheduleOperator provides an interface for operations on backup schedules.

type StorageBackupScheduleProperties added in v3.2.0

type StorageBackupScheduleProperties 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 backups to keep before overwriting the last created backup.
	// value >= 1.
	KeepBackups int `json:"keep_backups"`

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

	// The date and time that the storage backup 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 backups (backups taken by this storage backup schedule)
	Relations StorageBackupScheduleRelations `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 making taking backups
	StorageUUID string `json:"storage_uuid"`

	// Status of the schedule.
	Active bool `json:"active"`

	// The UUID of the location where your backup is stored.
	BackupLocationUUID string `json:"backup_location_uuid"`

	// The human-readable name of backup location. It supports the full UTF-8 character set, with a maximum of 64 characters.
	BackupLocationName string `json:"backup_location_name"`
}

StorageBackupScheduleProperties contains properties of a storage backup schedule.

type StorageBackupScheduleRelation added in v3.2.0

type StorageBackupScheduleRelation 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 character set, 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"`
}

StorageBackupScheduleRelation represents a relation between a storage backup schedule and a storage backup.

type StorageBackupScheduleRelations added in v3.2.0

type StorageBackupScheduleRelations struct {
	// Array of all related backups (backups taken by this storage backup schedule).
	StorageBackups []StorageBackupScheduleRelation `json:"storages_backups"`
}

StorageBackupScheduleRelations contains a list of relations between a storage backup schedule and storage backups.

type StorageBackupScheduleUpdateRequest added in v3.2.0

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

	// The interval at which the schedule will run (in minutes). Optional.
	// Allowed value >= 60
	RunInterval int `json:"run_interval,omitempty"`

	// The amount of backups to keep before overwriting the last created backup. Optional.
	// value >= 1
	KeepBackups int `json:"keep_backups,omitempty"`

	// The date and time that the storage backup schedule will be run. Optional.
	NextRuntime *GSTime `json:"next_runtime,omitempty"`

	// Status of the schedule. Optional.
	Active *bool `json:"active,omitempty"`
}

StorageBackupScheduleUpdateRequest represents a request for updating a storage backup schedule.

type StorageBackupUsageProperties added in v3.8.0

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

	// The name of the backup equals schedule name plus backup UUID.
	Name string `json:"name"`

	// 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 size of a backup in GB.
	Capacity int `json:"capacity"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

StorageBackupUsageProperties holds properties of a storage bakup usage.

type StorageBackupsUsage added in v3.8.0

type StorageBackupsUsage struct {
	ResourcesUsage []StorageBackupUsageProperties `json:"storage_backups"`
}

StorageBackupsUsage represents usage of storage backups.

type StorageCreateRequest

type StorageCreateRequest struct {
	// Required (integer - minimum: 1 - maximum: 4096).
	Capacity int `json:"capacity"`

	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// Storage variant. Allowed values: nil, DistributedStorageVariant, LocalStorageVariant. Optional.
	StorageVariant StorageVariant `json:"storage_variant,omitempty"`

	// An object holding important values such as host names, passwords, and SSH keys.
	// Creating a storage with a template is required either SSH key or password.
	// Optional
	Template *StorageTemplate `json:"template,omitempty"`

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

StorageCreateRequest represents a request for creating a storage.

type StorageDevice added in v3.11.0

type StorageDevice string
const (
	IDEStorageDevice         StorageDevice = "ide"
	SATAStorageDevice        StorageDevice = "sata"
	VirtIOSCSItorageDevice   StorageDevice = "virtio_scsi"
	VirtIOBlockStorageDevice StorageDevice = "virtio_block"
)

All available storage devices.

type StorageList

type StorageList struct {
	// Array of storages.
	List map[string]StorageProperties `json:"storages"`
}

StorageList holds a list of storages.

type StorageOperator added in v3.2.0

type StorageOperator interface {
	GetStorage(ctx context.Context, id string) (Storage, error)
	GetStorageList(ctx context.Context) ([]Storage, error)
	GetStoragesByLocation(ctx context.Context, id string) ([]Storage, error)
	CreateStorage(ctx context.Context, body StorageCreateRequest) (CreateResponse, error)
	CreateStorageFromBackup(ctx context.Context, backupID, storageName string) (CreateResponse, error)
	UpdateStorage(ctx context.Context, id string, body StorageUpdateRequest) error
	CloneStorage(ctx context.Context, id string) (CreateResponse, error)
	DeleteStorage(ctx context.Context, id string) error
	GetDeletedStorages(ctx context.Context) ([]Storage, error)
	GetStorageEventList(ctx context.Context, id string) ([]Event, error)
}

StorageOperator provides an interface for operations on 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 character set, 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"`

	// **DEPRECATED** 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 data center an object belongs to.
	LocationUUID string `json:"location_uuid"`

	// Storage type.
	// (one of storage, storage_high, storage_insane).
	StorageType string `json:"storage_type"`

	// Storage variant.
	// (one of local or distributed).
	StorageVariant string `json:"storage_variant"`

	// 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

	// The human-readable name of the location. It supports the full UTF-8 character set, 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 holds properties of a storage. A storages can be retrieved and attached to servers via the storage UUID.

type StorageRelations

type StorageRelations struct {
	// Array of related servers.
	Servers []StorageServerRelation `json:"servers"`

	// Array if related snapshot schedules.
	SnapshotSchedules []StorageAndSnapshotScheduleRelation `json:"snapshot_schedules"`
}

StorageRelations holds a list of a storage's relations. The relations consist of storage-server relations and storage-snapshotschedule relations.

type StorageRollbackRequest

type StorageRollbackRequest struct {
	// Rollback=true => storage will be restored.
	Rollback bool `json:"rollback,omitempty"`
}

StorageRollbackRequest represents a request for rolling back a storage.

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 character set, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

StorageServerRelation represents a relation between a storage and a server.

type StorageSnapshot

type StorageSnapshot struct {
	// Properties of a snapshot.
	Properties StorageSnapshotProperties `json:"snapshot"`
}

StorageSnapshot represents a single storage snapshot.

type StorageSnapshotCreateRequest

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

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

StorageSnapshotCreateRequest represents 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 represents 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 represents a request for exporting a storage snapshot to S3.

type StorageSnapshotList

type StorageSnapshotList struct {
	// Array of snapshots.
	List map[string]StorageSnapshotProperties `json:"snapshots"`
}

StorageSnapshotList holds a list of storage snapshots.

type StorageSnapshotOperator added in v3.2.0

type StorageSnapshotOperator interface {
	GetStorageSnapshotList(ctx context.Context, id string) ([]StorageSnapshot, error)
	GetSnapshotsByLocation(ctx context.Context, id string) ([]StorageSnapshot, error)
	GetStorageSnapshot(ctx context.Context, storageID, snapshotID string) (StorageSnapshot, error)
	CreateStorageSnapshot(ctx context.Context, id string, body StorageSnapshotCreateRequest) (StorageSnapshotCreateResponse, error)
	UpdateStorageSnapshot(ctx context.Context, storageID, snapshotID string, body StorageSnapshotUpdateRequest) error
	DeleteStorageSnapshot(ctx context.Context, storageID, snapshotID string) error
	GetDeletedSnapshots(ctx context.Context) ([]StorageSnapshot, error)
	RollbackStorage(ctx context.Context, storageID, snapshotID string, body StorageRollbackRequest) error
	ExportStorageSnapshotToS3(ctx context.Context, storageID, snapshotID string, body StorageSnapshotExportToS3Request) error
}

StorageSnapshotOperator provides an interface for operations on 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 character set, 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 character set, 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 data center 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"`

	// **DEPRECATED** 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 character set, 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 holds properties of a storage snapshot. A snapshot can be retrieved, exported to an object storage, and used to rollback a storage via the snapshot UUID.

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 character set, 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 character set, with a maximum of 64 characters.
	ObjectName string `json:"object_name"`
}

StorageSnapshotRelation represents 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 represents a single storage snapshot schedule.

type StorageSnapshotScheduleCreateRequest

type StorageSnapshotScheduleCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 represents 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 represents 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 holds a list of storage snapshot schedules.

type StorageSnapshotScheduleOperator added in v3.2.0

type StorageSnapshotScheduleOperator interface {
	GetStorageSnapshotScheduleList(ctx context.Context, id string) ([]StorageSnapshotSchedule, error)
	GetStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string) (StorageSnapshotSchedule, error)
	CreateStorageSnapshotSchedule(ctx context.Context, id string, body StorageSnapshotScheduleCreateRequest)
	UpdateStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string, body StorageSnapshotScheduleUpdateRequest)
	DeleteStorageSnapshotSchedule(ctx context.Context, storageID, scheduleID string) error
}

StorageSnapshotScheduleOperator provides an interface for operations on 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 character set, 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 holds 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 character set, 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 represents a relation between a storage snapshot schedule and a storage snapshot.

type StorageSnapshotScheduleRelations

type StorageSnapshotScheduleRelations struct {
	// Array of all related snapshots (snapshots taken by this snapshot schedule).
	Snapshots []StorageSnapshotScheduleRelation `json:"snapshots"`
}

StorageSnapshotScheduleRelations holds a list of relations between a storage snapshot schedule and storage snapshots.

type StorageSnapshotScheduleUpdateRequest

type StorageSnapshotScheduleUpdateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 represents 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 character set, with a maximum of 64 characters.
	// Optional.
	Name string `json:"name,omitempty"`

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

StorageSnapshotUpdateRequest represents a request for updating a storage snapshot.

type StorageTemplate

type StorageTemplate struct {
	// List of SSH key UUIDs. 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 plain-text or a crypt string (modular crypt format - MCF). Optional.
	Password string `json:"password,omitempty"`

	// Password type. Allowed values: not-set, 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 represents a storage template. StorageTemplate is used when you want to create a storage from a template (e.g. Ubuntu 20.04 template), the storage should be attached to a server later to create an Ubuntu 20.04 server.

type StorageType added in v3.2.0

type StorageType string

StorageType represents a storages physical capabilities.

const (
	DefaultStorageType StorageType = "storage"
	HighStorageType    StorageType = "storage_high"
	InsaneStorageType  StorageType = "storage_insane"
)

All allowed storage type's values

type StorageUpdateRequest

type StorageUpdateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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"`

	// Storage type. Allowed values: nil, DefaultStorageType, HighStorageType, InsaneStorageType. Optional. Downgrading is not supported.
	StorageType StorageType `json:"storage_type,omitempty"`
}

StorageUpdateRequest represents a request for updating a storage.

type StorageUsageProperties added in v3.8.0

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

	// 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

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

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

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

	// Storage type.
	// (one of storage, storage_high, storage_insane).
	StorageType string `json:"storage_type"`

	// Indicates the UUID of the last used template on this storage.
	LastUsedTemplate string `json:"last_used_template"`

	// The capacity of a storage/ISO image/template/snapshot in GB.
	Capacity int `json:"capacity"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

StorageUsageProperties holds the properties of a distributed/rocket storage usage.

type StorageVariant added in v3.5.0

type StorageVariant string

StorageVariant represents a storage variant.

const (
	DistributedStorageVariant StorageVariant = "distributed"
	LocalStorageVariant       StorageVariant = "local"
)

All allowed storage variant's values

type Template

type Template struct {
	// Properties of a template.
	Properties TemplateProperties `json:"template"`
}

Template represents a single OS template.

type TemplateCreateRequest

type TemplateCreateRequest struct {
	// The human-readable name of the object. It supports the full UTF-8 character set, 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 represents the request for creating a new OS template from an existing storage snapshot.

type TemplateList

type TemplateList struct {
	// Array of templates.
	List map[string]TemplateProperties `json:"templates"`
}

TemplateList holds a list of templates.

type TemplateOperator added in v3.2.0

type TemplateOperator interface {
	GetTemplate(ctx context.Context, id string) (Template, error)
	GetTemplateByName(ctx context.Context, name string) (Template, error)
	GetTemplateList(ctx context.Context) ([]Template, error)
	CreateTemplate(ctx context.Context, body TemplateCreateRequest) (CreateResponse, error)
	UpdateTemplate(ctx context.Context, id string, body TemplateUpdateRequest) error
	DeleteTemplate(ctx context.Context, id string) error
	GetDeletedTemplates(ctx context.Context) ([]Template, error)
	GetTemplateEventList(ctx context.Context, id string) ([]Event, error)
}

TemplateOperator provides an interface for operations on OS 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 data center an object belongs to.
	LocationUUID string `json:"location_uuid"`

	// A version string for this template.
	Version string `json:"version"`

	// Description of the template.
	LocationIata string `json:"location_iata"`

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

	// Whether 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 GiB.
	Capacity int `json:"capacity"`

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

	// The OS distribution of this template.
	Distro string `json:"distro"`

	// Description of the template.
	Description string `json:"description"`

	// **DEPRECATED** 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 character set, with a maximum of 64 characters.
	LocationCountry string `json:"location_country"`

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

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

TemplateProperties holds the properties of an OS template. OS templates can be selected by a user when creating new storages and attaching them to servers. Usually there are a fixed number of OS templates available and you would reference them by name or ObjectUUID.

type TemplateUpdateRequest

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

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

TemplateUpdateRequest represents a request to update a OS template.

type TemplateUsageProperties added in v3.8.0

type TemplateUsageProperties 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 character set, with a maximum of 64 characters.
	Name string `json:"name"`

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

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

	// A version string for this template.
	Version string `json:"version"`

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

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

	// Whether the object is private, the value will be true. Otherwise the value will be false.
	Private bool `json:"private"`

	// 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 capacity of a storage/ISO image/template/snapshot in GiB.
	Capacity int `json:"capacity"`

	// The OS distribution of this template.
	Distro string `json:"distro"`

	// Description of the template.
	Description string `json:"description"`

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

	// Uuid of the project used to create this template.
	ProjectUUID string `json:"project_uuid"`

	// True if the object is deleted.
	Deleted bool `json:"deleted"`

	// Current usage of active product.
	CurrentUsagePerMinute []Usage `json:"current_usage_per_minute"`

	// Usage of active product within a specific interval.
	UsagePerInterval []UsagePerInterval `json:"usage_per_interval"`
}

TemplateUsageProperties holds properties of a template usage.

type TemplatesUsage added in v3.8.0

type TemplatesUsage struct {
	ResourcesUsage []TemplateUsageProperties `json:"templates"`
}

TemplatesUsage represents usage of templates.

type TransportLayerProtocol added in v3.2.0

type TransportLayerProtocol string

TransportLayerProtocol represents a layer 4 protocol.

var (
	TCPTransport TransportLayerProtocol = "tcp"
	UDPTransport TransportLayerProtocol = "udp"
)

All available transport protocols.

type USBController added in v3.11.0

type USBController string
const (
	NecXHCIUSBController   USBController = "nec_xhci"
	Piix3UHCIUSBController USBController = "piix3_uhci"
)

All available USB controllers.

type Usage added in v3.8.0

type Usage struct {
	// Number of a product.
	ProductNumber int `json:"product_number"`

	// Total usage of a product.
	Value int `json:"value"`
}

Usage represents usage of a product.

type UsageOperator added in v3.8.0

type UsageOperator interface {
	GetGeneralUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (GeneralUsage, error)
	GetServersUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (ServersUsage, error)
	GetDistributedStoragesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (DistributedStoragesUsage, error)
	GetRocketStoragesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (RocketStoragesUsage, error)
	GetStorageBackupsUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (StorageBackupsUsage, error)

	GetTemplatesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (TemplatesUsage, error)
	GetISOImagesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (ISOImagesUsage, error)
	GetIPsUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (IPsUsage, error)
	GetLoadBalancersUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (LoadBalancersUsage, error)
	GetPaaSServicesUsage(ctx context.Context, queryLevel usageQueryLevel, fromTime GSTime, toTime *GSTime, withoutDeleted bool, intervalVariable string) (PaaSServicesUsage, error)
	// contains filtered or unexported methods
}

UsageOperator provides an interface for operations on usage.

type UsagePerInterval added in v3.8.0

type UsagePerInterval struct {
	// Start accumulation period.
	IntervalStart GSTime `json:"interval_start"`

	// interval_end
	IntervalEnd GSTime `json:"interval_end"`

	// Accumulation of product's usage in given period
	AccumulatedUsage []Usage `json:"accumulated_usage"`
}

UsagePerInterval represents usage of active product within a specific interval.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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